Please help me with avoiding duplicate titles
Posted: 27 Jul 2014, 03:10
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.
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.