summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorR.D. Vaughan <r.d.vaughan@rogers.com>2011-10-02 17:40:24 (GMT)
committer Raymond Wagner <rwagner@mythtv.org>2011-10-05 12:54:24 (GMT)
commit57d0e8b5ff02691a8765ab25c5a8aacc004b67d5 (patch)
treeb8df258269db4d1f8edb5feb969fbbb0607694f9
parentafbbb6e1d42725d2bdd2bedfdadb04c83196ef41 (diff)
Fixed MiroBridge abort when Miro metadata has no video filename
Sometimes Miro metadata has no video filename. Skip and remove these invalid Miro items.
-rw-r--r--mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py b/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py
index 0070c4a..b458f6c 100644
--- a/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py
+++ b/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py
@@ -278,6 +278,14 @@ class MiroInterpreter(cmd.Cmd):
if hasattr(it.get_parent(), u'url'):
if filetypes.is_torrent_filename(it.get_parent().url):
continue
+
+ # Any item without a proper file name needs to be removed as Miro metadata is corrupt
+ if it.get_filename() == None:
+ it.expire()
+ self.statistics[u'Miro_videos_deleted']+=1
+ logging.info(u'Unwatched video (%s) has been removed from Miro as item had no valid file name' % it.get_title())
+ continue
+
self.printItems(it)
self.videofiles.append(self._get_item_dict(it))
if self.verbose:
@@ -304,6 +312,14 @@ class MiroInterpreter(cmd.Cmd):
if hasattr(it.get_parent(), u'url'):
if filetypes.is_torrent_filename(it.get_parent().url):
continue
+
+ # Any item without a proper file name needs to be removed as Miro metadata is corrupt
+ if it.get_filename() == None:
+ it.expire()
+ self.statistics[u'Miro_videos_deleted']+=1
+ logging.info(u'Watched video (%s) has been removed from Miro as item had no valid file name' % it.get_title())
+ continue
+
self.printItems(it)
self.videofiles.append(self._get_item_dict(it))
if self.verbose: