Page 1 of 1

Help

Posted: 05 Feb 2012, 15:12
by yay101
Hey! I am currently trying to make a script that takes all files in a folder "/media/uuid/tv/in" Then runs a rename on the files treating them individually and pushes them to "/media/uuid/tv/out" In the folder / rename structure

"./{n}/Season {s.pad(2)}/{n} - {s.pad(2)}{e.pad(2)} - {t}"

However after spending a few hours not understanding the premade scripts, or more why they actually ork and where they are putting the files i decided to post and ask instead of wasting more time.

For more specifics i would like these files to be checked with tvdb.

Re: Help

Posted: 05 Feb 2012, 16:00
by rednoah
What do you mean by treating files individually? Can we assume there is only TV show episodes in the folder or movies as well?

You can try this, writing from the top of may have to fix typos

"/media/uuid/tv/in".listFiles{ it.isVideo() }.each {
rename(file:it, db:"thetvdb", format:"/media/uuid/tv/out/{n}/Season {s.pad(2)}/{n} - {s.pad(2)}{e.pad(2)} - {t}", strict:true)
}

Re: Help

Posted: 05 Feb 2012, 16:04
by rednoah
btw default values are set by the cmdline call eg -script abc --format ... But can be overriden in the script by just giving it as parameter rename(format:..)

Re: Help

Posted: 05 Feb 2012, 23:08
by yay101
By individually i mean i don't want the program assuming they are all episodes of the same show. Movies will be given their own script.

Having that command used so cleanly, i can now better understand this so thanks. i shall play around with this when i get out of class in a few hours.

Re: Help

Posted: 05 Feb 2012, 23:27
by rednoah
Allowing multiple shows by folder can be enabled by allowing -non-strict matching. Don't even need a script for that, just filebot -rename -non-strict ...

Re: Help

Posted: 05 Feb 2012, 23:36
by yay101
Got an error when i ran that script, it didn't seem to like the list files command. Or perhaps the run closure argument, whatever that is behind the scenes.

You can see the output of the terminal attached and i typed the script, spaces and all as it was displayed in this thread.

Okay sweet, so if i change the strict at the end of the script to non strict it should be fine? Otherwise i will remove it and just add the command to my .sh for launching filebot.

Re: Help

Posted: 05 Feb 2012, 23:47
by rednoah
In the script strict:true should be fine as well since each files is treated individually. But for the usecase you just told me you don't need scripting at all, the normal cmdline -rename should be a me to handle that if you enable comprehensive matching via -non-strict

I'm writing this on my phone so I can't test anything, but should work like this.

Re: Help

Posted: 06 Feb 2012, 00:25
by yay101
Hey mate, you were right. It is indeed far easier to just use the CLI.

My CLI currently reads:
java -jar ~/FileBot.jar -rename "/media/d371490f-2a37-4a19-a988-08b48f538ef4/Tv/In" --db thetvdb -non-strict --log all --output "/media/d371490f-2a37-4a19-a988-08b48f538ef4/Tv/Out/" --format "{n}/Season {s.pad(2)}/{n} - {s.pad(2)}{e.pad(2)} - {t}"

It is meant to follow the output command and put it in the out folder however currently it is just renaming and putting them back in the right folder in the in folder.

Re: Help

Posted: 06 Feb 2012, 01:19
by rednoah
The --format option defines the whole path, not just the filename.

--output is not what you think, only for -get-subtitles and -create-sfv

Re: Help

Posted: 06 Feb 2012, 02:44
by yay101
Cheers, that definitely helps.