Difference between revisions of "Mythfilldatabase"

From MythTV Official Wiki
Jump to: navigation, search
(Command line options: outdated command line... all options need closing (will do so when I have access to my system to get output))
m (I noted that the --only-update-guide option is missing, so adding a warning and reminder that this article may be out of date.)
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Cleanup}}
 
{{Cleanup}}
 
{{Wrongtitle|mythfilldatabase}}
 
{{Wrongtitle|mythfilldatabase}}
 +
{{Note box|This article is up-to-date as of MythTV version 0.25 but may not reflect functionality which has been added/changed in later versions.}}
 
'''mythfilldatabase''' fills the Myth database [[program table]] with upcoming shows.
 
'''mythfilldatabase''' fills the Myth database [[program table]] with upcoming shows.
  
Line 11: Line 12:
  
 
== Command line options ==
 
== Command line options ==
--manual
+
<pre>
:Run in manual channel configuration mode. This will ask you questions about every channel.
+
$ mythfilldatabase --help
 +
mythfilldatabase version: fixes/0.25 [v0.25-100-gb5b4c48] www.mythtv.org
 +
Misc. Options:
 +
--dd-file                      Bypass grabber, and read SD data from file
 +
  --lineupid                      DataDirect lineup of input xml file
 +
  --offset                        Day offset of input xml file
 +
  --xmlfile                      XML file to import manually
 +
--dd-grab-all                  refresh full data using DataDirect
 +
--file                          Bypass grabbers and define sourceid and file
 +
  --xmlfile                      XML file to import manually
 +
--manual                        Run interactive configuration
 +
--no-mark-repeats              do not mark repeats
 +
--preset                        Use channel preset values instead of numbers
 +
-h OR --help OR --usage        Display this help printout, or give detailed
 +
                                information of selected option.
 +
--version                      Display version information.
 +
--sourceid                      Operate on single source
 +
--update                        Run non-destructive updates
 +
--xawchannels                  Read channels from xawtvrc file
 +
  --xawtvrcfile                  xawtvrc file to import channels from
  
--update
+
Channel List Handling Options:
:For running non-destructive updates on the database for users in xmltv zones that do not provide channel data.
+
--do-channel-updates            update channels using datadirect
 +
--do-not-filter-new-channels    don't filter ATSC channels for addition
 +
--only-update-channels          only update channel lineup
 +
--remove-new-channels          disable new channels on datadirect web interface
  
--preset
+
Filtering Options:
:Use it in case that you want to assign a preset number for each channel, useful for non US countries where people  are used to assigning a sequenced number for each channel, i.e.: 1->TVE1(S41), 2->La 2(SE18), 3->TV3(21), 4->Canal 33(60)...
+
--dont-refresh-tba              don't refresh "To be announced" programs
 +
--max-days                      force number of days to update
 +
--refresh                      Provide a day or range of days to refresh. Can
 +
                                be used repeatedly.
  
--file <sourceid> <xmlfile>
+
Channel Icon Handling Options:
:Bypass the grabbers and read data directly from a file. <sourceid> = number for the video source to use with this file. <xmlfile>  = file to read.
+
--export-icon-map              export icon map to file
 +
--import-icon-map              import icon map to file
 +
--reset-icon-map                resets icon maps
 +
--update-icon-map              updates icon map icons
  
--dd-file <sourceid> <offset> <lineupid> <xmlfile>
+
Logging Options:
:<sourceid> = see --file
+
--loglevel                      Set the logging level.  All log messages at
:<offset>  = see --file
+
                                lower levels will be discarded.
:<lineupid> = the lineup id
+
                                In descending order: emerg, alert, crit, err,
:<xmlfile>  = see --file
+
                                warning, notice, info, debug
 +
                                defaults to info
 +
--logpath                      Writes logging messages to a file in the
 +
                                directory logpath with filenames in the format:
 +
                                applicationName.date.pid.log.
 +
                                This is typically used in combination with
 +
                                --daemon, and if used in combination with
 +
                                --pidfile, this can be used with log rotators,
 +
                                using the HUP call to inform MythTV to reload
 +
                                the file
 +
