Expressions/Rules requests (4 Viewers)

Big_Chubbz

Portal Member
April 29, 2013
21
1
50
Home Country
United States of America United States of America
I am running into some series that are being missed because of differences in episode numbering conventions. Here is an example:

American.Pickers.S06E08.720p.HDTV.x264-KILLERS

I need to come up with a string replacement expression that will recognize this as Season 2013 (instead of 6) and Episode 29 (instead of 8). If someone can be so kind as to show me the proper syntax of such an expression, I think I could "reverse engineer" it to solve my other similar problems. i.e. adding a constant to all incoming episode or series numbers of a given show.

I'm running into this problem when the adopted scene season and episode numbering convention doesn't match the one being used by TV.db (as in the above example).
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    @Big_Chubbz, The only way to solve this would be via a post-processing script used by your download solution.

    The 'Terra Nova' show had simelair issue, and I had to use the following:

    Code:
    :: Fix Terra Episode Numbering
    ::
    IF NOT EXIST "Terra*.avi" GOTO SkipTerra
    :: Find file
    ::
    FOR /F "usebackq" %%F IN ('"Terra*.avi"') DO (
    SET Terra=%%~nxF
    )
    :: Process file
    ::
    FOR /F "usebackq tokens=1,2* delims=." %%F IN ('"%Terra%"') DO (
    SET Series=%%F
    SET Episode=%%G
    SET Extension=%%H
    )
    :: Lower episode numbering by 1
    ::
    IF "%Episode:~0,1%"=="0" (
    SET /A FixEp=0x%Episode%-1
    ) ELSE (
    SET /A FixEp=%Episode%-1
    )
    :: Force double digits
    ::
    IF /I %FixEp% LSS 10 (
    SET FixEp=0%FixEp%
    echo Digits corrected!
    )
    echo Fixing Terra Nova Episode Numbering
    echo.
    ren "Terra*.avi" %Series%.%FixEp%.%Extension%
    :SkipTerra

    Reverse engineer away. (Tip: you add +2007 to year, and +21 to episode)

    PS: Another solution is to otherwise add string replacement entries for all the episodes due to air. There is no replace-with-math possible inside MP-TVSeries, so you can replace "S06E" with "S2013E", but each episode you would have to do manually anyway and include year anyway to prevent false positve, so might as well skip the year conversion then and make it part of the episode entry.
     

    Big_Chubbz

    Portal Member
    April 29, 2013
    21
    1
    50
    Home Country
    United States of America United States of America
    @RoChess, Thank you so much for your reply!

    I was hoping for a magical regex that I could put into the string replacements under the import tab that would basically look for MessedUpSeries.SxxExx.mkv and replace it with MessedUpSeries.Sxx+<constant>Exx+<constant2>.mkv, but I see that

    There is no replace-with-math possible inside MP-TVSeries

    Huge bummer for me. Unfortunately, the script you provided is way over my head, and I don't even know how to call it from uTorrent. Also, I suspect that if I renamed the files after download, uTorrent would no longer have the correct path to share the files back to the swarm.

    For now, I guess I'll keep manually matching the oddball series' and put in a feature request for "replace-with-math" with the devs.

    ...unless you have any other ideas?

    Thanks again! I appreciate the quick reply.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Huge bummer for me. Unfortunately, the script you provided is way over my head, and I don't even know how to call it from uTorrent. Also, I suspect that if I renamed the files after download, uTorrent would no longer have the correct path to share the files back to the swarm.

    It is actually quite simple:

    uTorrent preferences -> Advanced -> Run Program -> "Run this program when a torrent finishes" + "Run this program when a torrent changes state".

    You can use first to 'copy' the file from your uTorrent process folder to the MP-TVSeries import folder (also solves any lock issues on import). Once the torrent matches the quotas you have set for a successful share, then you can use the 2nd option to delete the uTorrent file that you were still seeding.

    It does require some knowledge then indeed to do all this, but you are not the first and many users are sharing what they made/use on forums/etc, so it is easy to get started. Lot of users tie uTorrent into uProcess which then goes into SickBeard, which goes into MP-TVSeries and you end up with beautiful results such as "Example Show\Season 1\Example Show - S01E01 - Episode Title.ext" all fully automatic and 100% guaranteed to import correctly.

    But that does not solve the S06E08 -> S2013E28 conversion issue that this show needs, and I personally could never be bothered to see if somebody had already invented a solution for it. That show just imports 'wrong' for me, but MP-TVSeries lists the episode anyway and keeps track of watch progress.
     

    Big_Chubbz

    Portal Member
    April 29, 2013
    21
    1
    50
    Home Country
    United States of America United States of America
    Thanks for the additional information. You've inspired me to completely overhaul my system. It kind of bugs me that I will have to have two copies of the files that I am still sharing, but I guess I can get over that.

    One final (off topic) question:

    Now that I will be setting up uTorrent to copy (and rename if necessary as in the example above) my files when a download is complete, I will want to delete those files as soon as I'm done watching them. I'm familiar with the "allow user to delete from context menu" option, but are you aware of a hack, plugin, or workaround that would do something along the lines of popping up a dialog at EOF (like a real DVR) that says, "Delete Y/N"? Or perhaps something that moves anything with a watched tag to a place of the users choosing?

    I see that you are all over this forum helping a lot of people. It is very much appreciated!!
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    @Big_Chubbz, you are welcome, and indeed if you wish to keep seeding then you should not yet import. So the only way to correctly circumvein that is to end up with two copies until seeding is done. Once seeding is done you can have uTorrent auto delete the original one, and you keep the copy. If you are however in need for storage, especially caused from all those 'copies', then you can indeed switch to a watch+delete system.

    I do the same on majority of shows, and it caused me to create the suggestion/ticket a long time ago almost identical to the idea you had as well: http://code.google.com/p/mptvseries/issues/detail?id=449

    You can 'star' the issue to show developers I am not the only one interested, as well as keeping informed that way on its progress, but with many thousands of users of MP-TVSeries, having '3' ppl star this one does not bode well on any urgency for them to implement. So for the time being and the near future you have to apply workarounds. One of them (which is what I use) is to indeed enable the option to allow delete from GUI, and then the moment after I am done watching an episode I hit '0' -> '1' on my remote and episode is deleted.

    This then allows me to not just clean up storage, but also keeps perfect track of unwatched series/seasons/episodes as they are still on disk and shown inside MP-TVSeries. If I am all up-to-date on a continuing series it is not shown until a new file is added, indicating a new episode aired. If however due to issues (such as lack of storage) a new episode was not correctly added and due to other factors I would not realize this until 2 weeks later, I would sometimes skip a week by mistake and not realize it until well into the episode or worse, afterwards.

    For this I was able to convince the developer to add a different option (which was much easier to develop/add for them) that allows you to keep track of playback progress (General tab of config as well). What this does is ensure you have a database entry of watched status on the previous episode. So if you watched 1x01 and then deleted the file from disk (not from database), the watched 1x01 status is kept. If you then add 1x03 and try to watch it, you will get error saying "you did not yet watch 1x02, do you wish to continue". This only works if episode 1 or higher watched entry existst inside database, so if you start off the season with 1x04 you will not get an error.

    Still it is an aweome combination of work-arounds that make MP-TVSeries very versatile. The MediaPortal plugin "DriveFreeSpace" rounds it off for me, by allowing me a quick visual overview inside MediaPortal on how much free space I still got across my storage volumes.
     

    Big_Chubbz

    Portal Member
    April 29, 2013
    21
    1
    50
    Home Country
    United States of America United States of America
    I'm up late reconfiguring my setup. Is there a way to get uProcess to only process torrents of a certain label? I don't want it messing with my movies. Also, is there a forum for uProcess? I can't find any place on github to ask for help. Googling uProcess tutorial just brings up differently formatted versions of the readme. I'm sorry this is getting waaaay off topic of expression requests.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    No idea to help you there, I don't use it myself, but would figure there are indeed instructions you can google for, or find forum/wiki/faq somewhere.
     

    Users who are viewing this thread

    Top Bottom