[mythtv-users] Deleting recordings after conversion
Michael T. Dean
mtdean at thirdcontact.com
Fri Oct 18 12:49:26 UTC 2013
On 10/16/2013 01:40 PM, Thomas Boehm wrote:
> Andréas Kühne wrote:
>> My wife records alot of TV-series that she just wants to keep, not to
>> view on one of our frontends. Because the selection of series is growing
>> in size I try to export them directly after recording them (via
>> mythexport). I would also like to delete the recordings as soon as the
>> export is done. Is this possible?
> I have this command at the end of my userjob
>
> echo "update recorded set recgroup = 'Deleted', autoexpire = 999 where
> chanid = '$3' and starttime = '$4';"`|mysql --batch --skip-column-names
> --user="${DBUserName}" --password="${DBPassword}" -h "${DBHostName}"
> "${DBName}"
>
> This moves the recording into the "Deleted" recording group and gives it
> a high auto expire priority. Of course you need to substitute the
> variables with yours.
Much better than using bash + echo + mysql + direct DB editing (which
can result in corrupt data in your DB) would be to use a simple Python
script to delete the recording. That way, in the event (or when, I
should say) the database schema changes, your user job will continue to
work and you won't break anything.
I think (and Raymond Wagner could confirm) you could even use
http://www.mythtv.org/wiki/Delete_recordings.py
directly. Something like:
delete_recordings.py --force --chanid='$3' --starttime='$4'
but since you don't need any of the command-line interactivity in that
script (which the --force is skipping), you could cut it down to a
simple script that only receives channel ID and start time and remove
probably 90% of the code in the script. (And if you do cut it down to a
script that deletes one specific recording based on channel ID/start
time, please post your script to
http://www.mythtv.org/wiki/Category:Python_Scripts .)
Mike
More information about the mythtv-users
mailing list