--nodblog                      Disable database logging.
 +
-q OR --quiet                  Don't log to the console (-q).  Don't log
 +
                                anywhere (-q -q)
 +
--syslog                        Set the syslog logging facility.
 +
                                Set to "none" to disable, defaults to none.
 +
-v OR --verbose                Specify log filtering. Use '-v help' for level
 +
                                info.
  
--xawchannels <sourceid> <xawtvrcfile>
+
</pre>
:(--manual flag works in combination with this). Read channels as defined in xawtvrc file given <sourceid> = cardinput, <xawtvrcfile> = file to read
 
 
 
--do-channel-updates
 
:When using DataDirect, ask mythfilldatabase to overwrite channel names, frequencies, etc. with the values available from the data source. This will override custom channel names, which is why it is off by default. This may manage to fix a corrupted channel lineup. You will also likely need to use this switch if your cable company does a channel realignment, once your program listings source catches up.
 
 
 
--remove-new-channels
 
:When using DataDirect, ask mythfilldatabase to remove new channels (those not in the database) from the DataDirect lineup. These channels are removed from the lineup as if you had done so via the DataDirect website's Lineup Wizard, but may be re-added manually and incorporated into MythTV by running mythfilldatabase without this option. New channels are automatically removed for DVB and HDTV sources that use DataDirect.
 
 
 
--do-not-filter-new-channels
 
:Normally MythTV tries to avoid adding ATSC channels to NTSC channel lineups. This option restores the behaviour of adding every channel in the downloaded channel lineup to MythTV's lineup, in case MythTV's smarts fail you. 
 
 
 
--graboptions <"options">
 
:Pass options to grabber.
 
 
 
--sourceid <number>
 
:Only refresh data for sourceid given.
 
 
 
--max-days <number>
 
:Force the maximum number of days, counting today, for the grabber to check for future listings.
 
 
 
--only-update-channels
 
:Get as little listings data as possible to update channels.
 
 
 
--refresh
 
      Each instance of the --refresh option takes one input, and the option can be specified
 
      multiple times.  The three named options can be pre-pended by the 'not' parameter,
 
      specifying that day should not be pulled.  Numbered days start with today at zero,
 
      counting up, and a range can be specified using a dash.
 
     
 
      The following example will refresh today, skip tomorrow, and refresh all of next week:
 
     
 
      mythfilldatabase --refresh today --refresh nottomorrow --refresh 7-13
 
 
 
--refresh-today
 
:superseded by --refresh as of 0.25, old options will continue to function for now, but will be hidden from the help printout.
 
--refresh-second
 
:superseded by --refresh as of 0.25, old options will continue to function for now, but will be hidden from the help printout.
 
--refresh-all
 
:superseded by --refresh as of 0.25, old options will continue to function for now, but will be hidden from the help printout.
 
:(Only valid for grabbers: DataDirect, se_swedb, no, ee, de_tvtoday). Force a refresh today or two days (or every day) from now, to catch the latest changes. These may be used to attempt to fix corrupted program guide data.
 
 
 
--dont-refresh-tomorrow
 
:superseded by --refresh as of 0.25, old options will continue to function for now, but will be hidden from the help printout.
 
:Tomorrow will always be refreshed unless this argument is used.
 
 
 
--dont-refresh-tba
 
:"To be announced" programs will always be refreshed unless this argument is used.
 
 
 
--export-icon-map [<filename>]
 
:Exports your current icon map to <filename> (default: iconmap.xml).
 
 
 
--import-icon-map [<filename>]
 
:Imports an icon map from <filename> (default: iconmap.xml).
 
 
 
--update-icon-map
 
:Updates icon map icons only.
 
 
 
--reset-icon-map [all]
 
:Resets your icon map (pass all to reset channel icons as well).
 
 
 
--mark-repeats
 
:Marks any programs with a OriginalAirDate earlier than their start date as a repeat.
 
 
 
-v or --verbose debug-level
 
