[mythtv] Automatic deletion

Tako Schotanus quintesse at palacio-cristal.com
Fri Jul 4 11:26:46 EDT 2003


Just out of curiosity: why are you including the autoexpire column in
the order by?
Aren't you using this to determine which auto-expire plug-in to use?
Or have you decided on another way to implement the plug-in system?

Cheers,
 -Tako

> -----Original Message-----
> From: mythtv-dev-bounces at snowman.net 
> [mailto:mythtv-dev-bounces at snowman.net] On Behalf Of Chris Pinkham
> Sent: vrijdag 4 juli 2003 5:51
> To: mythtv-dev at snowman.net
> Subject: Re: [mythtv] Automatic deletion
> 
> 
> > > I have working code right now which implements 
> AutoExpiration of old
> > > files based upon record date.  The code is designed to 
> allow easy plugin
> 
> > If you have a moment and could send a quick diff my way I'd be very
> > interested. I was having trouble devising one that didn't 
> essentially
> > duplicate what HandleQueryFreeSpace and 
> HandleDeleteRecording did. However
> > those routines annoyingly were very much tied to the idea 
> of there being a
> > PlaybackSock.
> 
> I'll email you a diff of my cvs tree.  My code runs as a 
> thread in mythbackend
> so it runs on every backend.  It wakes up every so often and 
> checks the
> amount of free space using 5 lines of code copied from 
> HandleQueryFreeSpace
> but modified a little.  If the free space is below the 
> threshold then it
> gets an ordered list of which shows can be expired.  It then 
> proceeds to
> delete the shows one by one until enough free space is available.
> 
> I split up HandleDeleteRecording into two functions.  The original
> function name still exists and takes the same parameters.  It 
> only has 3
> lines of code now though to get a ProgramInfo object from the 
> stringlist
> passed in and then call the real DoHandleDeleteRecording with 
> the ProgramInfo
> object.
> 
> The delete is handled by sending an AUTO_EXPIRE message/event 
> with the chanid
> and starttime.  The mainserver object receives this message 
> and then calls
> DoHandleDeleteRecording to do the actual delete.
> 
> > I don't know if you've implemented it this way but that 
> path I was taking
> > was going to add a new field to the record and recorded tables (and
> > eventually recording profiles). I was going to make it an 
> int, default to 0
> 
> I did pretty much exactly what you're describing.  I added a 
> 'autoexpire'
> column to recorded and am going to add it to the record table 
> when I setup
> the gui stuff.  It defaults to 1 now which means it can be 
> auto-expired if
> the auto-expire code is turned on (which is OFF by default).  
> So, my code
> to get the list of programs to expire just does
> 
>            WHERE recorded.hostname = '%1'
>                AND autoexpire > 0
>                ORDER BY autoexpire ASC, starttime DESC
> 
> I get the list in reverse order because of the way I populate 
> and expire
> the list.
> 
> Chris
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev
> 



More information about the mythtv-dev mailing list