Parsing invalid episode names (1 Viewer)

ultimatejoe

Portal Member
October 14, 2007
49
6
Home Country
Canada Canada
For whatever reason, SchedulesDirect is getting bad EPG data from my service provider (Beanfield in Canada) and as a result I'm getting wonky episode names; it happens for about 10% of the shows I record. That being said, the correct information is IN the filename, I just can't figure out the parsing string I need to use to get it. When I do get bad filenames they come in one of two flavours (below), and I'm hoping the tall foreheads here can help me:

I use the following format: <SeriesName> - S<SeriesNumber>E<EpisodeNumber> - <EpisodeTitle> which should produce something like: Brooklyn Nine-Nine - S05E18 - DFW

Issue one:
\Brooklyn Nine-Nine - SEP01739009E518 - DFW
The XML has a wonky series number ("EP01739009"), then includes the series number AND epside number as the episode value ("518"). Basically I need to figure out how to ignore the wonky series number, and split out the series and episode numbers from the last three digits in the text string.

Issue two:
\S05E518 - DFW
Sometimes after MCEBuddy has done it's thing it will capture the series number in the episode number. I'm assuming this is related to the bad XML issue I've described above but I can't figure out how to manage on the MCEBuddy side so I'm hoping there's a way I can set up My TvSeries to read this correctly as well.

Any help would be greatly appreciated.
 

Edalex

Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    If you want to import them in MP-TVSeries you could creare replacement strings in config. If replacement are not so simple you could use regex.
     

    ultimatejoe

    Portal Member
    October 14, 2007
    49
    6
    Home Country
    Canada Canada
    Thanks. That much I've figured, where I'm struggling is how to configure the replacement strings. Regex is a bit over my head, and the series number is unique so I can't just use a single value. I'm hoping that someone here can suggest what replacement strings or parsing strings would work.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    @ultimatejoe

    It would have been easy to create one, but no full source filename example was provided, so I cannot build a proper RegExp for it.

    Going on the hypothesis that it would be "Brooklyn Nine-Nine - SEP01739009E518 - DFW.mkv" you can use:

    Code:
    (^.*?\\?(?<series>[^\\$]+?)[ .-]+(?:SEP\d+E)?(?<season>\d+)(?<episode>\d{2}))[ .-]*(?<title>(?![^\\]*?(?<!the)[ .(-]sample[ .)-]).*?)\.(?<ext>[^.]*)$

    This will remain effective even when Brooklyn Nine-Nine moves into season 10+

    For the 2nd one, you will have to use string replacement if MCEBuddy at least puts it in the right folder, so you can expand upon that knowledge, or provide better folder+file examples of your situation.
     
    Last edited:

    ultimatejoe

    Portal Member
    October 14, 2007
    49
    6
    Home Country
    Canada Canada
    Sorry, you're absolutely right. Here's an example of a file with the weird season/episode values, from the root "series" recording folder:

    series\Bob's Burgers\Bob's Burgers - SEP01279298E801 - Go Tina on the Mountain.ts

    Here's the example where the root "TV Recordings" folder:

    TV Recordings\Brooklyn Nine-Nine\Season 05\S05E514-The Puzzle Master.mkv
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    The RegExp provided works on 1st one as:

    Series = Bob's Burgers
    Season = 8
    Episode = 01
    Title = Go Tina on the Mountain
    Extension = ts​

    For The other scenario, use:

    Code:
    (^.*?\\?(?<series>[^\\$]+?)\\Season \d+\\S\d+E(?<season>\d+)(?<episode>\d{2}))[ .-]*(?<title>(?![^\\]*?(?<!the)[ .(-]sample[ .)-]).*?)\.(?<ext>[^.]*)$
     

    ultimatejoe

    Portal Member
    October 14, 2007
    49
    6
    Home Country
    Canada Canada
    You are my hero. If you're ever in Toronto I'll buy you a beer. Both strings worked perfectly. I can finally use the plugin to manage TV before AND after I record the episodes. I've been trying to make that work since 2009.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Could have done this for you 9 years ago if you made the forum request :)
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    You are my hero. If you're ever in Toronto I'll buy you a beer. Both strings worked perfectly. I can finally use the plugin to manage TV before AND after I record the episodes. I've been trying to make that work since 2009.
    Also you could've asked SchedulesDirect to fix EPG data since you're paying for it.
     

    Users who are viewing this thread

    Top Bottom