Here is my "problem" ...
I'm mostly happy with the way that NZBGet puts all the files downloaded for an NZB in a folder using the "name" from the NZB header. I move these folders manually from NZBGet's DestDir to my own folder structure. Obfuscated filenames are not usually a problem for me as I am using the folder names to identify downloads. But on my iPhone/iPads I use the app Infuse (
https://firecore.com/infuse). When using this app to browse folders it works as you would expect, except when a folder contains only one video file, it does not show the folder, but instead only shows the video file. This becomes a problem when that file has an obfuscated filename. The folder name is still good, but the Infuse app does not show the folder so it is hard to identify files.
So I tried using VideoSort. What I want to do is *NOT* move any files from the folder that NZBGet creates in "DestDir", but to rename the video files inside the folder. However, it appears that VideoSort always moves the video files to another folder.
So I made some changes that appear to work, for me at least. I am *NOT* a Python programmer, but I have worked in a number of other languages, and I can often get by cut and pasting small sections of code
What I did was make "." a special case for destination directories where if specified the "dest_dir" will be set from the source filename, so in effect, the file(s) will not be moved from their original folder.
I also have to check to see if "new_path" file name if the same as the original "filename" to prevent renaming to "filename.(2).ext"
Both of these code snippets are in the function "construct_path(filename)"
----
Code: Select all
if dest_dir == '':
dest_dir = os.path.dirname(download_dir)
----
becomes ...
----
Code: Select all
if dest_dir == '':
dest_dir = os.path.dirname(download_dir)
if dest_dir == '.':
dest_dir = os.path.dirname(filename)
----
and
----
----
becomes
----
Code: Select all
if filename == new_path:
if verbose:
print('filename == new_path - return None')
return None
return new_path
----
There is probably plenty that is wrong with this implementation, (for example, I'm not too sure how well it will work with "Cleanup" or "Overwrite" set to "yes" ... I have both options set to "No") but its working well enough for me at the moment.
But I do think that this option to not move the files from the original folder would be useful if it could be implemented properly into the official code.