[mythtv-users] find_orphans.py not working as expected

Gary Raposo gary at raposo.ca
Thu May 14 20:19:34 UTC 2020


On 2020-05-13 4:21 p.m., Gary Raposo wrote:
> On 2020-05-13 2:30 p.m., Bill Meek wrote:
>> On 5/13/20 12:58 PM, Gary Raposo wrote:
>>> Hello all,
>>>
>>> During this extended period of physical distancing, I decided to 
>>> rebuild my MythTV system. Overall it was a fairly smooth process and 
>>> I'm now running MythTV 31 (installed from the RPM Fusion repo) on 
>>> Fedora 31. Everything seems to be working as expected except for 
>>> find_orphans.py. On my previous system I was using the old 
>>> myth.find_orphans.pl so this is my first experience with 
>>> find_orphans.py. My ultimate goal is to schedule find_orphans.py to 
>>> run on a regular basis so that it will send an email if it 
>>> encounters any issues.
>>>
>>> I've copied the code from 
>>> https://www.mythtv.org/wiki/Find_orphans.py (find_orphans.py (for 
>>> v31+)) and it runs but the results are a little confusing. Basically 
>>> find_orphans.py returns every single recording as "Recordings with 
>>> missing files".
>>>
>>> $ ./find_orphans.py
>>> Recordings with missing files
>>> ...
>>>    odysseus: Saturday Night Live - SNL At 
>>> Home                                10201_20200510032700.ts
>>> ...
>>> Count:         127
>>> Please select from the following
>>>   1. Delete orphaned recording entries
>>>   2. Refresh list
>>>  >
>>>
>>> I can confirm that the relevant files are in the recordings 
>>> directory (e.g., 10201_20200510032700.ts). I can see and play the 
>>> recording via mythfrontend as well as mythweb. Everything seems to 
>>> be in order except for the find_orphans.py output.
>>>
>>> Is anyone else having issues with find_orphans.py? I'm not 
>>> proficient with Python so looking for any tips, tricks, or guidance 
>>> on how to get find_orphans.py working.
>>
>> "Works for me". Begin guess mode.
>>
>> New host (and/or new hostname)? What do these return:
>>
>>   curl --header 'Accept:application/json' 
>> localhost:6544/Myth/GetHostName
>>   hostname
>>
>> As to scheduling, the program is interactive (so you must say yes to 
>> things to be deleted.)
>>
> Good point about the interactive model. I may have to rethink the 
> scheduling bit. I'd still like to be able to run find_orphans.py 
> manually at the very least.
>
> The output of those commands look good:
>
> $ curl --header 'Accept:application/json' localhost:6544/Myth/GetHostName
> {"String": "odysseus"}
> $ hostname
> odysseus
>
> Gary
Quick update.

I managed to get a few print statements into the code and from what I 
can tell it looks like "host" is being set to "None" in "populate". As a 
result, nothing is added to "unfiltered".

"recs" is being populated correctly with all of the files from the 
recorded table but because "unfiltered" is empty, all of the recordings 
are listed as "Recordings with missing files".

As I mentioned earlier, I'm not a Python expert so I'm not sure if I'm 
following the logic in the code correctly. Is it normal for "host" to be 
set to "None"?

It also looks like I should be able to specify the hostname on the 
command line but every time I try to add an argument to find_orphans.py 
it fails with: Exception: Invalid hostname specified on command line.

Does anyone know what a valid command line with arguments looks like?

Thanks
Gary


More information about the mythtv-users mailing list