Steven4x4, I added the "copy" feature you mentioned, and also a few more options. I edited my original comment w/ these changes and linked newer script there. (old one is still there too.) Here is a summary of the changes:
I've made a couple of changes and attached a second version of this script. This script includes the above changes and these:
- Added an option for auto-discovery of all sections. So you don't have to specify them in a list. The old way still works too.
- Added an option to ignore some sections if using the auto-discovery option
- Added an option to trigger an immediate library rescan for affected sections. The sections are only rescanned if changes happened w/ that section.
- Added an option to always rescan the destination dir, if changes were made. (in the case of move & copy)
- Added the "copy" option that Steven4x4 mentioned. (Note on using this: it looks like python's "move" varies by platform. In some cases it will clobber the destination file if it exists, in others it will throw an exception. I haven't spent much time sussing it all out, because I don't think people use this option for anything except testing. But just be aware, if you first run with "copy" selected, then later switch to "move," python might complain about about the destination file already existing.)
- [minor] added some handling for str/int types. In the original, numbers were specified as a string. Now the lists can be specified as either strings or ints, and both should work.
- [minor] - oh, and I added "minor changes by egretsareherons" to the top. I'm not trying to steal your credit, as far as I'm concerned it's your script (Thanks again, btw) I just don't want you getting blamed for anything I may have screwed up.
See my previous comment for the script. https://forums.plex.tv/topic/84822-plex-auto-delete-script/page-2#entry537084
I really enjoy programming and would love to spend time working on this script, but I just don't know where my time goes anymore.
Hopefully it will get easier in the new year.
I'm glad I was able to contribue this script as it seems a ton of people have been using it (although they don't post), but thats alright with me.
I don't at all feel you are trying to steal my credit. I just wanted you to know when I complie a new script and add the features your develo[ed in to my original code, that you will be noted for your additions.
I most defintely don't like taking credit for anyones work. So just wanted to make sure that your contributions are know.
I appreciate your interest in further developing this script.
STEEVo: The change you're suggesting with keeping one show around so ondeck works correctly would be handy. It non-trivial, though, at least for me I don't yet know enough about plex to be able to do something like that. I just installed it for the first time a few days ago and I don't really understand how/why it determines show names. So I'm not your guy. At least not yet. Maybe, someday. :) Hopefully someone else is interested & can add something like that.
Same Here - I tried using the On Deck, but it doesn't work the way I wanted it to. When I view a show On Deck, sure thats cool it brought me to the latest episode, but when I need to watch the episode after that, it not very easy.
I typically go to TV Shows > Unwatched > Dexter and watch my shows like that.
Thanks egretsareherons, great new additions!
I am thinking the KeepOnDeck function should be implemented without regard for Plex naming conventions.
Example: the current script finds 5 watched shows for deletion for the tv series "bones." However, if Keep OnDeck is ticked in the script, before deleting those five, the script runs a "which-one-of you-5-has-the-most-recent-date-for: originallyAvailableAt value?" Then the script deletes the 4 files and keeps the keeps the one that has that most recent date. It seems to me that this would all be based on only the filenames and the originallyAvailableAt value.) This would of course then repeat for each show.
Wouldn't that method avoid any need for obtaining or using show name logic from Plex? Again, I wish I had any programming skills. I would try it. Thank you both again for all the work on this script. I think it is fantastic!
I know there a probably a number of ways to get this to work, but just haven't quite understood how Plex is keeping track of what's On Deck.
Because to me it seems they have to pouplate an arry (small database) with all of the epsiodes of that show, then determine which is the last one.
To me that is poor programming as it causes alot of over head in ram utilizing that array. Now I'm sure they don't actually do this and they have some sorta method to their madness.
We just have to figure out that method, because your above method describe is a typyciall way of doing things if we don't have those key identifiers handy.
But again, I'm sure there is a key identifier, but haven't had the time to clearly look through and make the distiction of how Plex is associating their ViewShows attritubites to the attributes in there OnDeck.
Because I tried referencing NOT deleting a viewed show if it was in the OnDeck section. But you said that didn't quite work. Cause my understanding was that Plex already did the hard work after you watched the show it changed the attributes on the episodes and identified which one was OnDeck, (Since it Clearly has a Specific Section for OnDeck) so that means it should have already been marked and not depent on other files, but its seems thats not the case.
So yea, sorry for all the blabling, I just haven't had the time to sit down and figure out what exact distinct attribute its setting/pulling to make programing it accpetable.
The array method you and I discussed could work, but there is just to much over head and I feel is poor programming to do that knowing there is probably a better way.