Difference between revisions of "Channel icons"

From MythTV Official Wiki
Jump to: navigation, search
m (duplicate the)
(Link to the correct ChannelIcons section)
(35 intermediate revisions by 19 users not shown)
Line 1: Line 1:
{{stub}}
+
=Channel Icon Download System=
 +
As of 0.21, MythTV includes a channel icon download system in ''mythtv-setup'' which will attempt to automatically download icons for channels in your database from services.mythtv.org. If it cannot find an icon it will present you with a list of options, an the ability to define your own search parameters.
  
If you would like to ensure that channel icons for your local/subscribed channels are automatically available to anyone (including yourself) configuring a MythTV system, you can help create the "master" (all-inclusive) map of icons to channels.
+
To configure icon downloading in mythtv-setup:
 +
* run "mythtv-setup"
 +
* select "Channel Editor"
 +
* click on "Icon Download"
 +
* select either "Download all icons.." or "Rescan for missing icons.."
  
One of the best sources of channel icons is http://www.lyngsat-logo.com/ .  There, you can browse the available icons and choose those appropriate for your system.  However, doing so can be a lot of work (requiring many page hits and a lot of time).
 
  
An easier approach is to use some new features in the post-0.20-SVN branch of MythTV to quickly look up the information.  And, the best part is that you can use this new feature (and help out with the development of MythTV) even if you're not using SVN--there's no need to upgrade ''any'' part of your MythTV installation.
+
==Universal Location==
 +
Starting with version 0.27, a single location for channel icons can be
 +
created on the master backend. The only symlink required is for ''mythweb''.
 +
Remove it's ''.../data/tv_icons'' directory and link it to the chosen
 +
single directory. Make sure that the directory has read/write permissions for user ''mythtv''
 +
and choose the same group that is used by ''mythweb'', e.g. ''www-data''. Make the
 +
new single location directory's mode 775.
  
First, checkout the appropriate portion of the SVN branch with:
+
Symlinks added for prior versions (or old ''channels''/''ChannelIcons'' directories and
 +
their contents) can be removed. Obviously '''after''' copying icons to a new
 +
directory as required.
  
