[mythtv-users] auto-expire by priority?

Brad Templeton brad+myth at templetons.com
Wed Jun 15 05:12:05 UTC 2005

On Tue, Jun 14, 2005 at 10:00:03PM -0400, Chris Pinkham wrote:
> > Maybe I'm thinking about this all wrong, but is there a way to
> > auto-expire by priority rather than by age, or otherwise configure my
> > recording schedules to achieve this effect?
> Don't think there's a way to do this right now.  It'd be fairly easy
> to implement though.  When I created AutoExpire, I created a method
> called AutoExpire::FillExpireList().  This method checks the current
> AutoExpireMethod and calls the appropriate function to get the list
> of recordings to autoexpire.  Currently the only method is oldest first
> and uses AutoExpire::FillOldestFirst(), but you could easily add a
> AutoExpire::FillLowestPriorityFirst() and add code to store the
> original recording priority with a recording so it could be used to
> AutoExpire.  I figured people would want other methods so I tried to
> make the code flexible, but noone ever implemented any other expiration
> ordering methods and I think the setup option for selecting the method
> has been taken out of the setup screen recently because of this.  My
> drive never seems to fill up enough to have AutoExpire kick in, but if I
> did use it, I know I'd prefer "Lowest Priority First" rather than
> "Oldest First".  If I didn't care that much if it recorded to begin with,
> why would I want it to stick around when something else I cared about more
> got expired just because it was older? :)

Without changing the code, you could also just play some games in the
table.   Priority is a signed int (negative is lower, usually close to zero)
while autoexpire is an unsigned int.

So you could execute the following sql statement

    update recorded set autoexpire = 1000 - recpriority
        where autoexpire = 1

from time to time, and it would transfer the recpriority to the autoexpire,
if the autoexpire is set to the default value of 1.   Right now tvwish
is the only program making use of autoexpires other than 1 or 0.

Unfortunately you can't make this change in 'record' because there is a bug
and it doesn't copy autoexpire correctly from record to recorded.  I have
submitted a patch which fixes this but it is not checked and is being
further revised.

More information about the mythtv-users mailing list