Expressions/Rules requests (6 Viewers)

mforte

Portal Member
March 18, 2015
8
4
31
Home Country
Australia Australia
Hi All,

My father has been using Media portal for many years and has been pushing me to start using it! I myself have been fine with using media centre :)
after playing with media portal and seeing what it can do amazes me!

Now, my problem is, how do I use the string replacements and parsing expressions? The other problem is Double Episodes

My Tv Show Scheme is as follows:
Single Episodes:
Videos > Tv Series > Arrow >Season 01> Arrow - SE01-E01 - Pilot.ext
Double Episodes:
Videos > Tv Series > Arrow >Season 01> Arrow - SE01-E01-E02 - Pilot, Honnor Thy Father.ext

Thanks and Regards,
Matt

The Re posted here

https://forum.team-mediaportal.com/threads/expressions-rules-exchange.21977/page-3#post-700319

Can handle this format as long as you use S01 instead of SE01 ie:

Videos\Tv Series\Arrow\Season 01\Arrow - S01e01-e02 - Pilot, Honnor Thy Father.ext

Other wise you may have luck with this:

Code:
(?<series>[^\\$]+)(?:(?:\\(?:Season?)?[ .-]?[0-9]{1,4})?\\s?(?<season>[0-2]?[0-9])|\\(?:(?:Season?)[ .-])?(?<season>[0-9]{1,4})\\[^\\]*?)(?:se\d+[ -.]?)?[ex](?<episode>\d\d+)(?:[ .+-]e?(?<episode2>\d\d+))?(?:[ -]+(?<title>[\w -.,'!&$][^$]*?))?\.(?<ext>[^.]*)$


Hi Chubler,
Thanks for the info!
would i use the above code for the Parsing expression or String replacement?
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    @mforte, might be easier if you use ReNamer to mass rename all your files and turn "- SE" into "- S", as that is the reason the default expression isn't able to detect them.

    If you do not want to rename, then replace the 1st RegExp based default parser with:

    Code:
    ^(?:.*\\)?(?<series>[^\\]+?)[ _.\-\[]+(?:[s]?[e]?(?:eason\s?)?(?<season>\d+)[ _.\-\[\]]*[ex](?:pisode\s?)?(?<episode>\d+)|(?:\#|\-\s)(?<season>(?!(?:\d{4}.\d{2}.\d{2}|\d{2}.\d{2}.\d{4}))\d+)\.(?<episode>\d+))(?:[ _.+-]+(?:[s]?[e]?(?:eason\s?)?\k<season>[ _.\-\[\]]*[ex](?:pisode\s?)?(?<episode2>\d+)|(?:\#|\-\s)\k<season>\.(?<episode2>\d+))|(?:[ _.+-]*[ex+-]+(?:pisode\s?)?(?<episode2>\d+)))*[ _.\-\[\]]*(?<title>(?![^\\].*?(?<!the)[ .(-]sample[ .)-]).*?)\.(?<ext>[^.]*)$
     

    Idro

    Portal Pro
    February 13, 2015
    74
    17
    48
    Santa Marinella (Roma)
    Home Country
    Italy Italy
    Hi all,

    I tried to put down a filter for my TV series structure but it's too difficult for me 'cause of i'm not a developer.
    Usually I organize my TV series as follow:

    windows dir with tv series name/windows dir with season named and number (e.g. Season 1)/file name episode

    About the name episode I use to write in this way:

    <season number>X<episode number> - <episode title>-<day of aired>.<month of aired>.<year of aired>

    obviously without < and > parenthesis.
    Note that episode title is composed as: italian title (english title)

    Could you help me?
     

    Chubler

    Portal Member
    July 14, 2009
    46
    25
    Home Country
    Australia Australia
    Hi all,
    ...
    windows dir with tv series name/windows dir with season named and number (e.g. Season 1)/file name episode

    About the name episode I use to write in this way:

    <season number>X<episode number> - <episode title>-<day of aired>.<month of aired>.<year of aired>
    The Re posted here

    https://forum.team-mediaportal.com/threads/expressions-rules-exchange.21977/page-3#post-700319

    Can handle this format. All the extra info you have following title like day.month.year aired and italian (english) titles will all get loaded into the title field, but this is most likely the best place for it. When placing this expression ensure it's at the top of the expression list to avoid other existing expressions matching your format first.
     

    Idro

    Portal Pro
    February 13, 2015
    74
    17
    48
    Santa Marinella (Roma)
    Home Country
    Italy Italy
    Hello chubler,

    thanks for your support, but your script works only if I have this structure (e.g. Games of thrones):

    Games of thrones\5x01 - The wars to come-20.04.2015.mkv

    In this case I have correctly "Games of thrones" in the series coloumn.

    But if I have this structure:

    American Horror Story\Season 1\1x09 - Spooky little girl-10.01.2012.mkv

    In Series name coloumn I have Season 1 and not American horror story and the plugin does not recognize the series.

    Further I don't understand because the extra info like day.month.year aired and italian (english) titles will all get loaded into the title field, but this is most likely the best place for it.

    It could be perfect if I have coloumn as follow (considering I could have the two type of structure above):

    - Series coloumn
    - Season ID coloumn
    - Episode ID coloumn
    - Episode ID 2 coloumn
    - Episode english name coloumn
    - Episode italian name coloumn
    - Aired coloumn
    - Extension coloumn

    Last but not least: what type of language is used to parse string, java or something else?
     

    Chubler

    Portal Member
    July 14, 2009
    46
    25
    Home Country
    Australia Australia
    This file / path works fine for me here is my expression:

    RE1_zpsnzbe7ybp.png


    And here is the result:
    RE2_zpsbaya4u09.png


    Notice how the type above is "Regexp" and I disabled a number of others to avoid the wrong RE being executed (you can disable everything else except the new one as long as all your shows are in named folders like you describe).

    You can see the Series name season and episode all extracted OK and Episode title gets the show title plus your extra date info.

    I don't know what language but the RegEx strings entered are simply Regular expressions.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Simple expressions work fine as well, but Regular Expressions (RegExp) are more powerful and can handle dual-episode situations easier. There are many expressions exchanged in the other thread that should account for most users situations. Also keep in mind that you can use the string replacements to make your weird structure match what one of the expressions expects it to be; just enable the "before" option then on the string replacement entry.
     

    Nefariam

    Portal Member
    June 13, 2015
    15
    0
    Home Country
    Australia Australia
    Hi, my TV shows are categorised like this:
    Series name\Season + Year\Episode number + name

    For example:
    How I Met Your Mother\Season 1 (2005-2006)\1x04 - Return of the Shirt

    I also have some double episodes, for example:
    How I Met Your Mother\Season 1 (2011-2012)\7x23-34 - The Magician's Code, Part 1 & The Magicians Code, Part 2

    Running the parser over the folder it picks up most of the series names with "Season x (xxxx-xxxx)" Is there are parsing expression I could use here or do I need to rename the lot?
     

    bta489

    Portal Pro
    March 17, 2013
    168
    92
    Home Country
    Germany Germany
    @Nefariam
    You could try something like this as RegEx parsing expression:

    Code:
    (?<series>[^\\]+)\\[^\\]+\\(?<season>\d+)x(?<episode>\d+)(?(?=\-)\-(?<episode2>\d+))\s\-\s(?<title>.+)\.(?<ext>[^\.]*)$

    (I'm not an expert, but i took this opportunity to test my understanding of RegularExpression. Someone with a better understanding might come up with a different/better solution ;))
     

    Users who are viewing this thread

    Top Bottom