Expressions/Rules requests (13 Viewers)

lognuts

New Member
March 26, 2011
2
0
I'm looking for some help on trying to get an expression for a string replacement that will cut out all information in brackets (and the brackets themselves) for all files. I've tried and failed :(

Here is an example of the file i'm trying to parse: [K-F]_One_Piece_103_[A218545F]
what i'm hoping to get out of this is to remove both the K-F and the code on the other end.

any help is very much appreciated.
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    I'm looking for some help on trying to get an expression for a string replacement that will cut out all information in brackets (and the brackets themselves) for all files. I've tried and failed :(

    Here is an example of the file i'm trying to parse: [K-F]_One_Piece_103_[A218545F]
    what i'm hoping to get out of this is to remove both the K-F and the code on the other end.

    any help is very much appreciated.

    (?:\[[^]]+\][_]*)(?<series>.+?)[_]*(?<season>\d{1})(?<episode>\d+)(?:[_]*\[[^]]+\])
     

    Tazzios

    Portal Pro
    November 7, 2006
    57
    4
    Home Country
    Netherlands Netherlands
    Hello

    I use SABnzbd to automatically download and unpack my TV-series.
    Lately I have discovered a rather annoying issue with My TVSeries and SABnzbd:

    When SABnzbd has finished the download it creates a folder that starts with _UNPACK_ and after that the name of the file thats been downloaded. for example: "F:\TV\My Name Is Earl S04\_UNPACK_My Name Is Earl - 4x13 - Orphan Earl"
    SABnzbd unpacks in this temporary directory and then move the files to the root folder, in this case "F:\TV\My Name Is Earl S04" and after that the folder starting with _UNPACK_ is deleted.
    My problem is that when SABnzbd is unpacking the files, My TVSeries is parsing the file thats being unpacked, and when the fully unpacked file is moved to the root folder its being parsed again. And the result is that I have the same file parsed twice with two different paths. So when I look in My TVSeries in MP I can se two "13: Orphan Earl", one thats correct with the right filesize and one thats not working that has 0kb in size.

    Example:

    File 1: "F:\TV\My Name Is Earl S04\_UNPACK_My Name Is Earl - 4x13 - Orphan Earl\My Name is Earl S04E13.avi" 0kb in size and not working, shows as "13: Orphan Earl" in MediaPortal.
    File 2: "F:\TV\My Name Is Earl S04\My Name is Earl S04E13.avi"179mb in size and fully working, shows as "13: Orphan Earl" in MediaPortal.


    So my question is: Is there any RegEx that can make My TVSeries to ignore all folders with UNPACK in its name so the temp files not get parsed.
    Or does anyone have any other sollution ?


    Thanks!

    Is there a solution for this? I have the same problem.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Is there a solution for this? I have the same problem.

    Yes, do NOT download, unpack, rename or anything else inside the import folder. Use a temporary folder on a different drive, or use a folder structure that allows you to be outside of the import folder.

    Example: Import folder = "<drive>:\TV Shows"

    Download, unpack, rename in "<drive>:\Download" and you are fine. The final and only action you should do is to 'move' the file into the final destination. With SABnzbd+ you do this via the post-processing commands. There are many example batch scripts on how to do this available on the SAB forum.
     

    Kapt

    New Member
    August 12, 2011
    4
    0
    104
    Hi is there anything i can do to just make 1 episode show up one time, when using rar files it will show up once for every rar exempel part01.rar, part02.rar..... will show it 2 times or .r00 .r01...


    im using autounpack atm works good but i cant continue seeding the torrent or i have to save the extra rar files and probebly forget to remove them and it will take alot of extra space
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Hi is there anything i can do to just make 1 episode show up one time, when using rar files it will show up once for every rar exempel part01.rar, part02.rar..... will show it 2 times or .r00 .r01...


    im using autounpack atm works good but i cant continue seeding the torrent or i have to save the extra rar files and probebly forget to remove them and it will take alot of extra space

    I opened the Expression exchange thread, did a search thread and typed in "RAR". The result was a single post, being:

    https://forum.team-mediaportal.com/399630-post15.html

    Which should contain your answer.

    You can even use the RegularExpression code that they created for the extension into one of the existing default expressions for a more robuster detection, on the default filename expression that would result in:

    Code:
    ^(?:.*\\)?(?<series>[^\\]+?)[ _.\-\[]+(?:[s]?(?<season>\d+)[ _.\-\[\]]*[ex](?<episode>\d+)|(?:\#|\-\s)(?<season>\d+)\.(?<episode>\d+))(?:[ _.+-]+(?:[s]?\k<season>[ _.\-\[\]]*[ex](?<episode2>\d+)|(?:\#|\-\s)\k<season>\.(?<episode2>\d+))|(?:[ _.+-]*[ex+-]+(?<episode2>\d+)))*[ _.\-\[\]]*(?<title>(?![^\\].*?(?<!the)[ .(-]sample[ .)-]).*?)\.(?:(?<!part\d\d\d|part\d\d)\.rar|\.part0*1\.rar)$
     

    RobNCD

    Portal Member
    June 27, 2011
    14
    2
    Is there someone that could help me with a RegEx for my file structure?


    Combat Hospital (Reason to Believe - 10)_ABCE_2011-08-23_21-00.ts


    Thanks in advance...
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Is there someone that could help me with a RegEx for my file structure?


    Combat Hospital (Reason to Believe - 10)_ABCE_2011-08-23_21-00.ts


    Thanks in advance...

    The new airdate system might be able to help you on that, however it looks like you are getting these filenames from EPG data on recording TV, and I know there are some 3rd party solutions to fix those filenames into a more MP-TVSeries friendlier format including season and episode information.

    Try: mp-schedulesdirect - SchedulesDirect Plugin for MediaPortal - Google Project Hosting

    There is also: https://forum.team-mediaportal.com/...pisodenumbers-your-mediaportal-4tr-epg-76220/

    Those were just 2 results that came up when I did a forum search, so try that first.
     

    FireAza

    Portal Pro
    June 30, 2011
    50
    10
    38
    I'm having issues a TV series that came from a DVD. Since it's from a three volume DVD, My TV seems to be having issues because there's no season number in the file name. They're named like this:
    <SERIES NAME> - <EPISODE NUMBER> - <EPISODE NAME>
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    I'm having issues a TV series that came from a DVD. Since it's from a three volume DVD, My TV seems to be having issues because there's no season number in the file name. They're named like this:
    <SERIES NAME> - <EPISODE NUMBER> - <EPISODE NAME>

    Your easiest solution is to add a string replacement to be processed before parsing begins that will add S01 is such a way that it can be parsed. You did not provide an example of the filename, so I can therefore not help you on the string replacement you need, but I'm sure you can figure it out.
     

    Users who are viewing this thread

    Top Bottom