Jump to content

Limit number of episodes to keep


Go to solution Solved by RedBaron164,

Recommended Posts

RedBaron164
Posted

Is there a way for me to limit Emby to only keep a certain number of episodes? For Example, I record the Late Show, but I only want the server to keep the last 10 (2 weeks worth) of episodes and then automatically purge them. Where as with other shows I'm ok with keeping all the episodes.

Posted

Not yet but definitely something we'd like to do.

Diedrich
Posted

Is there a way for me to limit Emby to only keep a certain number of episodes? For Example, I record the Late Show, but I only want the server to keep the last 10 (2 weeks worth) of episodes and then automatically purge them. Where as with other shows I'm ok with keeping all the episodes.

Search for a script that deletes those files and then run that script as described through Task Scheduler. (assuming you're using Windows)
  • Solution
RedBaron164
Posted

I did some searching and found a basic Powershell Script that I was able to tweak to fit my needs.

 

What this does is searches a specific show directory for .ts/.nfo/-thumb.jpg files and if any of those files are older than 14 days it will remove them. I would have preferred to have it find the old .ts files and then use the name to delete the additional files but this was easier for my n00b coding skills. This will also exclude the tvshow and season nfo files.

 

At some point I'll probably add a function where it will remove empty season folders as well but I figured this feature will probably get added to Emby before clearing out empty season folders becomes an issue.

 

$strPath = "E:\The Tonight Show Starring Jimmy Fallon"
$intNbrDays = "14"
$dtmNow = Get-Date

if(Test-Path $strPath) {
     Get-ChildItem $strPath -Recurse -include *.ts,*.nfo,*-thumb.jpg -Exclude tvshow.nfo,season.nfo  | % {
         $dtmFileTime = $_.CreationTime
         $tspDiff = New-TimeSpan -start $dtmFileTime -end $dtmNow
         if($tspDiff.Days -gt $intNbrDays) {
             Remove-Item $_.FullName -force
             }
         }
     }

 

 

 

  • 3 years later...
Posted

Pardon the resurrection of an old thread, but has there been any improvement on this in the last 4 years? I too have some recordings of daily shows that are only interesting if we manage to watch them while they are fairly fresh, but seems I'd have to repeat this script a few times. Not un-doable, but not as 'elegant' as I'd hope for ;)

 

MoHoelx

Spaceboy
Posted

Pardon the resurrection of an old thread, but has there been any improvement on this in the last 4 years? I too have some recordings of daily shows that are only interesting if we manage to watch them while they are fairly fresh, but seems I'd have to repeat this script a few times. Not un-doable, but not as 'elegant' as I'd hope for ;)

 

MoHoelx

yes, it’s one of the series recording options
Posted

I assume then it is only available if Emby is doing the recording (i.e.; live tv) vs my configuration where Tablo records, then shows are moved from Tablo to Emby for playback.

 

Ok, well it was worth asking  :)

Spaceboy
Posted

I assume then it is only available if Emby is doing the recording (i.e.; live tv) vs my configuration where Tablo records, then shows are moved from Tablo to Emby for playback.

 

Ok, well it was worth asking :)

well yeah, why would you expect emby to be able to control something it has no connection to? You’d need to configure this in Tablo
Posted

Because Emby is AWESOME! 

 

Seriously, not something I would 'expect', but it would be possible (although likely limited demand). Since there is an update made to the library, and Emby knows it's taking place, it would be possible to query on a 'per program' basis to see if the new activity causes it to exceed the "keep only" rule and delete the oldest. 

 

But I did copy (update) the script noted earlier in the thread and schedule it to run, so good 'nuf for now. If / when my Tablo rots out, I may be moving to HD Homerun and letting Emby become my one-in-all, but it's hard to justify while Tablo is running rock solid. The only issue I struggled with (which is why I found Emby) is the remote viewing challenges.

 

More than you wanted to know I'm sure, but if @@RedBaron164 is still around on these forums, Thanks for your solution!

Spaceboy
Posted

Because Emby is AWESOME!

 

Seriously, not something I would 'expect', but it would be possible (although likely limited demand). Since there is an update made to the library, and Emby knows it's taking place, it would be possible to query on a 'per program' basis to see if the new activity causes it to exceed the "keep only" rule and delete the oldest.

 

But I did copy (update) the script noted earlier in the thread and schedule it to run, so good 'nuf for now. If / when my Tablo rots out, I may be moving to HD Homerun and letting Emby become my one-in-all, but it's hard to justify while Tablo is running rock solid. The only issue I struggled with (which is why I found Emby) is the remote viewing challenges.

 

More than you wanted to know I'm sure, but if @@RedBaron164 is still around on these forums, Thanks for your solution!

can you not set keep x in tablo then? Seems like a fairly basic dvr function
Posted

@@Spaceboy - yes, I can, but Tablo is not holding the recordings. If I record an episode of Magnum P.I., during the overnight hours that is copied off Tablo to Emby and removed from Tablo. Emby is my 'store and play' platform. Tablo has been reduced to my OTA DVR but I don't store or play from there any longer.

 

No worries though ... the script has given me what I need, just need to make notes somewhere so I can remember what I did! ;)

  • Like 1
Spaceboy
Posted

@@Spaceboy - yes, I can, but Tablo is not holding the recordings. If I record an episode of Magnum P.I., during the overnight hours that is copied off Tablo to Emby and removed from Tablo. Emby is my 'store and play' platform. Tablo has been reduced to my OTA DVR but I don't store or play from there any longer.

 

No worries though ... the script has given me what I need, just need to make notes somewhere so I can remember what I did! ;)

ok, sorry, i understand now. yeah a script like what you already have seems the best way for now

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...