One operation for renaming and file move & fixe for episodes without seasons #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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