TV shows scheme: mediainfo on season folder if all the same, on files if different?

All about user-defined episode / movie / file name format expressions
Post Reply
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by AbedlaPaille »

Say i have a season pack with same vs and vf, i'd want it to look like
Devs/Season 1 [Bluray 1080p]/Devs - S01E01 - Episode 1
But if the episodes within the season have differing vs and vf then
Devs/Season 1/Devs - S01E01 - Episode 1 [Bluray 1080p]
Is that something filebot can do?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by rednoah »

The first step would be to know what you want. What {vs} {vf} values do you want in the folder path if there's more than one? Keep the first? Keep the last? Keep the best? How do define best? Keep all unique values? In which order? What if new files with previously unseen values are added to the mix some time down the line?


The {model} binding can help:
viewtopic.php?t=9814

e.g.

Code: Select all

{n} {model.vc.sort().unique()}/{plex.name}
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by AbedlaPaille »

What {vs} {vf} values do you want in the folder path if there's more than one?
None, let me try again.

Situation 1: Episodes values within a season do not match
Result 1: my scheme remains -- Extra info trail on episode files, none on season folder.
Example 1: Devs/Season 1/Devs - S01E01 - Episode 1 [Bluray 1080p]

Hopes with the model binding:

Situation 2: Episodes values within a season do match
Result 2: my scheme changes -- Extra info trail on season folder, none on episode files.
Example 2: Devs/Season 1 [Bluray 1080p]/Devs - S01E01 - Episode 1

Less clutter, just as much information.

Code: Select all

{n} {model.vc.sort().unique()}/{plex.name}
It writes all the video codecs in the processed batch even if they're from other seasons/shows, so do i have to batch process season per season or can it be narrowed down with code?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by rednoah »

1.
Doable. You have the list of values, so you just need to do different things based on the number of unique values.

e.g.

Code: Select all

model.vc.unique().size() == 1 ? vc : null

2.
Doable. But a simple format comes at the expense of not accounting for multi-series/season model data. You have the {model} so you can select (based on arbitrary criteria) the relevant items for the current object at hand.

e.g.

Code: Select all

model.findAll{ id == it.id }.vc
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by AbedlaPaille »

I managed to piece together something semi-functional. You're a good teacher :)

Code: Select all

{model.findAll{ id == it.id }.collect{ [it.vf, it.vc] }.unique().size() == 1 ? {allOf{vf}{vc}.joining(' ', ' [', ']')} : null}
1. Only big issue is i'm not finding how to select a serie's season instead of the whole show, best guess was

Code: Select all

{model.findAll{ id == it.id && it.s}
But it's wrong :roll:

2. If you can give more examples, how would i do something similar based on {fn.match()}?

e.g. If all season files match "VOSTFR" (French subs), write VOSTFR in folder name.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by rednoah »

1.
e.g. collect by series id:

Code: Select all

model.findAll{ id == it.id }
e.g. collect by series id and season number:

Code: Select all

model.findAll{ id == it.id && s == it.s }

2.
e.g. collect by series id and season number and then match fn for each item:

Code: Select all

model.findAll{ id == it.id && s == it.s }.every{ it.fn =~ /VOSTFR/ } ? "VOSTFR" : null
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by AbedlaPaille »

:mrgreen: Thank you.

Code: Select all

s == it.s
Kicking myself for not doing this on my own. And the filename match works, glorious.

Do you have something set-up for donations? When a dev helps you on ~100 posts he gets a couple free beers at the very least :D
Last edited by AbedlaPaille on 26 Jun 2020, 09:10, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by rednoah »

I'll exchange that for some FileBot advertisement and evangelism please. ;)
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: TV shows scheme: mediainfo on season folder if all the same, on files if different?

Post by AbedlaPaille »

For sure. I've been a Filebot evangelist since ~2012, even got a friend who bought it ;)
And i had no idea how helpful you were til this year. I'm close to be walking the streets with a Filebot cardboard now.

Tell me if you ever do get something set-up for donations though.
The kind of help you're willing to provide here should be rewarded, especially in extreme cases like me : close to IT illiterate but very curious.
You have insane patience and i can't thank you enough for it.
Post Reply