Dirk Meyer <[EMAIL PROTECTED]> writes:

> Hans-Jürgen Ficker wrote:
>> * Channel names provided by XMLTV can have spaces (e.g. "KABEL 1",
>>   "PRO 7", "RTL 2"). Since the channels in the favorites in
>>   recordserver.fxd are separated by spaces, favorites for thes
>>   channels don't work. Possible workarounds: (a) use a different
>>   separator (like ";"), (b) escape the space in the channel names,
>>   (c) use XML to separate the channel names from each other. Personally, I
>>   like (c) most. I already have a patch for it.
>
> c) sounds good, please send your patch.
>

Index: tvserver/src/favorite.py
===================================================================
--- tvserver/src/favorite.py	(revision 8516)
+++ tvserver/src/favorite.py	(working copy)
@@ -96,8 +96,9 @@
                 self.substring = True
             if child.name == 'channels':
                 self.channels = []
-                for v in child.content.split(' '):
-                    self.channels.append(v)
+                for s_node in child:
+                    if s_node.name == 'channel':
+                        self.channels.append(s_node.content)
             if child.name == 'days':
                 self.days = []
                 for v in child.content.split(' '):
@@ -232,12 +233,16 @@
         for var in ('name', 'priority', 'url', 'fxdname'):
             if getattr(self, var):
                 node.add_child(var, getattr(self, var))
-        for var in ('channels', 'days'):
-            s = ''
-            for v in getattr(self, var):
-                s += '%s ' % v
-            node.add_child(var, s[:-1])
+	ch_node = xml.Node('channels')
+	for v in self.channels:
+	    ch_node.add_child('channel', v);
+        node.add_child(ch_node)
+
         s = ''
+        for v in self.days:
+            s += '%s ' % v
+        node.add_child('days', s[:-1])
+        s = ''
         for v in self.times:
             s += '%02d:%02d-%02d:%02d ' % (v[0] / 100, v[0] % 100,
                                            v[1] / 100, v[1] % 100)
This patch puts each channel into it's own <channel></channel> tag
inside the <channels> section:

,----[ before ]
| <channels>SAT.1 PRO 7</channels>
`----

,----[ after ]
| <channels>
|   <channel>SAT.1</channel>
|   <channel>PRO 7</channel>
| <channels>
`----

Unfortunately, this requires manual changes of all favorites.


Best regards,
    Hans-Jürgen
-- 
A)bort, R)etry, I)nfluence with large hammer.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to