Skip to content

Commit

Permalink
Fixed MiroBridge abort when Miro metadata has no video filename
Browse files Browse the repository at this point in the history
Sometimes Miro metadata has no video filename. Skip and remove these
invalid Miro items.
(cherry picked from commit 57d0e8b)
  • Loading branch information
rdv authored and wagnerrp committed Oct 5, 2011
1 parent c8c1582 commit 5e3c81f
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -278,6 +278,14 @@ def do_mythtv_getunwatched(self, line):
if hasattr(it.get_parent(), u'url'): if hasattr(it.get_parent(), u'url'):
if filetypes.is_torrent_filename(it.get_parent().url): if filetypes.is_torrent_filename(it.get_parent().url):
continue 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.printItems(it)
self.videofiles.append(self._get_item_dict(it)) self.videofiles.append(self._get_item_dict(it))
if self.verbose: if self.verbose:
Expand All @@ -304,6 +312,14 @@ def do_mythtv_getwatched(self, line):
if hasattr(it.get_parent(), u'url'): if hasattr(it.get_parent(), u'url'):
if filetypes.is_torrent_filename(it.get_parent().url): if filetypes.is_torrent_filename(it.get_parent().url):
continue 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.printItems(it)
self.videofiles.append(self._get_item_dict(it)) self.videofiles.append(self._get_item_dict(it))
if self.verbose: if self.verbose:
Expand Down

0 comments on commit 5e3c81f

Please sign in to comment.