I've been thinking for awhile now that I would like to have my video files autodeleted after I've watched them (as I'm not a collector). I haven't had much luck finding a script or anything that handles this sort of interaction. Since Plex keeps track of my watched/unwatch, I think something that communicates with the server would likely be my best bet. So that has lead me to consider creating a channel which would give some file management options.
I'm a novice programmer, and more of a tinkerer rather than a theorist, so I admit I may be way out of my league here. My initial idea is to look at the trakt.tv channel code to see how it interfaces with the PMS to track watched/unwatched scrobbing, and then maybe check into Plex's 'allow clients to delete files' preference to see how that is handled and try to cobble together a working solution that'll need to be finetuned.
A couple of questions though:
1. Would anyone else be interested in something like this?
2. Is there already something like this out there and I've just managed to miss it in my search?
3. Are there channels with similar or associated functions that would be better used as reference than the trakt.tv/client delete files scenario I mention above?
I welcome other feedback as well. Thanks for reading.
An auto-delete script of some sort would better fit your needs. If you're just going to create a channel that involves interaction in order to delete things you might as well just do the deletions within Plex itself. For me the quickest method to do that is on my phone or tablet, or in the case of a really bad movie that I wish I hadn't watched, immediately from within Plex itself (in my case, on the mac mini). It only takes 5 seconds to do.
An auto-delete script of some sort would better fit your needs. If you're just going to create a channel that involves interaction in order to delete things you might as well just do the deletions within Plex itself. For me the quickest method to do that is on my phone or tablet, or in the case of a really bad movie that I wish I hadn't watched, immediately from within Plex itself (in my case, on the mac mini). It only takes 5 seconds to do.
I would love an auto-delete script; however, I haven't been able to find one. Sure, I can make a script to trigger if a file is a certain number of days old or has X name or was created after a certain date, etc., yet I am unsure of how to get a script to check, from outside of Plex, if the file has been watched and to remove it if it has. Unless you're referring to some other auto-delete script function that I am unaware of?
As for going into Plex and deleting the file manually, that is a PITA. I watch 8-10 hours of TV a day on average. I'm easily distracted. I'm not all that organized. I'd rather just have the delete functionality automated. Perhaps I'm the only one who falls in that category; I'm cool with that. I'd still like to do it, and would appreciate any help or guidance in that direction.
I am currently in the process of switching my MediaServer from Windows WorkStation to my New Virtualized LinuxMediaServer.
I got everything automated from downloads etc, but no I want to figure out how I can auto-remove watched items.
The concept doesn't seem all that hard and I could start working on a script once I've located some information.
From what I understand so far:
All of the data is being stored here in the "com.plexapp.plugins.library.db" file. Which is a sqllite file.
I went ahead and opened it up using a sql browser on windows. There a ton of simlar named tables.
My problem is: I'm trying to find out what table/value is being set in this database to help me identify when something is being marked as watched or not wactched.
Once I have identified that key factor, I can them move on using sqllite to query the db and located watched files and identify their file name and remove them using nearly any scripting language.
Does any one know what table and column its using as well as the values to determine off and on?
PMS exposes the relevant data via the HTTP XML API. You could just query PMS rather than breaking out the SQLite. Since this isn’t related to Plex Channels, I’m moving this topic to the general development forum.
Yup. IIRC, you’ll need to check for the presence of the “watched count” key in the XML since if the content is unwatched then the “watched count” key is not included rather than being set to 0. I think that in-progress content also uses a different key but it’s been a while since I looked into that much. Still, way easier that wading through the SQL database IMO.