[mythtv] Way of calling FORCE_DELETE_RECORDING

Michael T. Dean mtdean at thirdcontact.com
Sun Aug 6 21:49:31 UTC 2006


On 08/06/06 14:36, Jochen Kühner wrote:

>Michael T. Dean schrieb:
>  
>
>>You can manually delete non-existent recordings through the UI.  If 
>>you're using SVN trunk r9490 or 0.19-fixes r10505 or higher, it works 
>>without issue (it pops up a dialog saying the file doesn't exist and 
>>then allows you to see recording details or delete the metadata from the 
>>database).  The challenge is finding the non-existent recordings (which 
>>can be done pretty easily with some simple SQL, ls, etc.).
>>
>i know that i can delete them, but there are a few hundret in the list 
>wich don't exist any more... if theres no way to do this, maybe i write 
>a small php script for mythweb or i'm looking to implement a new command 
>in the main server wich can do that...
>  
>

All you need to do is a "DELETE FROM recordings"...  Something like:

ls -l /path/to/your/recordings/directory |
awk "BEGIN {
  printf (\"SELECT title, subtitle FROM recorded WHERE basename NOT IN (\");
}
/\.(mpg|nuv)$/ {printf (\" '%s',\", \$9) }
END {
  print \" '');\"
}" | mysql -umythtv -p mythconverg

I'll leave it up to you to change the "SELECT title, subtitle" to 
"DELETE".  Oh, and /make sure/ you change the path to the recordings 
directory before you change it to "DELETE".  :)

Note, though, that this won't allow re-record.  You'd also need to 
modify the oldrecorded table to do that.

Mike


More information about the mythtv-dev mailing list