Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[renamerOnUpdate] Major Update (Bulk, Mover...) #70

Merged
merged 53 commits into from
Sep 15, 2022

Conversation

Belleyy
Copy link
Contributor

@Belleyy Belleyy commented Jul 28, 2022

⚠️ TEST AT YOUR OWN RISK ⚠️

(just use dry-run, you should be fine 😄 )

Features

  • Template to move your files
  • Bulk task to rename all your scenes with a button ... #66
  • Dry-run (Do a trial run with no permanent changes)

New option

  • More field (mostly movie related)

  • option to sort of the order of performer (Name, ID, Favorite, Rating)

  • option to keep performer if it reach the performer limit

  • group in template, you can group character with {}. kinda [renamerOnUpdate] Advanced filename formatting #68
    Exemple: [$studio] {$date -} $title The - is with the date, so if the date is empty, - will be remove as well

  • Add a option to replace thing in your filename. ([renamerOnUpdate] Add option to replace thing #67)

    The second element of the list determine the system used. If you don't put this element, the default is word
    regex: match a regex, word: match a word, any: match anything
    difference between word & any: word is between seperator (space _ -), any is anything ('ring' would replace 'during')

    Exemple:
    "Scene": ["Sc.", "word"] - Replace Scene by Sc.
    r"S\d+:E\d+": ["", "regex"] - Remove Sxx:Ex (x is a digit)

replace_words = {
    r"S\d+:E\d+": ["", "regex"],
    "Be": ["lol", "word"],
    "Do": ["Is", "any"]
}
#Darcy Does It Best - S22:E6 -> Darcy Ises It Best

Deprecation

  • Remove field to have the correct length if reached the max .

@scruffynerf
Copy link
Contributor

Found a bug, replicated repeatedly:

Move a file so it's not where Stash expects, but it's still within the scan.
Have another file already in place, which this plugin would want to use as the name/location for the first file when it renames it. (so the renamer will fail to change the name/path, and leave the file alone)

When Renamer attempts to move/rename the file, it will fail with 'database is locked' error.
The file path isn't updated, and so the file is considered lost (it didn't save at the rename location NOR did it record the new location), so a clean will now show the file entry in the DB as 'missing and removable' and no matter if you scan again, it won't add, because Renamer fails it again. Without Renamer, the scan would work, it's Renamer causing the bug.

@bnkai
Copy link
Collaborator

bnkai commented Sep 15, 2022

@Belleyy merging this as it looks ok. Can you update when possible to make sure it doesnt run with the filles-refactor version (at least till you add support for it) ? You can use the systemStatus query to get the database schema version as an int https://github.com/stashapp/stash/wiki/API#get-system-status

@bnkai bnkai merged commit b662327 into stashapp:main Sep 15, 2022
@Belleyy Belleyy deleted the patch-17 branch November 12, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants