summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Wagner <rwagner@mythtv.org>2011-10-30 01:59:15 (GMT)
committer Raymond Wagner <rwagner@mythtv.org>2011-10-30 01:59:15 (GMT)
commit15b0ffc383b87173708ccd867e0f0fdddceec4da (patch)
tree0e19b451c44bc89edb17ed6f7c6a9959bf73c2a5
parent5f926eab4b817480e8f252444ff4452658538d40 (diff)
Allow bad Metadata tags to be bypassed
This is in response to a change in the TMDb API that resulted in the grabber returning bad data for the 'lastupdated' field. If a field returns bad data, skip over it and continue processing the rest of the result.
-rw-r--r--mythtv/bindings/python/MythTV/system.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/mythtv/bindings/python/MythTV/system.py b/mythtv/bindings/python/MythTV/system.py
index 380f1b9..0e4bd81 100644
--- a/mythtv/bindings/python/MythTV/system.py
+++ b/mythtv/bindings/python/MythTV/system.py
@@ -222,16 +222,18 @@ class Metadata( DictData ):
def _process(self, xml):
for element in xml.getchildren():
- if element.tag in self:
- if (element.text == '') or (element.text is None):
- self[element.tag] = None
- else:
- self[element.tag] = \
- self._trans[self._global_type[element.tag]]\
- (element.text)
- if element.tag in self._groups:
- self.__dict__[element.tag] = \
- getattr(self, element.tag.capitalize())(element)
+ try:
+ if element.tag in self:
+ if (element.text == '') or (element.text is None):
+ self[element.tag] = None
+ else:
+ self[element.tag] = \
+ self._trans[self._global_type[element.tag]]\
+ (element.text)
+ elif element.tag in self._groups:
+ self.__dict__[element.tag] = \
+ getattr(self, element.tag.capitalize())(element)
+ except: pass
def toXML(self):
eroot = etree.Element('item')