<pre>
+
If a ''ChannelIcons'' Storage Group doesn't already exist, follow the 1st 2 paragraphs
svn co http://svn.mythtv.org/svn/trunk/mythtv/contrib/master_iconmap
+
in the [[Channel_icons#Storage_Group_Location|Storage Group Location]] below. Then restart the backend then frontends.
</pre>
+
  
Doing so will create a directory called "master_iconmap" underneath the current directory. The master_iconmap directory contains a directory called "lyngsat" which contains a file lyngsat_stations.txt--a plain text listing of /all/ the available icons (small channel icons--listed on the line containing [ls-icon]) and logos (larger channel icons--often "widescreen" versions--listed on the line containing [ls-logo]) at LyngSat.
+
Note, the Services API <backend>:6544/Guide/GetChannelIcon endpoint does not work
 +
with this feature. There is a patch for the problem at {{ticket|11865}}.
  
Open the lyngsat/lyngsat_stations.txt file in one text editor so you can search it for your stations. You'll need to decide whether to use the icons or the logos (I used the logos for my stations).
+
== Pre 0.27 Instructions==
 +
By default the icon will be downloaded to the ''/home/<user>/.mythtv/channels'' directory. This is not very friendly when you have multiple frontends and wish them all to share the icons. One method to get around this is to use a symlink for this directory that directs to a network located directory that all your frontends have access to, say ''/var/mythtv/channels'' for example.
  
Then open and edit data/{baseurl,callsigntonetwork,networktourl}.txt in another editor(s).
+
Before downloading the icons, do the following, or similar as per your distribution:
  
* baseurl.txt - shouldn't require any changes
+
<code><pre>
* callsigntonetwork.txt - create a mapping between a callsign (left column) and a network name (right column); it's /very/ important that you use the callsigns used by your listings provider (i.e. DataDirect) or something appropriate for everyone (if callsigns aren't generally used in your country); ''see below for information on naming networks''
+
rm ~/.mythtv/channels -rf
* networktourl.txt - create a mapping between a network name (left column--use the name you defined in callsigntonetwork.txt) and an icon/logo URL (right column--copied straight out of lyngsat_stations.txt)
+
sudo mkdir /var/mythtv/channels
 +
sudo chown <user>:<group> /var/mythtv/channels
 +
ln -s /var/mythtv/channels ~/.mythtv/channels
 +
</pre></code>
  
When naming networks, please try to use the following convention:
+
You will want to run
* If the station is a local station, append a dash followed by the station's callsign to the name of the network with which the station is affiliated. For example, WKMG is the callsign of a CBS affiliate, so its network name should be CBS-WKMG.
+
<code><pre>
* Stations that were affiliated with the WB and UPN networks are changing networks.  Some are becoming affiliates of the new CW network and others of the MyNetworkTV (MyTV) network and some of neither.  Note, though, that it's not a simple substitution (some WB networks are becoming CW and others are becoming MyTV and some are going independent, and the same for UPN stations).  The best source of information is probably http://www.wikipedia.org/.  For affiliates of CW, use "CW-" and for affiliates of MyTV, use "MYTV-".
+
rm ~/.mythtv/channels -rf
* If the station is not affiliated with a national network (i.e. it's an "independent" channel), append the callsign to "IND-".  For example, WSBK decided not to affiliate with the new CW or MyTV networks, but instead became an independent station, so its network name is "IND-WSBK".
+
ln -s /var/mythtv/channels ~/.mythtv/channels
* If the channel is a cable channel, use a descriptive name for it (i.e. "CARTOONNETWORK" was chosen because it is much more descriptive than "TOON" or "CN").
+
</pre></code>
* If the above doesn't apply (for non-US stations, for example), choose an appropriate convention and document it here.
+
for all the users that can run MythTV as well.
  
Test your changes by running:
+
==Storage Group Location==
 +
As of 0.25, there is support for using [[Storage Groups]] for access to the icons.
  
  ./build_map.pl
+
To use storage groups for channel icons, you will need to create a new storage group named ''ChannelIcons''. Move your icons to that location. You should then go into ''mythtv-setup'' and remove the absolute paths, leaving just the filenames.
  
from the master_iconmap directory to incorporate your changes into the master_iconmap.xml file.  Then, '''as the user who runs the mythfrontend program''', run (again, from the master_iconmap directory):
+
It is important to understand that this support is not yet feature complete, as both ''mythfilldatabase'' and ''mythtv-setup'' still download icons to the ''~/.mythtv/channels/'' directory, and attempt to retrieve them from that location, but if you run the applications on the same machine as the storage group is located, you can create a link from ''~/.mythtv/channels/'' to the storage group location as a mitigation.  Also, ''mythweb'' does not use storage groups for accessing the icons.
  
  mythfilldatabase --reset-icon-map all
+
=Channel Icon Sources=
 +
One of the best sources of channel icons is http://www.lyngsat-logo.com/ . There, you can browse the available icons and choose those appropriate for your system.  However, doing so can be a lot of work (requiring many page hits and a lot of time).  Once downloaded you should put the resulting JPEG files into ''.mythtv/channels/'' for the user running the front-end.  To add them to a channel you will need to run ''mythtv-setup'' and go to the channel editor and specify the icon file name for each channel.
  
to clear your current channel icons and
+
Another source of channel icons is http://www.iconharmony.com/ which is targeted for icons for the harmony remote.  Some of the available icons are more stylized than the official icon (the person running the site is a graphic artist).  As with the previous source, finding an appropriate icon can be a lot of work.
  
mythfilldatabase --import-icon-map master_iconmap.xml --update-icon-map
+
==International Channel Logos==
 +
* [https://ash.ms/projects/channels Australia]
 +
* [http://www.documentjes.nl/linux/mythtv/icons/ Netherlands]
  
to import icons using the updated master_iconmap.xml file (which now contains your changes).  At this point, verify all your channels have icons.  Note that if you check for icons with MythWeb, you'll have to delete MythWeb's icon cache with the following (change path as appropriate).
+
[[Category:HOWTO]]
 
+
rm /var/www/htdocs/mythtv/data/tv_icons/*
+
 
+
Once everything looks good, run
+
 
+
svn diff data > ~/master_iconmap-sky.patch
+
 
+
from the master_iconmap directory to create a patch for Trac.  See http://svn.mythtv.org/trac/ticket/2365 for an example patch (look at the newest patch on the ticket--the first one was for a very different (and harder to edit) style).
+

Revision as of 16:31, 28 September 2013

Channel Icon Download System

As of 0.21, MythTV includes a channel icon download system in mythtv-setup which will attempt to automatically download icons for channels in your database from services.mythtv.org. If it cannot find an icon it will present you with a list of options, an the ability to define your own search parameters.

To configure icon downloading in mythtv-setup:

  • run "mythtv-setup"
  • select "Channel Editor"
  • click on "Icon Download"
  • select either "Download all icons.." or "Rescan for missing icons.."


Universal Location

Starting with version 0.27, a single location for channel icons can be created on the master backend. The only symlink required is for mythweb. Remove it's .../data/tv_icons directory and link it to the chosen single directory. Make sure that the directory has read/write permissions for user mythtv and choose the same group that is used by mythweb, e.g. www-data. Make the new single location directory's mode 775.

Symlinks added for prior versions (or old channels/ChannelIcons directories and their contents) can be removed. Obviously after copying icons to a new directory as required.

If a ChannelIcons Storage Group doesn't already exist, follow the 1st 2 paragraphs in the Storage Group Location below. Then restart the backend then frontends.

Note, the Services API <backend>:6544/Guide/GetChannelIcon endpoint does not work with this feature. There is a patch for the problem at #11865.

Pre 0.27 Instructions

By default the icon will be downloaded to the /home/<user>/.mythtv/channels directory. This is not very friendly when you have multiple frontends and wish them all to share the icons. One method to get around this is to use a symlink for this directory that directs to a network located directory that all your frontends have access to, say /var/mythtv/channels for example.

Before downloading the icons, do the following, or similar as per your distribution:

rm ~/.mythtv/channels -rf
sudo mkdir /var/mythtv/channels
sudo chown <user>:<group> /var/mythtv/channels
ln -s /var/mythtv/channels ~/.mythtv/channels

You will want to run

rm ~/.mythtv/channels -rf
ln -s /var/mythtv/channels ~/.mythtv/channels

for all the users that can run MythTV as well.

Storage Group Location

As of 0.25, there is support for using Storage Groups for access to the icons.

To use storage groups for channel icons, you will need to create a new storage group named ChannelIcons. Move your icons to that location. You should then go into mythtv-setup and remove the absolute paths, leaving just the filenames.

It is important to understand that this support is not yet feature complete, as both mythfilldatabase and mythtv-setup still download icons to the ~/.mythtv/channels/ directory, and attempt to retrieve them from that location, but if you run the applications on the same machine as the storage group is located, you can create a link from ~/.mythtv/channels/ to the storage group location as a mitigation. Also, mythweb does not use storage groups for accessing the icons.

Channel Icon Sources

One of the best sources of channel icons is http://www.lyngsat-logo.com/ . There, you can browse the available icons and choose those appropriate for your system. However, doing so can be a lot of work (requiring many page hits and a lot of time). Once downloaded you should put the resulting JPEG files into .mythtv/channels/ for the user running the front-end. To add them to a channel you will need to run mythtv-setup and go to the channel editor and specify the icon file name for each channel.

Another source of channel icons is http://www.iconharmony.com/ which is targeted for icons for the harmony remote. Some of the available icons are more stylized than the official icon (the person running the site is a graphic artist). As with the previous source, finding an appropriate icon can be a lot of work.

International Channel Logos