Page 1 of 1

Name Format for File with Multiple TV Episodes

Posted: 24 May 2015, 22:22
by mhe4
I have noticed a change recnently, probably after I updated to Filebot v4.5.6, but I'm not sure when.

For a file such as:

Code: Select all

Show.S01E02E03.avi
Using the command line (in a groovy script):

Code: Select all

rename(file:files, format:'TV_Shows/{n}/{n}.{episode.special ? "S00E"+special.pad(2) : s00e00} - {t}', db:'TheTVDB'
I used to get:

Code: Select all

Show.S01E02E03 - Episode.avi
Now I seem to get:

Code: Select all

Show.S01E02-E03 - Episode.avi
Using YAMJ, this screws up my library because YAMJ stops parsing at the first '-' and takes everything after that as the episode title.

Is there a way to go back to the old way?


Code: Select all

>./filebot.sh -script fn:sysinfo
FileBot 4.5.6 (r2818)
JNA Native: 4.0.0
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-x86/libmediainfo.so) not found in resource path ([file:/volume1/@appstore/filebot/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.path
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.3.9
JRE: Java(TM) SE Embedded Runtime Environment 1.8.0 (headless)
JVM: 32-bit Java HotSpot(TM) Embedded Client VM
CPU/MEM: 4 Core / 239 MB Max Memory / 13 MB Used Memory
OS: Linux (i386)
uname: Linux Storage-2 3.2.40 #5022 SMP Wed Jan 7 14:19:42 CST 2015 x86_64 GNU/Linux synology_cedarview_1812+
Done ã¾(ï¼ âã¼âï¼ )ã

Re: Name Format for File with Multiple TV Episodes

Posted: 24 May 2015, 23:03
by rednoah
If s00e00 has been changed than that's been aloooong time ago.

The solution here is not exactly rocket science :P

Code: Select all

{s00e00.removeAll('-')}

Re: Name Format for File with Multiple TV Episodes

Posted: 25 May 2015, 02:30
by mhe4
Thank you.

I tried it and it gives a syntax error when run.

Code: Select all

rename(file:files, format:'TV_Shows/{n}/{n}.{episode.special ? "S00E"+special.pad(2) : s00e00.removeAll('-')} - {t}', db:'TheTVDB')

Re: Name Format for File with Multiple TV Episodes

Posted: 25 May 2015, 06:33
by rednoah
Use tripple quotes to quote your '''string''' so you don't have to worry about escaping the single quotes in the format.

Re: Name Format for File with Multiple TV Episodes

Posted: 25 May 2015, 17:03
by mhe4
Thank you again.

I got it to work (for single episodes) with:

Code: Select all

rename(file:files, format:'TV_Shows/{n}/{n}.{episode.special ? "S00E"+special.pad(2) : s00e00.removeAll("-")} - {t}', db:'TheTVDB')
I haven't tried a double episode yet.

Re: Name Format for File with Multiple TV Episodes

Posted: 25 May 2015, 18:22
by rednoah

Code: Select all

"S01-E01-E02--test--test".removeAll("-")

Re: Name Format for File with Multiple TV Episodes

Posted: 23 Jul 2015, 20:29
by Eye
I dont get it, ;(

I use {n} - {s.pad(2)+'x'}{e.pad(2)}{' Special '+special.pad(2)} - {t.take(30)} - [{any{group}{'NoGroup'}}] {source} [{resolution}] {video.codecId} {[vc, VF, af]} [{video.bitdepth} {'Bit'}] {audios.language}{'; '+texts.Language_String2}

And i Get usable results except, if i come to a Multipart file; then it Only lists the First episode number As the e binding only list that 1,

sxe i dont get top pad in the right places, any tip were i go wrong?

Re: Name Format for File with Multiple TV Episodes

Posted: 24 Jul 2015, 07:21
by rednoah
1.
Your format does not do multi-episode formatting. Use {sxe} or {s00e00} for convenience, or do it yourself with {es} binding (assuming that filebot did recognise the multi-episode pattern in the first place).

{e} ... first episode number
{es} ... list of episode numbers

2.
Have you tried {sxe.pad(5)}? Otherwise there's lots of examples of how to use {es} here in the forums.