[mythtv-users] How do I remove all recordings from the database?

Stephen Worthington stephen_agent at jsw.gen.nz
Thu Jul 27 09:33:16 UTC 2017


On Thu, 27 Jul 2017 08:35:26 +0100, you wrote:

>Is it as easy as "DELETE FROM recorded;" and then remove all the mpg and 
>png files from mythtv/recorded?
>
>Any other data to tidy up?

Yes, lots.  For example, the recordedprogram and recordedseek tables.
There are probably others.  If you want to delete everything, I know
of no easy way of doing it.  Deleting all recordings of one program is
easy - just add them to a playlist and the delete from the playlist
menu.

One thing that might work is to delete all the recording files and
then use the find_orphans script to delete all the recordings without
recording files.  But I have found find_orphans to have problems when
dealing with huge numbers of recordings at once - it only seems to
work properly if it is dealing a limited number of recordings at once.
I think I needed to delete less than 100 per run of find_orphans.

So, the best way to do it may be to write a script in Python to use
the API to get a list of all recordings, then to use that list to
delete each recording in turn.  You may need to leave delays between
the deletes or you could get into the same problems find_orphans has.


More information about the mythtv-users mailing list