Handling dated shows - my sort-of solution

Discussion in 'My TVSeries' started by josefismael, February 19, 2010.

  1. josefismael

    josefismael New Member

    Joined:
    December 14, 2009
    Messages:
    2
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    firsttime poster, longtime lurker - awesome product and an even awesome-er community working to make it even better :)

    So, after seeing multiple posts about this issue (and being a victim of it myself), I decided to write a little renamer script to solve my problem. All it's really doing is renaming based on date and filename, but it's been working pretty well for me over the last few weeks so I figured I'd share. Ideally you would have a copy of the .ps1 script for each show you need renamed. If you wanted, you could simply call however many .ps1 scripts you have from one .bat file - I'm currently doing this through good ol windows task scheduler :)

    A couple caveats:

    -the script is dependent on the fact that you know your seriesid - to get this go here:

    http://thetvdb.com/api/GetSeries.php?seriesname="your show name"



    this will give you a list of all the show names that match your show - grab the series id and pop that in the $seriesid variable of the script

    -speaking of the thetvdb.com, that's what I'm using to scrape episode info, and in order to do so I needed to get an API key. Go get your own, and add it into the script as the $apikey variable.

    -here's the list of variables that the script that you will need to supply:
    --series id ($seriesid variable)
    --an API key for thetvdb.com ($apikey variable)
    --a source folder containing the mis-named files ($sourcepath variable)
    --a destination folder to put the renamed files in ($destinationpath variable)
    --how you would like your showname to show up in the final file ($resultantshowname variable)
    --powershell 1.0 installation (bundled with the attached zip file)

    The biggest potential problem with the script is that it's relying on a consistent naming convention - YYYY.MM.DD. If for some reason this changes, the script won't work. So far I've been ok, but you never know....

    Anyway - hope it can help someone out.....let me know if you have questions on it :)

    jm
     

    Attached Files:

  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. moryoav

    moryoav Portal Pro

    Joined:
    December 2, 2008
    Messages:
    236
    Likes Received:
    43
    Ratings:
    +46 / 0
    Home Country:
    Israel Israel
    That's great, but is there really no simpler way to do this? Can't it somehow be done in TvSeries itself? I mainly need this functionality for "The Daily Show" and "The Colbert Report" which get downloaded with air dates instead of seasonXepisode format...

    It's considered an open issue here:
    http://code.google.com/p/mptvseries...Status Priority Stars Milestone Owner Summary

    It would be really nice if this feature could be implemented in one of the next releases...
     
  4. josefismael

    josefismael New Member

    Joined:
    December 14, 2009
    Messages:
    2
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    yeah, but the fact that it's been an open issue for more than a year makes me think that either there's not a lot of interest for this feature (which is hard to believe) or that support in general for My-TV series is waning (also hard to believe). Either way, it's about as easy a solution as you're going to get.

    It just sounds like a lot of work because i've tried to make it as extensible as possible. It will honestly take you longer to get your API key from thetvdb than it will to setup this script :)

    PM me if you need a hand....
    jm
     
  5. JDM_DSM

    JDM_DSM New Member

    Joined:
    October 17, 2009
    Messages:
    4
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Canada Canada
    Thank you so much for coming up with this solution. It'd be nice for MyTVSeries to be able to import based on air dates, but this is a very functional workaround in the meantime.
    However, for some reason my parsing expressions won't recognize single digit episode numbers, so I did a bit of research and modified your script to always use a minimum of 2 digits for the episode.
    One thing led to another and I ended up making the following tweaks as well, and thought I'd share them if anyone else is interested.

    -The script will now match files of any age, rather than just files that aired in the last 3 days.
    -The airdate and episode name are included in the new file name.
    -The original script assumed the file extension to be .avi, now it retains the original extension.
    -The original files are no longer deleted automatically. I use torrents to get most my shows, so if I delete the originals I can't seed. I simply commented out the lines that remove the originals, so that function can easily be re-enabled if desired.
    -I added a log file to track what was copied and which files were unable to be matched to an air date.

    Once again thank you for coming up with this solution and sharing it with everyone.
     

    Attached Files:

  6. moryoav

    moryoav Portal Pro

    Joined:
    December 2, 2008
    Messages:
    236
    Likes Received:
    43
    Ratings:
    +46 / 0
    Home Country:
    Israel Israel
  7. jacc1234

    jacc1234 Portal Pro

    Joined:
    April 11, 2008
    Messages:
    167
    Likes Received:
    8
    Ratings:
    +8 / 0
    Thanks for the ideas. Hopefully a way to add shows by the series name and episode air date will be added soon.
     
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!