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

Ma Begaj derliebegott at gmail.com
Mon Apr 7 12:44:25 UTC 2008


2008/4/6, Michael T. Dean <mtdean at thirdcontact.com>:
> 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

Thanks for the update on this. I already deleted most of the files
without typing or clicking. I gave my 9 year old nephew the remote in
the hand, explained him how to delete everything and I bought him ice
cream after that :).

I did not want to run myth.find_orphans.pl because I was not totally
sure about compatibility with 0.21-fixes. I did not want to leave some
other orphanages in the tables.

I saw your answer too late and I already created a ticket for this
issue, because it looked like a bug for me:
http://svn.mythtv.org/trac/ticket/5174

Thanks one more time.


More information about the mythtv-users mailing list