Season 00 with s.pad(2) error

Support for Windows users
Post Reply
alanamoss
Posts: 2
Joined: 13 Oct 2024, 08:01

Season 00 with s.pad(2) error

Post by alanamoss »

I am using the following to rename TV shows:

Format: Select all

{ny} {[vf, vc, ac]}/Season {s.pad 2}/{plex[3]}
It works great unless the episodes are from Season 00.
For example, I get:

Code: Select all

South Park (1997) [1080p, x265, EAC3]/Season/South Park - S00E45 - South Park The Streaming Wars
instead of:

Code: Select all

South Park (1997) [1080p, x265, EAC3]/Season 00/South Park - S00E45 - South Park The Streaming Wars
Any advice? Thank you.
User avatar
rednoah
The Source
Posts: 23729
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Season 00 with s.pad(2) error

Post by rednoah »

Special Episodes do not have a season number, {s} is therefore undefined. How to best represent undefined season numbers is up to your custom code. Binding such as {s00e00} or {plex} use S00 for specials.


e.g. How do I deal with undefined bindings?

Format: Select all

{ any{ 'Season ' + s.pad(2) }{ 'Specials' } }
or

Format: Select all

Season { any{s}{0}.pad(2) }

e.g. {plex} format

Format: Select all

{ ~plex.year.id * { " [$vf, $vc, $ac]" } }

Code: Select all

Alias (2001) {tmdb-2046} [480p, x264, AC3]/Season 01/Alias (2001) - S01E01 - Truth Be Told
⋮
Alias (2001) {tmdb-2046} [480p, x264, AC3]/Specials/Alias (2001) - S00E01 - The Legend of Rambaldi
:idea: Please read the FAQ and How to Request Help.
alanamoss
Posts: 2
Joined: 13 Oct 2024, 08:01

Re: Season 00 with s.pad(2) error

Post by alanamoss »

Using

Code: Select all

Season { any{s}{0}.pad(2) }
worked great! Thanks!
User avatar
rednoah
The Source
Posts: 23729
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Season 00 with s.pad(2) error

Post by rednoah »

:arrow: I forgot that we added the {s00} binding as well a few years ago, which takes care of replace(null, 0) and pad(2) implicitly:

Format: Select all

{ s00 }
:idea: Please read the FAQ and How to Request Help.
Post Reply