<dd>If both a picon and a channel-specific (e.g. channelname.jpg) icon are defined, use the picon.</dd>
<dt>Channel icon path</dt>
- <dd>Path to an icon for this channel. This can be named however you wish, as a local (file://) or remote (http://) image.<br>
- Example: file:///tmp/icons/%C.png (where %C is the channel nameon local storage where
- is TVHeadend) or http://example.com/example.png to set icon from web page.</dd>
+ <dd>Path to an icon for this channel. This can be named however you wish, as a local (file://) or remote (http://) image.
+ The following placeholders are available:<br>
+ <ul>
+ <li>%C - the transliterated channel name in ASCII (safe characters, no spaces etc.)</li>
+ <li>%c - the channel name (URL encoded ASCII)</li>
+ </ul>
+ Example: file:///tmp/icons/%C.png or http://example.com/%c.png</dd>
<dt>Picon path</dt>
<dd>Path to a directory (folder) containing your picon collection. This can be named however
(chname = channel_get_name(ch)) != NULL && chname[0]) {
const char *chi, *send, *sname, *s;
chi = strdup(chicon);
- send = strstr(chi, "%C");
- if (send == NULL) {
- buf[0] = '\0';
- sname = "";
- } else {
- *(char *)send = '\0';
- send += 2;
+
+ /* Check for and replace placeholders */
+ if ((send = strstr(chi, "%C"))) {
sname = intlconv_utf8safestr(intlconv_charset_id("ASCII", 1, 1),
chname, strlen(chname) * 2);
if (sname == NULL)
sname = strdup(chname);
+
/* Remove problematic characters */
s = sname;
while (s && *s) {
s++;
}
}
+ else if((send = strstr(chi, "%c"))) {
+ char *aname = intlconv_utf8safestr(intlconv_charset_id("ASCII", 1, 1),
+ chname, strlen(chname) * 2);
+
+ if (aname == NULL)
+ aname = strdup(chname);
+
+ sname = url_encode(aname);
+ free((char *)aname);
+ }
+ else {
+ buf[0] = '\0';
+ sname = "";
+ }
+
+ if (send) {
+ *(char *)send = '\0';
+ send += 2;
+ }
+
snprintf(buf, sizeof(buf), "%s%s%s", chi, sname ?: "", send ?: "");
if (send)
free((char *)sname);
var chiconPath = new Ext.form.TextField({
name: 'chiconpath',
- fieldLabel: 'Channel icon path<br/>(e.g. file:///tmp/icons/%C.png or http://...)',
+ fieldLabel: 'Channel icon path (see Help)',
width: 400
});
var piconPath = new Ext.form.TextField({
name: 'piconpath',
- fieldLabel: 'Picon path<br/>(e.g. file:///tmp/picons or http://...)',
+ fieldLabel: 'Picon path (see Help)',
width: 400
});