[mythtv-users] Deleting recordings from playlist does not work when file is missing

Michael T. Dean mtdean at thirdcontact.com
Sun Apr 6 17:37:13 UTC 2008


On 04/06/2008 11:17 AM, Ma Begaj wrote:
> My hard disk dies a few weeks ago and I was looking for a nice way to
> remove old recordings from the database.
>
> Mike Dean told me to add all recordings to the playlist and in the
> playlist's menu choose "Delete". But that does not work. It works only
> if recording's file exist.
>   

Guess it won't ask for permission when you're doing a "mass delete."

> Than I started again using "DELETED group" instead of instant delete
> right after clicking on "Delete" button. This also partially solved
> the problem with deleting old non-existent recordings because Myth
> moved them all to "Deleted" group.
>
> These old recordings will probably never get deleted from "Deleted"
>   

Right.

> ... or not? I prefer using instant delete because I often copy some
> other files on the same disk and I like to know how much space I
> really have.
>   

mysql -umythtv -p mythconverg -B \
      -e 'SELECT "touch " AS "", basename AS "" FROM recorded;' > ~/recs
cd /path/to/recordings
sh ~/recs

(fix username/DB name as required).  Then--after you successfully delete
the missing files--you'll want to run something to delete all the
0-length files (you'll get a file for every recording in every storage
group directory in which you run recs).  You could do it with something
like:

find . -size 0 -print0 | xargs -0 rm

> Is this a bug? Should Delete in the playlist's menu also delete
> recordings which do not have files any more? Or am I maybe only one
> who gets this error?

Perhaps I'll just write some code for Myth to take care of this for you
(find and allow delete of recordings whose files are missing).  That
would solve two problems--make it easy to delete missing recordings
without hitting the DB directly, and get rid of the legacy
myth.find_orphans.pl script (which hasn't been converted to use the Perl
bindings).  It's on my list.

Mike




More information about the mythtv-users mailing list