check if the last episode of the season is present

Support for Windows users
Post Reply
cyberdoggy
Posts: 45
Joined: 03 Sep 2016, 21:27

check if the last episode of the season is present

Post by cyberdoggy »

When I am renaming episodes I want it to check if the last episode of the season is present if it is then I would like it and everything before it moved to a [Complete Seasons] Folder if not then I would like it placed in a [Current Season] Folder. I am using the format box Editor in the Windows version and here is an example Of what both should look like:

Code: Select all

J:\TV Series\[Current Season]\2 Broke Girls [2011]\[2011, 2012] - Season 01 [WEB-DL]\2.Broke.Girls.S01E01.Pilot.[2011.09.19].1080p.WEB-DL.x265.AC3

Code: Select all

J:\TV Series\[Complete Seasons]\2 Broke Girls [2011]\[2011, 2012] - Season 01 [WEB-DL]\2.Broke.Girls.S01E24.And.Martha.Stewart.Have.A.Ball.(2).[2012.05.07].1080p.WEB-DL.x265.AC3
User avatar
rednoah
The Source
Posts: 23924
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: check if the last episode of the season is present

Post by rednoah »

e.g.
rednoah wrote: 22 Feb 2019, 06:18 Mark season folder complete if all known episodes of a given season are being processed in the current batch:

Format: Select all

{ n }/Season { s00 }{ model.episode.containsAll(episodelist.findAll{ it.e && it.s == s }.episode) ? ' [complete]' : ' [incomplete]' }/{ plex.name }
:arrow: Holistic formats with the {model} binding
:idea: Please read the FAQ and How to Request Help.
cyberdoggy
Posts: 45
Joined: 03 Sep 2016, 21:27

Re: check if the last episode of the season is present

Post by cyberdoggy »

Thank You as always rednoah, I made it work beautifully. :)
User avatar
rednoah
The Source
Posts: 23924
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: check if the last episode of the season is present

Post by rednoah »

cyberdoggy wrote: 27 Dec 2024, 20:43 Thank You as always rednoah, I made it work beautifully. :)
Feel free to paste the format you came up with in the end for the next guy and future self. ;)
:idea: Please read the FAQ and How to Request Help.
cyberdoggy
Posts: 45
Joined: 03 Sep 2016, 21:27

Re: check if the last episode of the season is present

Post by cyberdoggy »

This is the Episode format I have developed it may not be perfect for some but it is working for me right now.

Format: Select all

J:/TV Series/{ model.episode.containsAll(episodelist.findAll{ it.e && it.s == s }.episode) ? '[complete Seasons]' : '[incomplete Season]' }/{csv('C:/FileBot Settings/TV/TVGenreFolderBasedOnSeriesName.csv').get(n) ?: genre + '/'}{norm = {it.upperInitial().lowerTrail().replaceAll(/[`´''ʻ""""]/, "'").replaceAll(/.web./, 'web-dl').replaceAll(/[:|]/, ' - ').replaceAll(/[?]/, '!').replaceAll(/[*\s]+/, ' ').replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, {it.lower()})}; norm(n).replaceFirst(/^(?i)(The|A|An)\s(.+)/, '$2, $1').replaceTrailingBrackets()}{' ' + n.match(/\([A-Z]+\)$/)}{norm(n) != norm(primaryTitle) ? ' ('+norm(primaryTitle)+')' : ''}{y ? ' ['+y +']' : ''}/{sy}{episode.special ? '[Specials]' : ' - Season '+s.pad(2)}{' (' + file.path.matchAll(/remastered|unrated|uncut|unedited|unsold.pilot|broadcast.version|alternate.ending|with.original.commercials|reconstructed|with.commercials|unaired.pilot|unaired.episode/).unique()*.upperInitial()*.lowerTrail().sort().join(') (').replaceAll(/ [._]/, ' ') +') '}{episode.special ? '' : {def detectedSource = source ? source.upperInitial() : (fn.match(/(?i)(HDTV|WEB[-]?DL|WEBRip|BluRay|DVDRip|BDRip)/)?.upperInitial() ?: 'Unknown'); ' [' + detectedSource + ']'}}{info.network ? ' [' + info.network + ']' : ''} /{n.replaceAll(/\s*\(\d{4}\)/, '')}.{s00e00}{def t = t.upperInitial().space('.').replaceAll(/[,]+/); t ? '.' + t : ''}{airdate ? '.[' + airdate.format('yyyy.MM.dd') + ']' : ''}{vf ? '.' + vf : ''}{source ? '.' + source : ''}{vc ? '.' + vc : ''}{ac ? '.' + ac : ''}{group ? '-' + group : ''}
Output:

Code: Select all

J:\TV Series\[Complete Seasons]\Friends [1994]\[1994, 1995] - Season 01 [NF.WEB-DL] [NBC]\Friends.S01E01.The.One.Where.Monica.Gets.A.Roommate.[1994.09.22].1080p.NF.WEB-DL.x264.EAC3
Post Reply