Page 1 of 1
Rename Script
Posted: 09 Sep 2015, 12:46
by Automator
Hi there,
I am trying to find out what I am doing wrong or if the script is having a bug?
Code: Select all
java -jar /usr/bin/filebot/FileBot.jar -script fn:renall "/home/downloads/Bibi.und.Tina.voll.Verhext.2014.German.1080p.BluRay.x264/" -non-strict --db TheMovieDB --def target=folder --action move --output "/mnt/temp/1080p/" --log info --log-file filebot.log
Sep 09, 2015 2:39:46 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Sep 09, 2015 2:39:52 PM net.filebot.web.TMDbClient getMovieInfo
WARNING: Movie data not found: Bibi und Tina: Voll Verhext! (2014) [354663 / -1]
CmdlineException: Unable to identify or process any files
Thanks for any advice
Cheers
Automator
Re: Rename Script
Posted: 09 Sep 2015, 14:00
by rednoah
1.
filebot.sh is there for a reason. Use it.
2.
Have you tried --lang de yet?
If you process German-named files in English-mode then it won't necessarily work. Especially for the oddball movies.
Re: Rename Script
Posted: 09 Sep 2015, 15:58
by Automator
Sorry, I thought there is more debug information with running it as a jar file...
Code: Select all
/usr/bin/filebot/filebot.sh -script fn:renall "/home/downloads/Bibi.und.Tina.voll.Verhext.2014.German.1080p.BluRay.x264/" -non-strict --lang de --db TheMovieDB --def target=folder --action move --output "/mnt/temp/1080p/" --log info --log-file filebot.log
Sep 09, 2015 5:55:38 PM net.filebot.web.TMDbClient getMovieInfo
WARNING: Movie data not found: Bibi und Tina: Voll Verhext! (2014) [354663 / -1]
CmdlineException: Unable to identify or process any files
Re: Rename Script
Posted: 09 Sep 2015, 16:02
by Automator
I am also trying to create my own groovy script with all the stuff I want... the biggest issue i have so far is how to move all the .srt and .idx and .sub files from a subfolder in the eachMediaFolder up to the eachMediaFolder
For example:
MovieName
------> Subs
----------> MovieName.en.srt
----------> MovieName.de.srt
and I want to move the two srt file up to the folder MovieName
Re: Rename Script
Posted: 09 Sep 2015, 16:13
by Automator
I just found out that with:
Code: Select all
args.getFiles{ it.isSubtitle()}
.each{
println it
}
I can get all the subs

but how do I move them now
Re: Rename Script
Posted: 09 Sep 2015, 16:47
by rednoah
This should work:
Code: Select all
args.getFiles{ it.isSubtitle() }*.copyTo('/path/to/folder' as File)
Re: Rename Script
Posted: 09 Sep 2015, 16:55
by Automator
I did it like this:
Code: Select all
//Get the Parent Folder
args.eachMediaFolder{
ParentFolder = it
}
//Move all the Subtitles to the Parent Folder
args.getFiles{ it.isSubtitle()}
.each{
rename(file:it,output:ParentFolder,format:"{fn}")
}
But I guess yours is cleaner

Re: Rename Script
Posted: 11 Sep 2015, 08:21
by Automator
I changed the code slightly
Code: Select all
SubFolder = null
args.getFiles{ it.isSubtitle() }
.each{
SubFolder = new File(getMediaInfo(file:it, format:"{folder}"))
it.moveTo(new File(getMediaInfo(file:it, format:ParentFolder+"/{fn}.{ext}")))
}
if (SubFolder != null && SubFolder.getFiles().isEmpty()) SubFolder.deleteDir()
but I have a new little issue... I sometimes have .sfv or what ever garbage files in the SubFolder... how can I remove them easly?
And did you see the output of the .sh run with --lang de? Still the same result...
Re: Rename Script
Posted: 11 Sep 2015, 08:37
by rednoah
Simple Java/Groovy code will do:
Whatever you're doing,
File.isSubtitle() certainly does
not return
true for *.sfv files.
Re: Rename Script
Posted: 12 Sep 2015, 12:59
by Automator
I implemented a part of your cleanup script

to get rid of the .sfv files and the sub folder after its empty.
What about the issue with the movie I posted?
Re: Rename Script
Posted: 12 Sep 2015, 16:17
by rednoah
So I had a look at the HTTP Request/Response and it looks like TheTVDB is sending back conflicting data:
Code: Select all
{
"page": 1,
"results": [{
"adult": false,
"backdrop_path": null,
"genre_ids": [],
"id": 354663,
"original_language": "de",
"original_title": "Bibi und Tina: Voll Verhext!",
"overview": "The Girl Witch Bibi Blocksberg and her best friend Tina seek out on their second adventure on a horse ranch.",
"release_date": "2014-12-25",
"poster_path": null,
"popularity": 1.089,
"title": "Bibi und Tina: Voll Verhext!",
"video": false,
"vote_average": 0.0,
"vote_count": 0
}, {
"adult": false,
"backdrop_path": "/8VLIDCmjwOMJs74IYhiQ2kmDwe2.jpg",
"genre_ids": [12, 10751],
"id": 301825,
"original_language": "de",
"original_title": "Bibi & Tina - Voll verhext!",
"overview": "Sequel to the Movie \"Bibi & Tina - Der Film\" about a teen witch, her best friend and their horses.",
"release_date": "2014-12-25",
"poster_path": "/aV95CutQvY1pAdM044Md0a1T9lM.jpg",
"popularity": 1.694438,
"title": "Bibi & Tina - Voll verhext!",
"video": false,
"vote_average": 8.0,
"vote_count": 1
}],
"total_pages": 1,
"total_results": 2
}
Looks like it was somehow added twice, and one entry is now dead (though it somehow shows up during API search for some reason = bug).