Handling dated shows - my sort-of solution (1 Viewer)

josefismael

New Member
December 14, 2009
2
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
 

Attachments

  • datedshowrenamer.zip
    30.7 KB

moryoav

Portal Pro
December 2, 2008
236
86
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...
 

josefismael

New Member
December 14, 2009
2
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
 

JDM_DSM

New Member
October 17, 2009
4
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.
 

Attachments

  • datedshowrenamerV2.zip
    1.6 KB

Users who are viewing this thread

Top Bottom