Plex Forums: Auto-rename your episodes - Plex Forums

Jump to content

  • (22 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Auto-rename your episodes

#21 User is offline   realitymonkey Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: 06-January 09

Posted 07 January 2009 - 07:49 PM

Sorry totally missed it at the top.....
0

#22 User is offline   Hilbe Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 38
  • Joined: 17-December 08

Posted 07 January 2009 - 11:18 PM

View Postspaceman, on Jan 7 2009, 11:47 AM, said:

Yes, I wrote up some code for it but I'm unable to test it here. You can uncomment the waitForItems function and the calls to it and save the script if you'd like to do some testing before then.
btw that function won't do anything unless the script is triggered by a folder action.

You'll need to update your cron job as the calling syntax for the bash file has changed. Just add a -m before the srcfolder and you should be good to go.


I'm holding out for you to test it :)

My cron will get me by until then...
0

#23 User is offline   Hilbe Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 38
  • Joined: 17-December 08

Posted 11 January 2009 - 01:29 AM

Any update on the waitForItems from spaceman?

Whats odd about the script is it'll move anything. It appears that while I'm copying files to the Airport Disk, it'll give it some goofy name temporarily. If the script only looked for AVI, MP4, etc. I don't think I'd have the issue anymore.
0

#24 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 11 January 2009 - 02:44 AM

View PostHilbe, on Jan 10 2009, 08:29 PM, said:

Any update on the waitForItems from spaceman?

Yes, I might post a new version tomorrow.
I've got a commitment that could last all week and I'm well into some major enhancements to this script.
Depending on how things go I might post an update with just this item and hold back on the other enhancements for a week or two.

View PostHilbe, on Jan 10 2009, 08:29 PM, said:

Whats odd about the script is it'll move anything. It appears that while I'm copying files to the Airport Disk, it'll give it some goofy name temporarily. If the script only looked for AVI, MP4, etc. I don't think I'd have the issue anymore.

I know, I've experienced this myself and it's on the to do list.
0

#25 User is offline   Pundy Icon

  • Dedicated Member
  • PipPipPip
  • Group: Members
  • Posts: 171
  • Joined: 31-May 08
  • Gender:Male
  • Location:Adelaide, Australia

Posted 21 January 2009 - 02:25 AM

Couple points that I've added in to this script on my end...

1. The name.S02E03.extn regexp doesn't treat the lower case S and E conventions that are often used. (need to modify the regexps to have [Ss] and [Ee])

2. If doing a move, its good to simlink from the original directory so torrents can continue. This means you can move across mounts and then symlink giving almost same as hardlinking does on the same mount.


What I can't get working though is the automated folder actions... I follwed your instructions and did some look ups on the web and all seems good but the script never runs automatically. The script is enabled in the folder automation app. ANyone got any ideas?
0

#26 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 21 January 2009 - 05:14 AM

View PostPundy, on Jan 20 2009, 09:25 PM, said:

1. The name.S02E03.extn regexp doesn't treat the lower case S and E conventions that are often used. (need to modify the regexps to have [Ss] and [Ee])

Thanks for reminding me

View PostPundy, on Jan 20 2009, 09:25 PM, said:

2. If doing a move, its good to simlink from the original directory so torrents can continue. This means you can move across mounts and then symlink giving almost same as hardlinking does on the same mount.

Not sure how well the various torrent client will handle this. I've been putting inks in the library folder and leaving all the originals in the downloads folder. If you can think of any reason to do it the other way I might add this as an option

View PostPundy, on Jan 20 2009, 09:25 PM, said:

What I can't get working though is the automated folder actions... I follwed your instructions and did some look ups on the web and all seems good but the script never runs automatically. The script is enabled in the folder automation app. ANyone got any ideas?

Wait a bit. The next version is progressing nicely.
0

#27 User is offline   Todd L Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 6
  • Joined: 21-January 09

Posted 21 January 2009 - 09:24 AM

View Postspaceman, on Jan 20 2009, 09:14 PM, said:

Not sure how well the various torrent client will handle this. I've been putting inks in the library folder and leaving all the originals in the downloads folder. If you can think of any reason to do it the other way I might add this as an option

With hard links, it doesn't matter; once both names exist, they're equally real.

For symlinks, I'd think you'd want the real file in its permanent location and the symlink in the temporary (if one is temporary). For me at least, the torrent seed copy is the temporary one.

It'd be nice if the torrent clients exposed an interface that would let us point them at the final destination, but I don't think any of them do.


On the Daily Show, Colbert Report and similar, it's possible to use TheTVDB to get working (if somewhat imaginary, I think) season and episode numbers. You need to parse out the date from the original filename, and have a seriesid, and then you use the GetEpisodeByAirdate.php api call. You could look up seriesids manually and hardcode them for the few shows that need this, or you could use the GetSeries.php call.

I have a similar renamer, written partially as a Ruby learning exercise. It gives filenames like "The Daily Show.S14E03.2009-01-07.Rachel Maddow.avi" for TDS.

I don't claim it's great code and it absolutely won't for anyone else without some code changes, but I'd be happy to share it if someone wants to see how to use the TheTVDB API or wants a ruby base to build their own customizations on. (I'm very impressed, in a "my god, did you see that 50 car pileup?" kind of way, at the things some people do with AppleScript)
0

#28 User is offline   crimsonhawk Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 24-June 08
  • Gender:Male
  • Location:Kansas City

Posted 22 January 2009 - 05:35 AM

Just want to add to the kudos for this. I'd been trying to muddle through coming up with something and was floundering. So far, I've just tried it on a couple of shows, but it works great. I wasn't sure if it would recognize the folders I already had created, but as long as the names match it works fine. This is amazing.
Mac Mini (1.83 Core Duo), 1 GB ram
OSX 10.5.4
Harmony One Remote
Remote Buddy
0

#29 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 22 January 2009 - 06:58 AM

View Postcrimsonhawk, on Jan 22 2009, 12:35 AM, said:

Just want to add to the kudos for this. I'd been trying to muddle through coming up with something and was floundering. So far, I've just tried it on a couple of shows, but it works great. I wasn't sure if it would recognize the folders I already had created, but as long as the names match it works fine. This is amazing.

Thanks :)
0

#30 User is offline   Hilbe Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 38
  • Joined: 17-December 08

Posted 26 January 2009 - 03:21 PM

spacegod, any update on getting the script updated for the moving of files with AFP shares?
0

#31 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 26 January 2009 - 03:34 PM

Sorry Hilbe,
I'm working on it right now. I think you'll find it's been worth the wait.
0

#32 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 27 January 2009 - 08:10 PM

New version available at top of thread
0

#33 User is offline   rogersmj Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 63
  • Joined: 02-September 08

Posted 28 January 2009 - 05:26 PM

This looks really great! Almost exactly what I'm looking for...but is there any way for it to employ scrapers like Plex does so it can give me the name of an episode? Looking through the rules, that's the one piece I don't see.
0

#34 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 28 January 2009 - 06:27 PM

View Postrogersmj, on Jan 28 2009, 12:26 PM, said:

is there any way for it to employ scrapers like Plex does so it can give me the name of an episode?

TVDB integration is on my to-do list. Track the topic to get notifications when new versions are posted.
If you have any other feature requests please let me know.
0

#35 User is offline   Hilbe Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 38
  • Joined: 17-December 08

Posted 28 January 2009 - 06:29 PM

View Postspaceman, on Jan 28 2009, 01:27 PM, said:

TVDB integration is on my to-do list. Track the topic to get notifications when new versions are posted.
If you have any other feature requests please let me know.


I've mentioned this in a feature request thread for a command line utility. It'd be awesome that once you're done moving the file, it'll directly update a Plex DB regardless to whether Plex is running. This will require some sqllite connectivity I believe...
0

#36 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 28 January 2009 - 06:57 PM

View PostHilbe, on Jan 28 2009, 01:29 PM, said:

It'd be awesome that once you're done moving the file, it'll directly update a Plex DB regardless to whether Plex is running.

Editing Plex's internal DB directly is risky. If an update changes the way library info is stored we could end up breaking people's libraries.
Plex has an option to update on startup. Plex is also stable enough at this point that you can leave it running in the background for days at a time.
I think those are both preferable options. You're welcome to try and convince me otherwise.
0

#37 User is offline   ShavenYak Icon

  • Dedicated Member
  • PipPipPip
  • Group: Members
  • Posts: 110
  • Joined: 03-December 08

Posted 28 January 2009 - 08:59 PM

Can't Plex be told to update its library via Applescript? That would be a much better idea than trying to update its database directly.
0

#38 User is offline   spaceman Icon

  • Plug-in Dev
  • PipPipPip
  • Group: Castle Keeper
  • Posts: 775
  • Joined: 16-September 08
  • Gender:Male
  • Location:10 Miles West of the exact centre of the universe

Posted 28 January 2009 - 10:04 PM

View PostShavenYak, on Jan 28 2009, 03:59 PM, said:

Can't Plex be told to update its library via Applescript? That would be a much better idea than trying to update its database directly.

No, but it can via http. That's what the current version of Episode Linker uses.
0

#39 User is offline   ShavenYak Icon

  • Dedicated Member
  • PipPipPip
  • Group: Members
  • Posts: 110
  • Joined: 03-December 08

Posted 29 January 2009 - 02:44 AM

View Postspaceman, on Jan 28 2009, 04:04 PM, said:

No, but it can via http. That's what the current version of Episode Linker uses.


Cool, that makes more sense anyway - the user could then run Episode Linker on a different machine than Plex, at least in theory.
0

#40 User is offline   crimsonhawk Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 24-June 08
  • Gender:Male
  • Location:Kansas City

Posted 29 January 2009 - 06:52 AM

I'm a little confused on the new version here. I've opened the new app, specified the folders, and anything else I try and do throws an error "Can't make <<class psfx>> of <<script>> into alias. (-1700)

Any suggestions? I've tried removing all previous versions, restarting, etc... and can't get it to work or do anything other than throw this applescript error.
Mac Mini (1.83 Core Duo), 1 GB ram
OSX 10.5.4
Harmony One Remote
Remote Buddy
0

  • (22 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users