My frontend tells me that I have 642 recordings, a figure which is confirmed by the api getrecordedlist but find_orphans tells me that two of those are orphans.
I have been doing database restores to diagnose channel/mythweb issues so that may explain those two. If I add a spurious file junk.mpg to the folder then find_orphans faithfully lists it.../setup/find_orphans.py
Orphaned video files
myth2: /var/lib/mythtv/recordings/20009_20211228195600.ts 2.1GB
myth2: /var/lib/mythtv/recordings/20009_20211228205600.ts 4.5GB
However, a scan of the recording folder shows a very different story with types:
There are 2 .ts files and 423 .mpg files there which are not revealed in either the frontend or the getrecordedlist api. The 423 .mpg which are not reported by find_orphans are all imported from a Mythtv 0.27 setup and are taking up 660GB. I didn't need that new disk!!1 .
find_orphans under 0.27 does not find them either.
Now under 0.27 the api lists all these recordings but the recording group is shown as 'Deleted'.
Quite how or why they were not deleted under 0.27 is unclear - possibly closedowns immediately after a recording deletion?
Under version 31 though the api does not list them.
It looks as if the recording are still in the database, have a recording group of 'Deleted' but are hidden from the api and the frontend.
find_orphans however sees them as valid recordings so does not list them as orphans.
Now I can easily list and delete these real orphans but it would be irresponsible not to at least flag the issues here:
1. What is the mechanism for deleting files? How do they get left behind? Does 31 still have this issue?
2. The 31 api no longer list Deleted recordings.
3. find_orphans.py does not find them.
My fe/be is version 31.20211108 and find_orphans is the latest 31+ from the wiki.
/usr/lib/python3/dist-packages/MythTV/utility/dt.py includes the lines:
so the bindings are as recommended in viewtopic.php?f=36&t=4071utc_naive = self.replace(tzinfo=None) - self.utcoffset()
utc_naive = utc_naive.replace(tzinfo=None)
return ((utc_naive - utc_epoch).total_seconds())