[mythtv-users] XMLTV setup can't run mythtv-setup as user mythtv

Bill Meek keemllib at gmail.com
Mon Jul 27 02:16:19 UTC 2020

On 7/26/20 8:44 PM, DryHeat122 wrote:
>     On Sat, Jul 25, 2020 at 5:30 PM Bill Meek <keemllib at gmail.com <mailto:keemllib at gmail.com>> wrote:
>     [snip]
>     The intent of doing the setup as user mythtv is to end up with a single set of files
>     in ~mythtv/.mythtv/*.xmltv and ~mythtv/.xmltv/* where the latter depends on the grabber
>     selected.
>     Doing links (hard or symbolic) defeats that and makes a difficult process even harder
>     to setup and maintain.
>     Here's the way to run mythfilldatabase from the command line:
>         sudo --login --user=mythtv mythfilldatabase
>     When the backend runs it, it will just work because the files are in it's .mythtv
>     and .xmltv directories.
>     Run the above with the -v system command and you'll see the tv_grab_zz_sdjson command
>     line that mythfilldatabase is executing. Run that from the command line to see if
>     there are more clues to the problem. The file (--output /tmp/blah) won't be removed
>     so you can look at it too. You can even add --debug to the tv_grab_zz_sdjson command
>     but don't do that 1st as it's pretty verbose.
>     I use tv_grab_zz_sdjson_sqlite so won't be of much more help.
>     Here's a picture of the desired files. Again for the *SQLite version*:
>     Example for distributions that store MythTV data relative to ~mythtv/.mythtv,
>     /
>     └── home
>           └── mythtv
>               ├── .mythtv
>               │   ├── OTA.xmltv # Which contains:
>               │   │       database=/home/mythtv/.xmltv/SchedulesDirect.DB
>               │   │       lineup=USA-OTA-90210
>               │   │       mythtv-categories=enabled
>               │   │
>               │   └── CABLE.xmltv # Which contains:
>               │           database=/home/mythtv/.xmltv/SchedulesDirect.DB
>               │           lineup=USA-IL90210-X
>               │           mythtv-categories=enabled
>               │
>               └── .xmltv
>                   └── SchedulesDirect.DB
>     Note that nothing is stored under the login user's .mythtv or .xmltv
> OK I am close.  My contents are the same as yours.  The only issue I'm having is that when I did the second (OTA) configuration, it seems to 
> have deleted the entries from the first (cable) configuration in the DB.  When I query with select distinct(lineup) from channels it gives 
> only the US-OTA-XXXXX lineup.  And select * from lineups returns only one record for the same lineup.

The same as my *example* is OK, but the key is that your source names in mythtv-setup
Video sources -> Video Source Name: are used to form the file name in .mythtv. So, if
you have two sources defined in mythtv-setup AND they're named OTA and CABLE, you're
good to go.

I used the SchedulesDirect.DB name  for both DBs, I have two entries when using:
select distinct(lineup) from channels and two entries are found with: select * from lineups

But read on:

> To be clear, I followed wiki directions from heading "Setup with tv_grab_zz_sdjson_sqlite" by cutting from the wiki and pasting to the terminal, 
> substituting cable for SD the first time, and ota for SD the second time.  I assumed I had to do it twice to get the separate .xmltv entries.  
> Is there maybe an argument to tv_grab_zz_sdjson_sqlite that's not noted in the wiki that I have to use to tell sqlite3 I'm appending a second 
> .xmltv config rather than starting a new DB?  I was going to have a look at the code (assuming it's not binary) but I can't locate the file.

"Substituting cable for SD the first time, and ota for SD the second time" is OK. It
just means you'll have two database files. And the database= line in the example must
point to them. E.g.:

In: CABLE.xmltv

In OTA.xmltv

Just edit the files and correct the paths as required.

I didn't do that and put everything in SchedulesDirect.DB. Truth be told, if I can carve
out some time, I always meant to do it the way you did.

 From the above, you have ~mythtv/.xmltv/SchedulesDirect.cable and ~mythtv/.xmltv/SchedulesDirect.ota
Which is fine. If you want to peek inside the SQLite databases, then you must
do the query in each database name. sqlitebrowser is a bit easier (to me).

tv_grab_zz_sdjson_sqlite is written in Perl (I believe all of the grabbers are.)


More information about the mythtv-users mailing list