Name Format for File with Multiple TV Episodes

All about user-defined episode / movie / file name format expressions
Post Reply
mhe4
Posts: 3
Joined: 24 May 2015, 22:00

Name Format for File with Multiple TV Episodes

Post 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 ã¾(ï¼ âã¼âï¼ )ã
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Name Format for File with Multiple TV Episodes

Post 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('-')}
:idea: Please read the FAQ and How to Request Help.
mhe4
Posts: 3
Joined: 24 May 2015, 22:00

Re: Name Format for File with Multiple TV Episodes

Post 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')
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Name Format for File with Multiple TV Episodes

Post by rednoah »

Use tripple quotes to quote your '''string''' so you don't have to worry about escaping the single quotes in the format.
:idea: Please read the FAQ and How to Request Help.
mhe4
Posts: 3
Joined: 24 May 2015, 22:00

Re: Name Format for File with Multiple TV Episodes

Post 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.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Name Format for File with Multiple TV Episodes

Post by rednoah »

Code: Select all

"S01-E01-E02--test--test".removeAll("-")
:idea: Please read the FAQ and How to Request Help.
Eye
Posts: 37
Joined: 07 Oct 2014, 21:22

Re: Name Format for File with Multiple TV Episodes

Post 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?
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Name Format for File with Multiple TV Episodes

Post 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply