Expressions/Rules requests | Page 81

Discussion in 'My TVSeries' started by Inker, April 12, 2007.

  1. mforte

    mforte Portal Member

    Joined:
    March 18, 2015
    Messages:
    8
    Likes Received:
    4
    Gender:
    Male
    Ratings:
    +4 / 0
    Home Country:
    Australia Australia

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

     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,182
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    @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 (Text):
    1. ^(?:.*\\)?(?<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>[^.]*)$
     
  4. mforte

    mforte Portal Member

    Joined:
    March 18, 2015
    Messages:
    8
    Likes Received:
    4
    Gender:
    Male
    Ratings:
    +4 / 0
    Home Country:
    Australia Australia
    @RoChess,
    code you provided me worked a treat :)
    @Chubler,
    thank you for your code also :)
     
  5. Idro

    Idro Portal Pro

    Joined:
    February 13, 2015
    Messages:
    57
    Likes Received:
    4
    Gender:
    Male
    Ratings:
    +5 / 0
    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?
     
  6. Chubler

    Chubler Portal Member

    Joined:
    July 14, 2009
    Messages:
    43
    Likes Received:
    12
    Gender:
    Male
    Ratings:
    +13 / 0
    Home Country:
    Australia Australia
    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.
     
  7. Idro

    Idro Portal Pro

    Joined:
    February 13, 2015
    Messages:
    57
    Likes Received:
    4
    Gender:
    Male
    Ratings:
    +5 / 0
    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?
     
  8. Chubler

    Chubler Portal Member

    Joined:
    July 14, 2009
    Messages:
    43
    Likes Received:
    12
    Gender:
    Male
    Ratings:
    +13 / 0
    Home Country:
    Australia Australia
    This file / path works fine for me here is my expression:

    [​IMG]

    And here is the result:
    [​IMG]

    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.
     
  9. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,182
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    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.
     
  10. Nefariam

    Nefariam Portal Member

    Joined:
    June 13, 2015
    Messages:
    12
    Likes Received:
    0
    Ratings:
    +0 / 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?
     
  11. bta489

    bta489 Portal Pro

    Joined:
    March 17, 2013
    Messages:
    112
    Likes Received:
    24
    Gender:
    Male
    Ratings:
    +49 / 0
    Home Country:
    Germany Germany
    Show System Specs
    @Nefariam
    You could try something like this as RegEx parsing expression:

    Code (Text):
    1. (?<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 ;))
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!