Don't automatically prepend 0 on season numbers.

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
cashman04
Posts: 5
Joined: 15 Oct 2014, 18:47

Don't automatically prepend 0 on season numbers.

Post by cashman04 »

Until recently, I was using filebot for movies, and TV Rename for TV shows. When I went to automate it yesterday, I found that the amc.groovy could already do that for me.. Freaking awesome. But when I downloaded a tv show today, it prepended a 0 to the Season 7(Season 07), which screws up how I have all of my current seasons numbered. How can I change it so it doesn't automatically prepend that 0?

I would assume it would be in this line in the groovy script:
tvs: tryQuietly{ seriesFormat } ?: '''TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}''',

But I don't know groovy, and this doesn't look like regex to me. Also, where is the amc.groovy script located in windows?
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Don't automatically prepend 0 on season numbers.

Post by rednoah »

1.
You don't need to modify the script for that. You can pass in your own format via --def seriesFormat.
Default Series Format wrote:TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
How to make s.pad(2) not pad to a 2-digit number? s.pad(1) (actually just s is fine at this point but lets keep edits at a minimum)

2.
fn:amc will automatically fetch the script and auto-update but you can also specify a local path to run your own customized script
Answer: Nowhere.
:idea: Please read the FAQ and How to Request Help.
cashman04
Posts: 5
Joined: 15 Oct 2014, 18:47

Re: Don't automatically prepend 0 on season numbers.

Post by cashman04 »

Any chance of an example on #1? IE, what can I change this to:

Code: Select all

filebot -script fn:amc --output "D:\Media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"

And thanks on #2. I suspected that when I couldn't find it.
User avatar
rednoah
The Source
Posts: 23947
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Don't automatically prepend 0 on season numbers.

Post by rednoah »

AMC Manual says:

Code: Select all

--def "seriesFormat=X:/TV/{n}/{'S'+s}/{fn}"
Format Expression Manual says:

Code: Select all

TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
Copy & Paste Solution:

Code: Select all

--def "seriesFormat=TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(1) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}"
:idea: Please read the FAQ and How to Request Help.
cashman04
Posts: 5
Joined: 15 Oct 2014, 18:47

Re: Don't automatically prepend 0 on season numbers.

Post by cashman04 »

Ahh. I was doing --def seriesFormat="blah". Thank you much!
Post Reply