:Use '-v help' for level info.
 
 
 
--help
 
:This text.
 
 
 
--manual and --update can not be used together.
 
  
 
== External XMLTV ==
 
== External XMLTV ==
 
If you are in a country where mythfilldatabase will not work the normal way  you will need to use the --file flag (e.g. XMLTV does not have a grabber included, or the grabber options are not fully supported by MythTV).
 
If you are in a country where mythfilldatabase will not work the normal way  you will need to use the --file flag (e.g. XMLTV does not have a grabber included, or the grabber options are not fully supported by MythTV).
  
=== 1. Obtain xml file of tv guide ===
+
=== Obtain xml file of tv guide ===
  
 
Here in Belgium, I use [http://pytvgrab.sourceforge.net pytvgrab] to get my tv guide and output to an xml file:
 
Here in Belgium, I use [http://pytvgrab.sourceforge.net pytvgrab] to get my tv guide and output to an xml file:
Line 113: Line 88:
 
</nowiki></pre>
 
</nowiki></pre>
  
=== 2. Find out the source id of your card ===
+
=== Find out the source id of your card ===
  
 
This is normally '1' if you have only one input card, but it is best to check it out because I have found if I have run mythtv setup more than once it can end up being something other than 1. To check, you need to look at the database:
 
This is normally '1' if you have only one input card, but it is best to check it out because I have found if I have run mythtv setup more than once it can end up being something other than 1. To check, you need to look at the database:
Line 128: Line 103:
 
Remember the source id
 
Remember the source id
  
=== 3. Run mythfilldatabase with the --file flag ===
+
You can find another set of instruction on [[XMLTV_CH#Find_input_sourceid|how to find the sourceid here]].
  
The --file argument allows to directly import xmltv files. This is useful if you are using programs like [http://nxtvepg.sourceforge.net/ nxtvepg] to grab your EPG data.
+
=== Run mythfilldatabase with the --file flag ===
  
'''Prior 0.21:'''
+
The --file argument allows to directly import XMLTV files. This is useful if you are using programs like [http://nxtvepg.sourceforge.net/ nxtvepg] to grab your EPG data.
  
The offset argument the defines the number of days from today on to be updated. "-1" will refresh all. In this example "belgium.xml" is the file name for the output of the grabber:
+
Note that Schedules Direct members should not use the <code>--file</code> argument with mythfilldatabase.  They should instead use --dd-file with data obtained by running <code>tv_grab_na_dd</code> using the <code>--dd-data</code> argument.
<pre><nowiki>
 
$ mythfilldatabase --file <sourceid> offset belgium.xml
 
</nowiki></pre>
 
  
 
'''From 0.21 on:'''
 
'''From 0.21 on:'''
Line 154: Line 126:
  
  
The first time you will need to use the --manual flag, but this is better explained on the [[XmlTv]] page.
+
The first time you will need to use the --manual flag, but this is better explained on the [[XMLTV]] page.
  
 
= Troubleshooting =
 
= Troubleshooting =

Revision as of 14:41, 22 January 2014

Clean.png Cleanup: This article or section may require cleanup. Discuss the issue on the talk page

Important.png Note: The correct title of this article is mythfilldatabase. It appears incorrectly here due to technical restrictions.


Important.png Note: This article is up-to-date as of MythTV version 0.25 but may not reflect functionality which has been added/changed in later versions.

mythfilldatabase fills the Myth database program table with upcoming shows.

Automatic use of mythfilldatabase

Normally mythfilldatabase is run automatically by mythbackend every 24 hours. For most people allowing mythfilldatabase to run automatically will be sufficient, however in areas with no XMLTV grabber or an unusual channel setup it may be run manually.

Manual use of mythfilldatabase

To run an extra time out of sequence (for example, because your subscription had run out, and you just renewed it), use no command line options:

     mythfilldatabase

Command line options

$ mythfilldatabase --help
mythfilldatabase version: fixes/0.25 [v0.25-100-gb5b4c48] www.mythtv.org
Misc. Options:
--dd-file                       Bypass grabber, and read SD data from file
  --lineupid                      DataDirect lineup of input xml file
  --offset                        Day offset of input xml file
  --xmlfile                       XML file to import manually
--dd-grab-all                   refresh full data using DataDirect
--file                          Bypass grabbers and define sourceid and file
  --xmlfile                       XML file to import manually
--manual                        Run interactive configuration
--no-mark-repeats               do not mark repeats
--preset                        Use channel preset values instead of numbers
-h OR --help OR --usage         Display this help printout, or give detailed
                                information of selected option.
--version                       Display version information.
--sourceid                      Operate on single source
--update                        Run non-destructive updates
--xawchannels                   Read channels from xawtvrc file
  --xawtvrcfile                   xawtvrc file to import channels from

Channel List Handling Options:
--do-channel-updates            update channels using datadirect
--do-not-filter-new-channels    don't filter ATSC channels for addition
--only-update-channels          only update channel lineup
--remove-new-channels           disable new channels on datadirect web interface

Filtering Options:
--dont-refresh-tba              don't refresh "To be announced" programs
--max-days                      force number of days to update
--refresh                       Provide a day or range of days to refresh. Can
                                be used repeatedly.

Channel Icon Handling Options:
--export-icon-map               export icon map to file
--import-icon-map               import icon map to file
--reset-icon-map                resets icon maps
--update-icon-map               updates icon map icons

Logging Options:
--loglevel                      Set the logging level.  All log messages at
                                lower levels will be discarded.
                                In descending order: emerg, alert, crit, err,
                                warning, notice, info, debug
                                defaults to info
--logpath                       Writes logging messages to a file in the
                                directory logpath with filenames in the format:
                                applicationName.date.pid.log.
                                This is typically used in combination with
                                --daemon, and if used in combination with
                                --pidfile, this can be used with log rotators,
                                using the HUP call to inform MythTV to reload
                                the file
--nodblog                       Disable database logging.
-q OR --quiet                   Don't log to the console (-q).  Don't log
                                anywhere (-q -q)
--syslog                        Set the syslog logging facility.
                                Set to "none" to disable, defaults to none.
-v OR --verbose                 Specify log filtering. Use '-v help' for level
                                info.

External XMLTV

If you are in a country where mythfilldatabase will not work the normal way you will need to use the --file flag (e.g. XMLTV does not have a grabber included, or the grabber options are not fully supported by MythTV).

Obtain xml file of tv guide

Here in Belgium, I use pytvgrab to get my tv guide and output to an xml file:

$ tv_grab_be_tvb --configure  (you only need this the first time)
$ tv_grab_be_tvb -o belgium.xml

Find out the source id of your card

This is normally '1' if you have only one input card, but it is best to check it out because I have found if I have run mythtv setup more than once it can end up being something other than 1. To check, you need to look at the database:

$ mysql -u root mythconverg
mysql> select * from cardinput\G
cardinputid
cardid
sourceid=4
etc.

Remember the source id

You can find another set of instruction on how to find the sourceid here.

Run mythfilldatabase with the --file flag

The --file argument allows to directly import XMLTV files. This is useful if you are using programs like nxtvepg to grab your EPG data.

Note that Schedules Direct members should not use the --file argument with mythfilldatabase. They should instead use --dd-file with data obtained by running tv_grab_na_dd using the --dd-data argument.

From 0.21 on:

From version 0.21 on the arguments of this command changed. The offset argument has been removed and the command changed to:

$ mythfilldatabase --file <sourceid> belgium.xml

From 0.25 on:

From version 0.25, the arguments of this command changed:

$ mythfilldatabase --file --sourceid <sourceid> --xmlfile belgium.xml


The first time you will need to use the --manual flag, but this is better explained on the XMLTV page.

Troubleshooting

mythfilldatabase causes the system to hang

This is probably an I/O saturation issue. mythfilldatabase and MySQL can cause hard disk or ATA bus saturation, causing Mythbackend to starve. Read more about Troubleshooting:Mythfilldatabase_IO_bottleneck.