How to customize format? 01x01 vs 1x01
How to customize format? 01x01 vs 1x01
Hello, How can I customize the format output to add the zero before the season number?
For example, I'd like season 01 episode 01 to be named. TV Show name - 01x01 - Episode name
not 1x11
I tried to look over the wiki but I'm not quite following.
http://filebot.sourceforge.net/naming.html
FileBot rocks so far, love it by the way.
For example, I'd like season 01 episode 01 to be named. TV Show name - 01x01 - Episode name
not 1x11
I tried to look over the wiki but I'm not quite following.
http://filebot.sourceforge.net/naming.html
FileBot rocks so far, love it by the way.
Re: How to customize format? 01x01 vs 1x01
Check the examples again. I format episode number to two-digit all the time.
Like this:
Note: This expression doesn't work for multi-episodes, but shows the point.
Like this:
Code: Select all
{s.pad(2)+'x'}{e.pad(2)}
Re: How to customize format? 01x01 vs 1x01
Thanks, so the full line I need is: {n} - {s.pad(2)+'x'}{e.pad(2)}- {t}rednoah wrote:Check the examples again. I format episode number to two-digit all the time.
Like this:
{s.pad(2)+'x'}{e.pad(2)}
I think the confusion is because the default syntax used is not shown to me. When you bring up Episode Format, the line is empty/blank so I had no example to go off of. (you're left starting from scratch)

Your partial example was enough to figure out the rest thanks.
I'll be sure to manually rename the multi-episodes that are combined into one giant file.rednoah wrote:Note: This expression doesn't work for multi-episodes, but shows the point.
Re: How to customize format? 01x01 vs 1x01
Oh... also, will the extra zero pad only be applied to single digits I hope? 1 will be 01 but 11 won't be 011 right?
Re: How to customize format? 01x01 vs 1x01
Yep, .pad(n) pads to a n-digit string.
You can handle multi episodes via {episodes} binding. E.g.
You can handle multi episodes via {episodes} binding. E.g.
Code: Select all
{s.pad(2)+'x'}{episodes*.episode*.pad(2).join("-")}
Re: How to customize format? 01x01 vs 1x01
I'd like season 01 episode 01 to be named. TV Show name - 01x01 - Episode name
not 1x11
You can easily check out our best quality 200-101 exam - braindumps exam dumps prepare you well
not 1x11
You can easily check out our best quality 200-101 exam - braindumps exam dumps prepare you well
Last edited by redgee34 on 17 Dec 2014, 10:38, edited 1 time in total.
Re: How to customize format? 01x01 vs 1x01
redgee34 wrote:I'd like season 01 episode 01 to be named. TV Show name - 01x01 - Episode name
not 1x11
Code: Select all
{n} - {s.pad(2)+'x'}{e.pad(2)} - {t}
Code: Select all
{n} - {s.pad(2)+'x'}{episodes*.episode*.pad(2).join("-")} - {t}
Re: How to customize format? 01x01 vs 1x01
Because you're trying to access a variable called Season, which doesn't exist, so the {expression} fails.
e.g.
I recommend using {sxe} or {s00e00} instead. If you have triple episodes, Plex will want 1x01-03 and won't understand 1x01-02-03 so you might want to do this:
e.g.
Code: Select all
{n}/{'Season '+s}/{n} - {s.pad(2)}x{es*.pad(2).join('-')} - {t}
Code: Select all
{n}/{'Season '+s}/{n} - {sxe.split('x')*.pad(2).join('x')} - {t}
Re: How to customize format? 01x01 vs 1x01
You probably just messed up the argument passing. Use an @file instead:
viewtopic.php?f=3&t=3244
viewtopic.php?f=3&t=3244
Re: How to customize format? 01x01 vs 1x01
I'm using GUI via OSX (all latest).
I'd like {mbps} to appear with two digits on the left side of the decimal point.
e.g. "/EpisodeTitle [06.2 mbps].mkv"
I've tried the following:
All of which produce "6.2 mbps" (rather than "06.2 mbps").
Is {string.pad()} uniquely incapable of defining format for {mbps}?
Thank you.
I'd like {mbps} to appear with two digits on the left side of the decimal point.
e.g. "/EpisodeTitle [06.2 mbps].mkv"
I've tried the following:
Code: Select all
{'/' + t}{' ' + mbps.pad(3)}
Code: Select all
{'/' + t}{' ' + mbps.pad(4)}
Code: Select all
{'/' + t}{' ' + mbps.pad 2}
Is {string.pad()} uniquely incapable of defining format for {mbps}?
Thank you.
Re: How to customize format? 01x01 vs 1x01
Code: Select all
{media.OverallBitRate.toBigDecimal().div(1000000).round(1).pad(4) + ' Mbps'}
Code: Select all
{'6.2'.toBigDecimal().pad(4) + ' Mbps'}
Code: Select all
{mbps.pad(9)}
Re: How to customize format? 01x01 vs 1x01
Oh, ok — string.pad() applies to the total number of characters, not just numbers.
Your solutions each worked 100% for me. I think I even understand why.
Thank, Kim.
Your solutions each worked 100% for me. I think I even understand why.
Thank, Kim.
Re: How to customize format? 01x01 vs 1x01
Yes, {mbps} will give you a pre-formatted String value, not a numeric value.
Alternatively, {bitrate} will give you the numeric value in bps that you can then round and format yourself to your preferences.
Alternatively, {bitrate} will give you the numeric value in bps that you can then round and format yourself to your preferences.
Re: How to customize format? 01x01 vs 1x01
bonus info
Code: Select all
{ String a = '6.2'; a.padLeft(4,'0') + ' *** ' + a.padRight(4,'0') + ' *** ' + a.center(5, '0') }
06.2 *** 6.20 *** 06.20
Re: How to customize format? 01x01 vs 1x01
Oh! Even String.format() padding counts based on the String length:
Code: Select all
{String.format('%05.1f', bitrate / 1e6)}
Code: Select all
045.1
Re: How to customize format? 01x01 vs 1x01
Belated thank-you for this addt'l info re. {mbps} parameters. Looking forward to trying it out.
Although I'm more of an 'abstract' thinker (artist) I really appreciate the precision and "absoluteness" of the coding, expressions, etc. And, in that light, I sincerely appreciate your willingness to consider my questions, which haven't always complied with (clearly stated) requested formatting for posts. I'm increasingly able to answer my own questions without posting, because of the input and advice you (@rednoah and @kim) have provided.
<tl;dr> *cheers*
Although I'm more of an 'abstract' thinker (artist) I really appreciate the precision and "absoluteness" of the coding, expressions, etc. And, in that light, I sincerely appreciate your willingness to consider my questions, which haven't always complied with (clearly stated) requested formatting for posts. I'm increasingly able to answer my own questions without posting, because of the input and advice you (@rednoah and @kim) have provided.
<tl;dr> *cheers*