Jump to content

FR: Server: Auto Delete Watched after "N" Days


trusselo

Recommended Posts

Kurosh

but I didn’t respond to the thread I responded to a specific comment about there being no way of cleaning up server recordings. You still seem to be overlooking that.

 

Plus your comparison to what’s available on a standard dvr is also misguided. Emby is a multi user system and each user may or may not watch a recording. That’s a significantly more complex scenario to manage. Yes I’d like to see this but I can see there is quite a bit more development required before this is possible. Don’t hold your breath

 

With respect (seriously), I don't think anyone is holding their breath. If you look to when this was first requested...

 

Started by trusselo, Jun 29 2014 06:57 PM

 

It's nearly been FIVE years! :)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
BMStroh

Part of the trick with deleting is that Next Up would have to be reworked - right now, I delete watched shows via a cron job running SQL against the Emby database.  Once a watched episode 4 disappears, episode 5 won't show up in Next Up.

 

Still thinking about how to make this work to manage space vs. convenience.

Link to comment
Share on other sites

  • 2 months later...
hieroglyph

I too would like to see a feature built into Emby that auto-deletes a movie or tv episode if it has been in the watched state for X consecutive days.

 

I was using Emby + Trakt + Plex + Plex-Cleaner to achieve this. But it seems Trakt has wised up and is now requiring an upgrade to VIP to use their scrobble feature. I don't mind paying Trakt for the feature; but I do mind paying and stilling having to use x2 media server programs and a github script to achieve this goal; or being forced to use to Plex.

 

Definitely looking forward to this feature!

Link to comment
Share on other sites

Hi, I created a python script that will look for all watched content for a specific user. If the last played date is past the cut off date it will delete the file.

I built this for myself and it works good enough for me, but I have only tested it on my system (ubuntu 18.04) with my server. So no guarantee it will work for everyone, and since it can delete files have a backup to be safe. By default it does not delete files until you modify the config file to be safer.

It first lists all the files, then will list the files that will be deleted.

On first run it will ask you some questions to generate the config file, or you can create it manually

Here is the script if anyone else is interested in trying it out: https://github.com/clara-j/media_cleaner

 

New thread to discuss this tool is now here: https://emby.media/community/index.php?/topic/77658-emby-media-clean-delete-watched-video/

Edited by jpc82
  • Like 3
Link to comment
Share on other sites

Hi, I created a python script that will look for all watched content for a specific user. If the last played date is past the cut off date it will delete the file.

 

I built this for myself and it works good enough for me, but I have only tested it on my system (ubuntu 18.04) with my server. So no guarantee it will work for everyone, and since it can delete files have a backup to be safe. By default it does not delete files until you modify the config file to be safer.

 

It first lists all the files, then will list the files that will be deleted.

 

On first run it will ask you some questions to generate the config file, or you can create it manually

 

Here is the script if anyone else is interested in trying it out: https://github.com/clara-j/media_cleaner

 

Thank for this, looks amazing. Will try it out. It looks like it doesn't distinguish between movies (wanna keep all regardless of watched state) and TV Shows (wanna remove watched ones). Is there any way to make this script look at the TV show library and not Movies / Concerts etc.?

 

