Rename multipart episodes

All about user-defined episode / movie / file name format expressions
Post Reply
kolbdog32
Posts: 20
Joined: 05 Feb 2024, 13:47

Rename multipart episodes

Post by kolbdog32 »

Hi I was just wondering is there a format i can use to rename multipart episodes without the dash in between the two episodes
The episode i want to rename is Let's Go Luna - S01E03-E04 - Lullaby for Baby Vlad & Space Is the Place
But I would like it to be like this in this format Let's Go Luna - S01E03E04 - Lullaby for Baby Vlad & Space Is the Place

Here is the current formatting I use:

Code: Select all

{n}{' - S' + s.pad(2) + episodelist.findAll{ airdate == it.airdate }.collect{'E' + it.episode.pad(2) }.join('-') + ' - ' + episodelist.findAll{ airdate == it.airdate }.collect{it.title }.join(' & ') }
If anyone has idea how to change the format so its without the dash in the middle i would be grateful. Thank you.
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename multipart episodes

Post by rednoah »

:arrow: You can use {plex} as format, or {n} - {s00e00} - {t}, etc.


:idea: If the file at hand is named "Let's Go Luna - S01E03-E04" then FileBot will already have matched the episode to a multi-episode object so all the default bindings will work as they all support multi-episode objects. Your format (Did you write this format? What is it trying to do anyway?) does not account for this use case.

Screenshot




:!: Your custom format seems to be built for the purpose of inferring the multi-episode numbers for files that are not named "Let's Go Luna - S01E03-E04" so something does not make sense. Perhaps you would like to provide more context? Please post screenshots and sample file paths as text if "Let's Go Luna - S01E03-E04" does not represent the files at hand that you are trying to deal with.
:idea: Please read the FAQ and How to Request Help.
kolbdog32
Posts: 20
Joined: 05 Feb 2024, 13:47

Re: Rename multipart episodes

Post by kolbdog32 »

rednoah wrote: 05 Feb 2024, 14:05 :arrow: You can use {plex} as format, or {n} - {s00e00} - {t}, etc.


:idea: If the file at hand is named "Let's Go Luna - S01E03-E04" then FileBot will already have matched the episode to a multi-episode object so all the default bindings will work as they all support multi-episode objects. Your format (Did you write this format? What is it trying to do anyway?) does not account for this use case.

Screenshot




:!: Your custom format seems to be built for the purpose of inferring the multi-episode numbers for files that are not named "Let's Go Luna - S01E03-E04" so something does not make sense. Perhaps you would like to provide more context? Please post screenshots and sample file paths as text if "Let's Go Luna - S01E03-E04" does not represent the files at hand that you are trying to deal with.
I dont want the dash inb etween sepearting the epsiodes I would like the file to be in this format Let's Go Luna - S01E03E04 - Lullaby for Baby Vlad & Space Is the Place. So it looks nicer without a dash separating the episode numbers
kolbdog32
Posts: 20
Joined: 05 Feb 2024, 13:47

Re: Rename multipart episodes

Post by kolbdog32 »

That episdoe is just an example
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename multipart episodes

Post by rednoah »

Match "Let's Go Luna - S01E03-E04.mkv" against TheTVDB and then use the following format:

Format: Select all

{n} - {s00e00.replace('-', '')} - {t}
That will generate the following file name:

Code: Select all

Let's Go Luna! - S01E03E04 - Lullaby for Baby Vlad & Space Is the Place



:idea: Note that S01E03-E04 refers to a sequence of episodes, not limited to 2 episodes, e.g. S01E03-E05 or S01E03-E06 in some cases. The code above (i.e. just remove the - character) would then generate S01E03E06 as opposed to S01E03E04E05E06 as one might expect from the dash-less numbering style.
:idea: Please read the FAQ and How to Request Help.
kolbdog32
Posts: 20
Joined: 05 Feb 2024, 13:47

Re: Rename multipart episodes

Post by kolbdog32 »

rednoah wrote: 05 Feb 2024, 15:18 Match "Let's Go Luna - S01E03-E04.mkv" against TheTVDB and then use the following format:

