wrong interpretation of upnp searchable attribute

Bug #232650 reported by Frank Scholz
2
Affects Status Importance Assigned to Milestone
Moovida
Fix Released
Low
Philippe Normand

Bug Description

In [https://core.fluendo.com/elisa/trac/browser/trunk/extern/upnp/DIDLLite.py#L326 upnp/DIDLLite.py] the attribute 'searchable' is transformed into an int, which will result in an error as the server sends this as a boolean value - true, false, 1 or 0.[[BR]](See [http://upnp.org/specs/av/UPnP-av-SchemaFiles-20060531.zip UPnP Schema didl-lite-v2-20060531.xsd] line 180)

This could be a fix:
===================================================================
--- DIDLLite.py (Revision 658)
+++ DIDLLite.py (Arbeitskopie)
@@ -323,7 +323,8 @@
     def fromElement(self, elt):
         Object.fromElement(self, elt)
         self.childCount = int(elt.attrib.get('childCount','0'))
- self.searchable = int(elt.attrib.get('searchable','0'))
+ #self.searchable = int(elt.attrib.get('searchable','0'))
+ self.searchable = elt.attrib.get('searchable','0') in ['True','true','1']
         self.searchClass = []
         for child in elt.getchildren():
             if child.tag.endswith('createclass'):

Thx and Best Regards,[[BR]]
dev

Revision history for this message
Philippe Normand (philn) wrote :

(In [662]) * extern/upnp/DIDLLite.py:
        Fixed interpretation of upnp searchable attribute. Closes #95

Revision history for this message
Philippe Normand (philn) wrote :

Thank you for the patch!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.