Hi there,
I have a decent understanding of scripting, although know nothing of groovy, and I've managed to establish a beautiful workflow automation between automatic torrent downloading to my seedbox, automated FTP from seedbox to local file server and then invoking Filebot to process the downloaded files. So far, it works BEAUTIFULLY!! I am beside myself as to how fluidly this works and many thanks to RedNoah for this wonderful creation.
I use the AMC.groovy script to do my file sorting and it works except for ONE problem. The problem I run into is that often, my seedbox will auto-download 2-3 versions of the same movie title OR sometimes download a better quality version of a movie that I already have. Because I've set up FileBot to process each movie into a separate folder by title -- such that, <movie name> (<year>)/ {fn}, as a consequence of this setup I will often end up with 2-3 versions of the same movie. For example,
Avatar (2009)/Avatar.2009.1080p.x264-TayTo.mkv
Avatar (2009)/Avatar.2009.1080p.YIFY.mkv
Avatar (2009)/Avatar.2009.720p.x264-SPARKS.mp4
I don't need several versions of the same file, and if I use --conflicts override, since the filenames are unique, FileBot will interpret this as having no conflicts. Moreover, I actually don't want to rename the filename since I would like to preserve the ability to know which source I got my movies from. (This is my rationale for keeping original filenames although I sort them into specific folders by movie title (year).
In other words, if I downloaded a SD version of a movie from a few years ago, when the 1080p version is released, I'd love it if FileBot could look at the folder and decide if it should copy the movie into the folder or not, based on the sizes of the existing files. I would imagine a custom script would do something like this.
Lets say that the file about to be copied is MovieX.mkv
1. FileBot checks to see if /MovieX (<year>) exists in output location.
-- If yes (movie exists),
2------------- Filebot reads the size of any file in that location that has extension *.avi, *.mp4, *.mkv, *.m4v, *.mpg AND a file-size > 100 MB (this avoids reading trailer files).
3a------------- If MovieX.mkv size > any of the pre-specified file(s) at that location, delete ALL pre-specified files at the target location and copy MovieX.mkv to target location.
3b------------- If MovieX.mkv is = or < than any of the pre-specified files at the location, then DO NOT COPY the file.
-- If no (movie doesn't exist),
4------------ Create MovieX (<year>) folder.
5------------ Copy file (MovieX.mkv) to target folder.
I can think of the algorithm here, but don't know Groovy syntax to put this into my own script.
Can anyone advise me if such a mechanism exists with AMC.groovy or whether this is something small enough that someone can write. Perhaps someone has created a script that can accomplish this?
Thank you.
Please help me with avoiding duplicate titles
Re: Please help me with avoiding duplicate titles
The amc does not support what you need since you disable -- conflict by using {fn}
I would leave amc alone and make another extra script that just checks threw your folders and removes duplicates.
I would leave amc alone and make another extra script that just checks threw your folders and removes duplicates.
Re: Please help me with avoiding duplicate titles
Rednoah,
Thanks for the post. I guess I can always allow FileBot to use the renamed filename.. How would I do it?
Below is the filebot command my script invokes:
Would I just change the
to
Also, one last question...
If I were to keep the movie name as {n} instead of {fn}, how exactly does Filebot resolve conflicts?
Does it abort the copy process into the target folder if the target movie exists?
Or does it overwrite the existing movie with the new copy?
The way I'd like Filebot to resolve conflicts is if Filebot would ONLY copy the movie to the target folder if the movie being copied is larger than the movie that already exists in the target folder. That way, I will always have the highest quality movie on the said folder. Is there a way to accomplish that with the existing AMC script?
Thank you so much for your help.
Thanks for the post. I guess I can always allow FileBot to use the renamed filename.. How would I do it?
Below is the filebot command my script invokes:
Code: Select all
filebot -script fn:amc "/home/rwickra/seedbox" --output "/home/rwickra" --log-file amc.log --action copy --conflict override -no-xattr -non-strict music=y subtitles=en artwork=y excludeList=amc-exclude.txt deleteAfterExtract=y clean=y unsorted=y "movieFormat=/media/movies/{n} ({y})/{fn}" "musicFormat=/media/music/{n}/{fn}" "seriesFormat=/media/tvshows/{n}/{'Season '+s.pad(2)}/{n} - {s00e00} - {t}"
Code: Select all
"movieFormat=/media/movies/{n} ({y})/{fn}"
Code: Select all
"movieFormat=/media/movies/{n} ({y})/{n}"
Also, one last question...
If I were to keep the movie name as {n} instead of {fn}, how exactly does Filebot resolve conflicts?
Does it abort the copy process into the target folder if the target movie exists?
Or does it overwrite the existing movie with the new copy?
The way I'd like Filebot to resolve conflicts is if Filebot would ONLY copy the movie to the target folder if the movie being copied is larger than the movie that already exists in the target folder. That way, I will always have the highest quality movie on the said folder. Is there a way to accomplish that with the existing AMC script?
Thank you so much for your help.
Re: Please help me with avoiding duplicate titles
Yes, if the target file already exists filebot will deal with the conflict.
--conflict skip ... never override existing files
--conflict override ... always override existing files
--conflict auto ... override existing files if newer file is better (e.g. higher resolution, higher filesize, etc)
That's in the docs btw:
--conflict skip ... never override existing files
--conflict override ... always override existing files
--conflict auto ... override existing files if newer file is better (e.g. higher resolution, higher filesize, etc)
That's in the docs btw:
Manual wrote:--conflict skip Never override existing files if the same media is downloaded multiple times
--conflict auto Override existing media only if new media is better
Re: Please help me with avoiding duplicate titles
Hi all. I know this may be an old thread but I am also interested in ideas for dupes. I have different directories with some on network drives, some on local and some in local but different directories. In all of this as some movies were saved by my son off his portable drive, I have the same movie etc in all locations (as an example.
When plex scans, I sometimes end up with 3 listings of the same movie.
IS there a way of finding all the dupes and deleting say 2 of the copies? I was toying with the idea of creating a new directory and having filebot scan all the old ones and dealing with it that way and then saving them in the new dir and deleting all the old ones
Regards, P
When plex scans, I sometimes end up with 3 listings of the same movie.
IS there a way of finding all the dupes and deleting say 2 of the copies? I was toying with the idea of creating a new directory and having filebot scan all the old ones and dealing with it that way and then saving them in the new dir and deleting all the old ones
Regards, P
Re: Please help me with avoiding duplicate titles
I guess you can use all your existing folders as input and then process everything through FileBot and organize everything into a new single output location. You could take care of duplicates that way, but it might not be feasible depending on your setup.