One operation for renaming and file move & fixe for episodes without seasons#83
One operation for renaming and file move & fixe for episodes without seasons#83averissimo wants to merge 3 commits into
Conversation
Do you know that your code is based on old revision of tvnamer? Your branch has separated 5 months ago and is now about 30 commits behind. See https://github.com/dbr/tvnamer/network for details. |
An example would be a anime episode that does not return a season number from tvdb. example: [GroupA] Naruto Shippuuden - 320 [1080p].mkv It is relevant for when the files are moved to a directory that depends on seasonnumber. Though the best solution would to fallback to a default string - such as "unspecified" - when it would happen, with seasonnumber or any other field.
Thanks for the comments and for leading me in the right direction |
|
Anyway, if you want to implement the general fallback, it can be accomplished using collections.defaultdict or by redefining
|
This will fix two bugs that were affecting me.
1. Fallback to season 0 for episodes without a defined season
For anime episodes that don't have a registered season it was returning a bug instead of falling back to no episode at all. This will fallback to season 0
2. One step for renaming and moving
If the configuration was set to rename and move files this would be done in a two step operation, first rename on the file's original directory and then move to the new path
This poses a problem when leaving symlinks behind as it would leave two symlinks in the original directory and a another symlink in the destination path (if run twice)
Example:
/original/path/Naruto Shippuuden - 323 [1080p].mkv
First run would result on (with always_move, leave_symlink and always_rename = true):
(symlink) /original/path/Naruto Shippuuden - 323 [1080p].mkv
(symlink) /original/path/Naruto Shippuuden - 323 - The Five Kage Assemble [1080p].mkv
(file) /new/path/Naruto Shippuuden - 323 [1080p].mkv
Second run would also create the following symlink:
(symlink) /new/path/Naruto Shippuuden - 323 - The Five Kage Assemble [1080p].mkv
ps. I wasn't able to separate these two pull requests after looking up documentation. If someone could show me how I can separate these