Conditional use of dash and putting specials in "Season 0"

Any questions? Need some help?
Post Reply
Fiddlel
Posts: 4
Joined: 05 Nov 2019, 23:12

Conditional use of dash and putting specials in "Season 0"

Post by Fiddlel » 05 Nov 2019, 23:23

Code: Select all

{n.replace('.','').replace(':',' -').replace('?','')}/{'Season '+s}/{n.replace('.','').replace(':',' -').replace('?','')} - {absolute} - {s00e00}
This is what my renaming scheme currently looks like (you can probably do this way more efficiently but it just works for the moment). If you break it down so that only the important bits are visible, it looks like this

Code: Select all

{n}/{'Season '+s}/{n} - {absolute} - {s00e00}
Is there any way for me to make the dash after "{absolute} appear only if "{absolute}" returns a valid value? Currently, I am getting something that looks like Firefly/Season 1/Firefly - - S01E01 if I am renaming something and tvdb doesn't give me a value for {absolute}. I want it to look like Firefly/Season 1/Firefly - S01E01 when that happens.

Second, when I am renaming specials, those never end up in the "Season 0" folder even though there a "S00EXX" appears at the end. Is there any way to put specials in the "Season 0" folder even if tvdb lists it as e.g.

Code: Select all

Firefly - 2xSpecial7 - Serenity
which makes that special go into "Season 2"?

User avatar
rednoah
The Source
Posts: 16782
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional use of dash and putting specials in "Season 0"

Post by rednoah » 06 Nov 2019, 00:03

1.
This will do:

Code: Select all

{" - "+absolute}
:idea: viewtopic.php?f=5&t=1895


2.
Specials are Specials, not necessarily Season 0 episodes, but you can just of course encode them as such:

Code: Select all

{regular ? 'Season '+s : 'Season 0'}

3.
Here's what I get in Episodes panel:

Code: Select all

Firefly - Special 1 - Serenity
:?: What version of FileBot are you using?
:idea: Please read the FAQ and How to Request Help.

Fiddlel
Posts: 4
Joined: 05 Nov 2019, 23:12

Re: Conditional use of dash and putting specials in "Season 0"

Post by Fiddlel » 06 Nov 2019, 00:13

Thanks for your help! What is the difference between Specials and Season 0? I just want them to be in a Season 0 folder because Plex apparently can't handle specials which are in seasons.

I am currently using v4.7.9 and it looks like this for me.
Last edited by Fiddlel on 06 Nov 2019, 00:29, edited 2 times in total.

User avatar
rednoah
The Source
Posts: 16782
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional use of dash and putting specials in "Season 0"

Post by rednoah » 06 Nov 2019, 00:18

The {plex} binding will take care of the details so you don't have to worry about it:

Code: Select all

{plex}
viewtopic.php?t=4116
:idea: Please read the FAQ and How to Request Help.

Fiddlel
Posts: 4
Joined: 05 Nov 2019, 23:12

Re: Conditional use of dash and putting specials in "Season 0"

Post by Fiddlel » 06 Nov 2019, 00:28

I had used the {plex} binding but I had three problems with it.

1) I have multiple libraries and only one of them uses TV shows as the root folder. I didn't manage to change the root folder of the {plex} binding.
2) I don't want titles in my filename.
3) I want absolute numbering in my filenames because I have a lot of anime as well.

Just using the above naming scheme and placing the folder of the episodes I wanted to rename in the desired root folder was more straightforward but probably inefficient.

User avatar
rednoah
The Source
Posts: 16782
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional use of dash and putting specials in "Season 0"

Post by rednoah » 06 Nov 2019, 05:46

1.
You can do:

Code: Select all

/path/to/My Series Folder Name/{plex.tail}
:idea: viewtopic.php?t=4116


2. & 3.
Probably fine. Your choice. But definitely not what naming and organizing your media files prescribes.


4.
I'd start with this, more or less the same as what {plex} does, and then you modify things to your liking:

Code: Select all

TV Shows/{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
:idea: viewtopic.php?t=4116
:idea: Please read the FAQ and How to Request Help.

Fiddlel
Posts: 4
Joined: 05 Nov 2019, 23:12

Re: Conditional use of dash and putting specials in "Season 0"

Post by Fiddlel » 06 Nov 2019, 16:39

Thanks for your great help so far!
I have one more question: When I have files with multiple episodes which are named like

Code: Select all

Detective Conan - S05E18-E19
and rename them again by using FileBot, the {absolute} binding only returns the value of the first episode. It looks like

Code: Select all

Detective Conan - 124 - S05E18-E19
instead of

Code: Select all

Detective Conan - 124-125 - S05E18-E19
.
Is this a problem I somehow can fix?

User avatar
rednoah
The Source
Posts: 16782
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional use of dash and putting specials in "Season 0"

Post by rednoah » 06 Nov 2019, 17:06

{plex} and {s00e00} are aware of multi-episode objects and change their behavior accordingly, but multi-episode aware custom formats are slightly more tricky.

The {episodes} binding gives you the multi-episode object as list of episodes, so you can do this:

Code: Select all

{episodes.absolute.join('-')}

Code: Select all

1-2-3
or this:

Code: Select all

{episodes.absolute.min() + '-' + episodes.absolute.max()}

Code: Select all

1-3
:idea: Please read the FAQ and How to Request Help.

Post Reply