[mythtv-users] Filenames of recordings: access from the desktop

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Jan 10 09:12:15 UTC 2022


On Sun, 9 Jan 2022 16:25:02 +0000, you wrote:

>I have several postprocessing scripts which I run from the desktop. 
>Some include box-specific workarounds to use the chanid_starttime.ext 
>format and some need the full file name including the storage group.  I 
>use multiple tabs, so can usually modify an earlier command line.
>
>But I have tried, in setting up, to keep an obvious relationship between 
>the chanid and the Logical Channel Number used in the EPG.  This has 
>been becoming more difficult, with a recording made today from LCN 26 
>having a chanid of 35238 (shown by an I from the Watch Recordings page 
>in the MythCenter-Wide theme).  I think I'll just have to live with it, 
>although it does make it harder to pick a given recording from a 
>file-manager display.
>
>Before I try some other kludge, is there an easy way of displaying and 
>'copying' the full filename from a windowed Myth display?  Or some other 
>approach?  I guess that adding it to the 'Watch Recordings' screen 
>itself isn't going to improve the family experience...
>
>FWIW the 'M > Playback > Playback Data' popup shows the full filename.
>
>TIA
>
>John P

Displaying the file name (but not the file location) is easy.  From a
recording, I twice gives you a lot of information about a recording,
including its file name (the "basename")  It is not really possible to
copy the file name from there though - mythfrontend turns the mouse
cursor off.  In scripts attached to MythTV events, you can pass the
basename to the script using one of the builtin parameters.

I normally just do a database query to find a recording file:

MariaDB [mythconverg]> select
chanid,nzt(starttime),title,subtitle,left(description,20),season,episode,seriesid,programid,filesize/1024/1024/1024
as filesize,basename from recorded where title like '%schindler%'
order by starttime;
+--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
| chanid | nzt(starttime)      | title                                    | subtitle | left(description,20) | season | episode | seriesid  | programid | filesize       | basename                |
+--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
|  10073 | 2021-01-27 22:43:00 | Oskar Schindler: The Man Behind The List |          | The amazing story of |      0 |       0 | 128075076 |           | 1.577273443341 | 10073_20210127094300.ts |
+--------+---------------------+------------------------------------------+----------+----------------------+--------+---------+-----------+-----------+----------------+-------------------------+
1 row in set (0.071 sec)

Then to find the file location, I use locate:

root at mypvr:~# locate 10073_20210127094300.ts
/mnt/rec1/recordings/10073_20210127094300.ts
/mnt/rec1/recordings/10073_20210127094300.ts.png

That only works if the recording is a day or so old - the location
database only gets updated once a day.  You can force it to be updated
manually:

sudo updatedb

but that takes a while as it scans all the partitions mounted on your
system.

I believe there is some Python on the wiki that has an example of how
to find a recording file using the storage directories in the
database.  I have never used it, as in my MythTV Python programs I am
moving lots of recording files, so I pre-build a database table giving
all the locations of the recordings before I start moving files.  See
my mythsgu program if you want to do something like that:

http://www.jsw.gen.nz/mythtv/mythsgu


More information about the mythtv-users mailing list