[mythtv-users] find_orphans.py script doesn't delete anything

Stephen Worthington stephen_agent at jsw.gen.nz
Thu Mar 14 03:35:46 UTC 2024

On Thu, 14 Mar 2024 13:31:26 +1100, you wrote:

>> I just had a hunt around on my development box and found the program I
>> wrote for someone last year that had a similar problem.  Unlike
>> find-orphans.py, it uses the Services API to do the deletes, so it may
>> possibly work better for you.  But it was only tested on v32, so I do
>> not know if it will work on v31.  It can be downloaded from here:
>> http://www.jsw.gen.nz/mythtv/myth-delete-missing.py
>> Note that the "drc" command is not working, but you probably only want
>> the "d" command anyway.
>Hi Stephen, it seems to run OK on V31. It lists hundreds of recordings and
>then says:
>  Proceed with deletions (y/N) ?
>When I enter Y it looks like it's deleting things. But if I then run it
>again afterwards for a second time it lists the same recordings and asks me
>if I want to proceed again. That makes me think it didn't actually delete
>anything. Am I misunderstanding how it works?

No, you are not misunderstanding things.  However, deleting is not a
straightforward operation - things get queued for deletion, then
deleted and queued again in a different queue and then actually
deleted later from that queue.  So we need to do some diagnosis of
what is happening.  Some SQL might shed some light, so please run
these commands and report the results:

sudo mysql
select count(*) from recorded where deletepending!=0;

If it is a non-zero result, then run it again after a few minutes to
see if it is changing.

And what does this show:

sudo mysql
select count(*) from recorded where recgroup='Deleted';

>BTW it also stops with an error:
>  Exception while trying to delete recording recordedid=4216

Please post the full exception message with the backtrace (if there is
one), so I can try to work out what the problem is.

More information about the mythtv-users mailing list