[mythtv-users] Fully delete rec from cli

Andrew Guenther andguent at gmail.com
Tue Aug 29 00:26:05 UTC 2006


On 8/28/06, Chris Pinkham <cpinkham at bc2va.org> wrote:
> * On Sun Aug 27, 2006 at 07:39:35AM -0400, Andrew Guenther wrote:
> > Quick request. I did about 30 mins of googling and was surprised I
> > could not find this anywhere.
> >
> > What I would like to do is properly and completely delete a recording
> > from command line/cron.
>
> Might not have to do that if you take advantage of other builtin
> features.
>
> > EX: I set my box to record the evening news and record all simpsons
> > episodes. If any news broadcast is 48 hours old, I want it to expire
> > and go away. I don't want to loose old simpsons episodes if I don't
> > have to, BUT I do want everything to autoexpire at some point.
>
> If you only want 2 days worth of the evening news then set maxepisodes
> to be 2 and then turn on setting that says "Delete oldest if this would
> exceed the max episodes."  That will keep the 2 newest episodes around
> and delete anything over 2.  So if you don't watch any episodes, Myth
> will record the new one each day and delete the oldest one so there are
> only 2 left.
>
> AutoExpire works by ordering recordings by their 'autoexpire' field.
> If you want The Simpsons to expire after Futurama, then you can manually
> update the autoexpire field for Futurama to 2 and leave the Simpsons
> at the default of 1.  This is an integer field in the database but
> the scheduled recording editor only allows you to set it to 0 (Don't
> allow auto expire) or 1 (Allow auto expire).  If you set Futurama to
> 2 in the record and recorded tables in the database then episodes of
> Futurama will expire before the Simpsons.
>
> If you want everything to expire before the Simpsons then you'd need to
> set everything to 2 and leave the Simpsons at 1.  Something like the
> following SQL:
>
> update record set autoexpire = 2;
> update record set autoexpire = 1 where title = "The Simpsons";
> update recorded set autoexpire = 2;
> update recorded set autoexpire = 1 where title = "The Simpsons";
>
> To see the order different shows will expire in do this:
>
> select title, autoexpire from recorded order by autoexpire, title;
>
> All recordings with an equal autoexpire value will be expired in the
> order you specified in the setup screen (I use 'oldest first').
>
> Keep in mind that if you do this, the numbers higher than 1 will
> probably get reset to 1 if you go into the scheduled recording editor
> for the recording since Myth only supports 0 and 1 right now for that
> field in the editor.
>
> This is also how MythTV knows to expire LiveTV recordings first.  LiveTV
> recordings have their autoexpire field in the DB set to 10000 so that
> they get expired first before any normal recordings.
>
> > Anyone know what setting 'deletepending'=1 in the recorded table does,
> > just by itself? Found this off in googleland:
> > UPDATE recorded SET deletepending = 1 WHERE chanid = '1027' AND
> > starttime = '2006-07-06T00:13:28' ;
>
> deletepending is a flag that is set to tell the backend that a recording
> is currently being deleted so that when the frontend requests a list
> of recordings the ones being deleted are hidden from the user's view.
> This flag should only be set by the backend, setting it yourself will
> have no effect other than to make the recording disappear from your
> Watch Recordings screen for a few minutes.
>
> --
> Chris
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>

My example may have been over simplified. All this info is excellent,
but I'm still very interested in a way to cleanly remove a recording
and all associated sql data.

One reason to want this is that I came back to my myth box after a
week of being busy and found that my antenna cable fell out. The last
week worth of recordings was just snow. Plugging the cable back in
fixed that (serves me right for cleaning).

I already set all those nuv's to 0 bytes, but mythweb still shows me
my favorite png preview of a white rabbit in a blizzard, times 15+. I
would absolutley love to build a quickie for loop that if age is
greater than this and less than that, delete. It would be quicker then
using mythweb to delete one at a time.

The ideas for configuring via frontend are very informative. I very
much like the autoexpire=1000 if it really is as simple as setting
something that high to make a recording go away.

My complication with using the frontend to configure is that I run no
frontends at all. My backend is a 500mhz, 128ram, with a pvr350,
sitting in runlevel 3. The only way I watch my tv is via smb, nfs, or
rsync. Yes I could bump it to runlevel 5 and haul a monitor over, but
I'd rather write scripts. I'm lazy.

I have other reasons for wanting to cron it all as well. Something
along the lines of:
If recording is not myshows[] and age > 30 days then delete

I'd rather maintain a listing of shows I want to keep than track what
everyone else sets to record.

Thanks for the ideas. I'm up for more.


Andrew


More information about the mythtv-users mailing list