Format: Select all

{n} - {s00e00.replace('-', '')} - {t}
That will generate the following file name:

Code: Select all

Let's Go Luna! - S01E03E04 - Lullaby for Baby Vlad & Space Is the Place



:idea: Note that S01E03-E04 refers to a sequence of episodes, not limited to 2 episodes, e.g. S01E03-E05 or S01E03-E06 in some cases. The code above (i.e. just remove the - character) would then generate S01E03E06 as opposed to S01E03E04E05E06 as one might expect from the dash-less numbering style.

Thank you for the help I appreciate it.
Eye
Posts: 41
Joined: 07 Oct 2014, 21:22

Re: Rename multipart episodes

Post by Eye »

Is there a way to get that with a

"Titel (year) - 01x01-02" or
"Titel (year) - 01x01-01x02"

instead of the S01E01-E02

I do have a series Setup starting with

Format: Select all

{ny.take(40)} - {s.pad(2)+'x'}{e.pad(2)} {' Special '+special.pad(3)} { - " Part $pi"} - {t.take(40)} - [{any{group}{'NoGroup'}}] 

and would like to have it work with multipart episodes,.. ;)
i plaied a round a while but i dont get that running? ;)

best regards
Eye
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename multipart episodes

Post by rednoah »

:idea: {sxe} will give you 1x01-02 with zero effort:

Format: Select all

{ sxe }

:idea: Adding the extra leading 0 might is a little bit tricky:

Format: Select all

{ sxe =~ /^[0-9]{2}/ ? sxe : '0' + sxe }

:idea: 01x01-01x02 is of course possible as well, but that would require a lot more code, since you'd have to write the formatting code yourself (instead of just using {sxe} binding) using the {episodes} raw multi-episode information.
:idea: Please read the FAQ and How to Request Help.
themusj
Posts: 15
Joined: 29 Dec 2017, 22:43

Re: Rename multipart episodes

Post by themusj »

If you did want as you suggested something like this, Dastardly & Muttley in Their Flying Machines - S01E01-E02-E03-E04-E05 converted to Dastardly & Muttley in Their Flying Machines - S01E01E02E03E04E05, what would need to change in the syntax?:

Format: Select all

 {n} - {s00e00.replace('-', '')} - {t}
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename multipart episodes

Post by rednoah »

{s00e00} will give you S01E01-E05. You'll want to not strip the - dash because E01-E05 means from E01 to E05.

Format: Select all

{ s00e00 }

Code: Select all

S01E01-E05
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename multipart episodes

Post by rednoah »

I came across Kodi Forums › TV Show Multi Episode Naming which adds the "I'm organising files for Kodi" additional information to the context of the topic here.


:arrow: If you're using Kodi, then you'll want to use the {kodi.id} format. The {kodi.id} format generates the following file paths:

Format: Select all

{ kodi.id }

Code: Select all

TV Shows/Dastardly & Muttley in Their Flying Machines (1969) {tvdb=76263}/Season 1/Dastardly & Muttley in Their Flying Machines (1969) - 1x01x02x03x04x05 - Fur Out Furlough & Barn Dance & Hot Soup & Magnificent Muttley - Muttley on the Bounty & Sappy Birthday
:idea: Please read the FAQ and How to Request Help.
themusj
Posts: 15
Joined: 29 Dec 2017, 22:43

Re: Rename multipart episodes

Post by themusj »

I am impressed you added that to the conversation. Must admit, very tired, long week, so I cannot comprehend all that except to say Kodi reads the file format S02E01E02E03 etc. perfectly breaking down each episode within program listing. Each episode is listed individually with a description.

And to be honest, I came back to this site tonight still trying to wrap my head around renaming artwork.

With the TVDB updating tv series routinely. Filebot is great at updating the main media file and nfo file. I just cannot figure out how to use it to rename the associated XXX-poster.jpg and other artwork. It can grab new artwork, but that leaves the old (which I would rather just rename). I am not looking at any fancy moving of the files. They are all resident in separate folders.
Post Reply