I suppose others may want to go further and select which TV shows to look at (e.g. topical stuff you would only watch once) and ignore other ones you wanna keep (e.g. classic old stuff you'd watch time and again) but I reckon that my be asking a bit much!

Edited by Kurosh
Link to comment
Share on other sites

For my use case I don't care about movies vs tv shows which is why I didn't built that.  But I am sure it is possible.  If it is something people would be interested I could look into it.

 

I built it for my use, if I have extra time i will add features if people are interested.

 

I should probably create a separate thread for this so I don't mix up with this thread.  I am just not sure what area to create it in.

 

New thread to discuss this tool is now here: https://emby.media/community/index.php?/topic/77658-emby-media-clean-delete-watched-video/

Edited by jpc82
  • Like 1
Link to comment
Share on other sites

Happy2Play

For my use case I don't care about movies vs tv shows which is why I didn't built that.  But I am sure it is possible.  If it is something people would be interested I could look into it.

 

I built it for my use, if I have extra time i will add features if people are interested.

 

I should probably create a separate thread for this so I don't mix up with this thread.  I am just not sure what area to create it in.

I would make a post in tool and utilities.

Link to comment
Share on other sites

Happy2Play

Personally I could see this as a plugin and have its own config page for after x days and libraries/content type to delete.  But you would run into what do you do if there are no episodes left in a Series?

Link to comment
Share on other sites

sfatula

Going back to my earlier post....

 

This capability exists in MythTV and is part of the recording timer. So, a few settings:

 

1. Auto delete flag - whether or not it's possible to delete watched automatically.

2. If #1 is set, then, criteria. How many days.

3. Auto expire flag - this says if you are out of disk space, delete the oldest recording. So, of all your recordings, of the ones with auto expire enabled, if you run out of disk space, it will delete the oldest recording from any timer with auto expire enabled. Good for news type programs and many others. Obviously default to not enabled.

 

This has been around forever in MythTV and works very well. #3 can avoid all other settings (i.e. max to keep and auto delete) for many folks as it simplifies things if you are ok with deleting oldest. I always was. For finer control, #1 and #2.

 

Note, this only addresses DVR.

Link to comment
Share on other sites

I've since reworked my SQL to find all but the newest watched episode so Up Next now works properly.  For active shows that are cancelled, deleting files when I remove them from Sick(beard|rage|chill) does the final housekeeping; for other shows in the archive, I do the housekeeping manually to remove the last episode once I'm done.

Link to comment
Share on other sites

I think that is great, although we should probably start discussing as a community what this type of option would look like in Emby, where it would be located, the conditions to trigger it, etc. if you want to bring up other apps as point of comparison that is welcome too. Thanks.

Link to comment
Share on other sites

sfatula

To me, it belongs on the series screen (or when creating a new one). I realize that means non dvr content can't be managed this way, not sure of that use case but maybe all unique programs could be placed there with non dvr under a different tab if that proves useful.

 

So, the settings added to each series would be:

 

Auto delete watched days - defaults to never, but, otherwise, number of days after it reaches a watched state, whether manual or after watching.

 

I think that's a good first step. You would simply need something that runs on a schedule that checks for watched episodes that have reached their setting, i.e. # of days. I suppose you'd keep a timestamp for each episode that says when it was changed to watched.

 

In this way, you can easily retain shows you never want to remove, which by default, is everything just as it is now.

 

If it is desired to support saving a specific episode only, then, on the episode page where you can mark as watched, etc, you could have a "do not delete" flag.

 

I am not sure how movies you record work, have never recorded one, I am presuming they work the same as tv shows.

Edited by sfatula
Link to comment
Share on other sites

mastrmind11

yep, definitely belongs at the series level.

 

another thing along the same vein would be a button to delete the show when it's finished playing (like when the watch next modal pops up).  it's surprising it doesn't exist already tbh.  

Link to comment
Share on other sites

To me, it belongs on the series screen (or when creating a new one). I realize that means non dvr content can't be managed this way, not sure of that use case but maybe all unique programs could be placed there with non dvr under a different tab if that proves useful.

 

yep, definitely belongs at the series level.

 

We already have a degree of space management in the DVR - although not tied to watched status.  My understanding of this request was that it is for ALL content.

 

So, it should not be tied to recordings.

Link to comment
Share on other sites

sfatula

I would suggest a survey, how many want for all content, not sure of too many that have such a use case. Can't imagine too many wanting their content library of movies being deleted.

Edited by sfatula
Link to comment
Share on other sites

mastrmind11

I would suggest a survey, how many want for all content, not sure of too many that have such a use case. Can't imagine too many wanting their content library of movies being deleted.

this.  I'd wager that the majority wouldn't want their movies deleted, or certain series for that matter.

  • Like 1
Link to comment
Share on other sites

Good day,

 

I do not know, but these type of threads always worry me.

 

If it a must, best to be as a plug-ins not within the Emby core, any "delete" media type should be as a plugin only.

 

My best

  • Like 2
Link to comment
Share on other sites

sfatula

Good day,

 

I do not know, but these type of threads always worry me.

 

If it a must, best to be as a plug-ins not within the Emby core, any "delete" media type should be as a plugin only.

 

My best

But we would not be able to select which programs to ignore, etc very easily. The data isn't there. Hardly an advanced feature if you have used other Dvrs. Without scope creep, pretty simply change I would think. Edited by sfatula
Link to comment
Share on other sites

mastrmind11

 yep.  series screen > more menu > keep watched for n days > enter n days.  defaulted to keep forever, 0 means delete immediately after watching.

 

there's even room for another button on that screen to keep everything aligned and give it a dedicated button.

 

but again, this can also still be accomplished with an additional button near the "watch next/stop" button on that modal that says "delete" or "delete and watch next".  

 

This is literally the single missing feature for me (and a glaring omission to user ergonomics imo considering other media players out there).  

Edited by mastrmind11
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...