Renaming Anime and Movies in CLI and GUI
Posted: 18 Sep 2018, 03:22
I'm trying to write a renaming script in groovy to process my media, but I can't get filebot to reliably rename my stuff.
Here is an example of what I mean in the GUI:


The file already contains the title "Overlord II" in a consistent format, is there any way I can force filebot to search a specific title?
This happens frequently in my groovy script as well:
As you can see it gets painfully close to recognizing the title, but it somehow trips itself up by putting the query in lowercase and then it fails to match the uppercase letters? What is causing this to fail? Why does "overlord ii" not match "Overlord II"?
and the script that produces these logs for context:
For extra context, this anime uses different titles for each season 1-3.
Excuse me if this comes off as venting I'm just frustrated with the CLI being so sensitive.
Here is an example of what I mean in the GUI:


The file already contains the title "Overlord II" in a consistent format, is there any way I can force filebot to search a specific title?
This happens frequently in my groovy script as well:
Code: Select all
Post processing /media/movies/Jurassic World: Fallen Kingdom (2018)/.torrent/Jurassic.World.Fallen.Kingdom.2018.1080p.WEB-DL.DD5.1.H264-FGT
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/media/movies/Jurassic World: Fallen Kingdom (2018)/.torrent/Jurassic.World.Fallen.Kingdom.2018.1080p.WEB-DL.DD5.1.H264-FGT/Jurassic.World.Fallen.Kingdom.2018.1080p.WEB-DL.DD5.1.H264-FGT.mkv]
Apply filter [ext == "mkv" || ext == "avi" || ext == "mp4"] on [1] items
CmdlineException: Failed to identify or process any files
Done ヾ(@⌒ー⌒@)ノ
Post processing /media/animu/series/Overlord/.torrent/[HorribleSubs] Overlord II - 04 [1080p].mkv
Rename episodes using [AniDB]
Auto-detected query: [Overlord, overlord ii]
Fetching episode data for [Overlord]
Fetching episode data for [Overlord II]
Fetching episode data for [Overlord III]
Fetching episode data for [Ple Ple Pleiades]
Fetching episode data for [Gekijouban Soushuuhen Overlord]
Apply filter [ext == "mkv" || ext == "avi" || ext == "mp4"] on [77] items
No matching episode: [HorribleSubs] Overlord II - 04 [1080p].mkv
CmdlineException: Failed to match files to episode data
Done ヾ(@⌒ー⌒@)ノ
Post processing /media/animu/series/Overlord/.torrent/[HorribleSubs] Overlord II - 01 [1080p].mkv
Rename episodes using [AniDB]
Auto-detected query: [Overlord, overlord ii]
Fetching episode data for [Overlord]
Fetching episode data for [Overlord II]
Fetching episode data for [Overlord III]
Fetching episode data for [Ple Ple Pleiades]
Fetching episode data for [Gekijouban Soushuuhen Overlord]
Apply filter [ext == "mkv" || ext == "avi" || ext == "mp4"] on [77] items
No matching episode: [HorribleSubs] Overlord II - 01 [1080p].mkv
CmdlineException: Failed to match files to episode data
Done ヾ(@⌒ー⌒@)ノ
Post processing /media/animu/series/Overlord/.torrent/[HorribleSubs] Overlord II - 02 [1080p].mkv
Rename episodes using [AniDB]
Auto-detected query: [Overlord, overlord ii]
Fetching episode data for [Overlord]
Fetching episode data for [Overlord II]
Fetching episode data for [Overlord III]
Fetching episode data for [Ple Ple Pleiades]
Fetching episode data for [Gekijouban Soushuuhen Overlord]
Apply filter [ext == "mkv" || ext == "avi" || ext == "mp4"] on [77] items
No matching episode: [HorribleSubs] Overlord II - 02 [1080p].mkv
CmdlineException: Failed to match files to episode data
Done ヾ(@⌒ー⌒@)ノ
Post processing /media/animu/series/Overlord/.torrent/[HorribleSubs] Overlord II - 03 [1080p].mkv
Rename episodes using [AniDB]
Auto-detected query: [Overlord, overlord ii]
Fetching episode data for [Overlord]
Fetching episode data for [Overlord II]
Fetching episode data for [Overlord III]
Fetching episode data for [Ple Ple Pleiades]
Fetching episode data for [Gekijouban Soushuuhen Overlord]
Apply filter [ext == "mkv" || ext == "avi" || ext == "mp4"] on [77] items
No matching episode: [HorribleSubs] Overlord II - 03 [1080p].mkv
CmdlineException: Failed to match files to episode data
Done ヾ(@⌒ー⌒@)ノ
and the script that produces these logs for context:
Code: Select all
#!/usr/bin filebot -script
//parameters torrentDir and torrentName from transmission
//default formats
series_format = "{n} - {s00e00} - {t}"
ani_series_db = "AniDB"
movie_format = "{n} ({y})"
movie_db = "TheMovieDB"
video_filter = /ext == "mkv" || ext == "avi" || ext == "mp4"/
// log input parameters
log.fine("Post processing $torrentDir/$torrentName")
directory = torrentDir.split("/")
if(torrentName ==~ /.*\.(mkv|avi|mp4)/) {
file = "$torrentDir/$torrentName"
if(directory[1] == "media") {
if(directory[2] == "animu") {
if(directory[3] == "series") {
rename_anime_series(directory[4]);
}
}
if(directory[2] == "movies") {
words = directory[3].split(" ")
rename_movie(directory[3]);
}
}
}
else if(directory[1] == "media") {
folder = "$torrentDir/$torrentName"
if(directory[2] == "animu"){
if(directory[3] == "series") {
rename_anime_series_folder(directory[4]);
}
}
else if(directory[2] == "movies") {
rename_movie_folder(directory[3])
}
}
def rename_anime_series(series_title) {
results = rename(file: file, output: "/media/animu/series/$series_title/", action: "symlink", format: series_format, db: ani_series_db, filter: video_filter, strict: false)
}
def rename_anime_series_folder(series_title) {
results = rename(folder: folder, output: "/media/animu/series/$series_title/", action: "symlink", format: series_format, db: ani_series_db, filter: video_filter, strict: false)
}
def rename_movie(movie_title) {
results = rename(file: file, output: "/media/movies/$movie_title/", action: "symlink", format: movie_format, db: movie_db, filter: video_filter, strict: false)
}
def rename_movie_folder(movie_title) {
results = rename(folder: folder, output: "/media/movies/$movie_title/", action: "symlink", format: movie_format, db: movie_db, filter: video_filter, strict: false)
}
Excuse me if this comes off as venting I'm just frustrated with the CLI being so sensitive.