[Solved] XMLTV Grabber Schedules Direct Sqlite Setup

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
gnurocks
Junior
Posts: 49
Joined: Fri Dec 01, 2017 11:18 pm
United States of America

[Solved] XMLTV Grabber Schedules Direct Sqlite Setup

Post by gnurocks »

For those struggling with the “leap” to XMLTV schedules, the following is how I got things working. I installed Ubuntu MATE 22.04 / Mythtv v32 (from the PPA), then used “Jim A’s” outstanding guide. See http://mythtvinstall.blogspot.com/2018/ ... nd-on.html

For my workflow, I ran mythtv-setup as $USER and ran the tv_grab-zz_sdjon_sqlite setup files as mythtv (Jim A’s guide, step 24). Yes, I know of the Mythtv XMLTV Wiki warning about running mythtv-setup as $USER.

For step 26 of Jim A’s guide, “Create links for all the files created by XMLTV setup in /home/mythtv/.xmltv and /home/mythtv/.mythtv in /home/$USER …,” I did the following:

HARD LINK (not symlink) the database file to /home/$USER (allows mythfilldatabase to be run correctly by mythtv or $USER):

Code: Select all

sudo ln /home/mythtv/.xmltv/SchedulesDirect.DB /home/username/.xmltv/SchedulesDirect.DB
Give RW permissions for the mythtv user group to SchedulesDirect.DB (default is read only or 644):

Code: Select all

cd /home/mythtv/.xmltv
sudo chmod 664 SchedulesDirect.DB
COPY (not hard link or symlink) the XXXX.xmltv file to /home/$USER:

Code: Select all

cp /home/mythtv/.mythtv/XXXX.xmltv /home/username/.mythtv/XXXX.xmltv
Edit only the newly copied XXXX.xmltv file that now resides in /home/$USER/.mythtv/:

Code: Select all

nano /home/username/.mythtv/XXXX.xmltv
Edit first line to reflect database=/home/username/.xmltv/SchedulesDirect.DB
Change or verify ownership and permissions of XXXX.xmltv:

Code: Select all

cd /home/username/.mythtv

Code: Select all

sudo chown username:username XXXX.xmltv

Code: Select all

sudo chmod 664 XXXX.xmltv
Follow the rest of Jim A’s checklist and after step 32 (exit back to $USER):

Optimize auto mythfilldatabase downloads by going into mythtv-setup -> General -> Program Schedule Downloading Options -> Automatically Update Program Listings -> Guide Data Arguments, and input the following two arguments: --no-allatonce --refresh 0-21

The argument “--no-allatonce” in conjunction with "-–refresh 0-21,” will acquire tomorrow and future days and will also update all changes to preexisting days, all with minimal memory usage. See #12758 patch post, Peter Bennett’s Comment 7 here: https://code.mythtv.org/trac/ticket/12758

Hope this helps.
Last edited by gnurocks on Sat Jan 14, 2023 12:38 pm, edited 1 time in total.
User avatar
bill6502
Developer
Posts: 2437
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: [Solved] XMLTV Grabber Schedules Direct Sqlite Setup

Post by bill6502 »

Due respect, the preferred solution is here: viewtopic.php?f=36&t=3480&start=15#p19508
It requires no links/copies of files. It does required running mythfilldatabase from the command like as user mythtv
(the recommended user that the backend runs as). Creating an alias for running the command makes life easier.
gnurocks
Junior
Posts: 49
Joined: Fri Dec 01, 2017 11:18 pm
United States of America

Re: [Solved] XMLTV Grabber Schedules Direct Sqlite Setup

Post by gnurocks »

Thanks. I'll try out your suggestion and also try using an alias. Like you mentioned, it should make things a lot easier.
gnurocks
Junior
Posts: 49
Joined: Fri Dec 01, 2017 11:18 pm
United States of America

Re: [Solved] XMLTV Grabber Schedules Direct Sqlite Setup

Post by gnurocks »

bill6502 wrote:
Sat Jan 14, 2023 5:15 am
Due respect, the preferred solution is here: viewtopic.php?f=36&t=3480&start=15#p19508
Thanks, bill6502, for the great head-start for my setup. I settled on using the SQLite grabber. After much time and testing, I've found that CABLE and OTA do not do well comingling on the same DB. So, I had to split the DB into one for CABLE and one for OTA. Since then, I have had no dreaded "Malformed XML file" errors.

Also, I cleared the "perl module JSOB::XS not installed. JSON encode/decode performance will be poor." error you may have seen while using the third setup command, "tv_grab_zz_sdjson_sqlite --days 0 --config-file $HOME/.mythtv/SD.xmltv" by installing libjson-xs-perl. Once installed, recurring XMLTV grabber updates accelerated by ~10 minutes.

Here's my setup:

Code: Select all

Example for distributions that store MythTV data relative to ~mythtv/.mythtv,

/
└── home
    └── mythtv
        ├── .mythtv
        │   ├── CABLE.xmltv # Which contains:
        │   │       database=/home/mythtv/.xmltv/SchedulesDirectCABLE.DB
        │   │       lineup=USA-IL90210-X
        │   │       lineup!USA-OTA-90210
        │   │       3rdparty-metadata=disabled
        │   │       mythtv-categories=enabled
        │   │       station-logo-order=
        │   │
        │   └── OTA.xmltv # Which contains:
        │           database=/home/mythtv/.xmltv/SchedulesDirectOTA.DB
        │           lineup!USA-IL90210-X
        │           lineup=USA-OTA-90210
        │           3rdparty-metadata=disabled
        │           mythtv-categories=enabled
        │           station-logo-order=
        │
        └── .xmltv
            ├── SchedulesDirectCABLE.DB
            │
            └── SchedulesDirectOTA.DB
gnurocks
Junior
Posts: 49
Joined: Fri Dec 01, 2017 11:18 pm
United States of America

Re: [Solved] XMLTV Grabber Schedules Direct Sqlite Setup

Post by gnurocks »

Apologies. I caught an error in the original posting of the above depiction. Now updated to show how the XMLTV configuration files point (database=/...CABLE.DB or ...OTA.DB) to separate DB files.
Post Reply