Skip to content

Commit bcd91d5

Browse files
rdvwagnerrp
authored andcommitted
Fixed MiroBridge abort when Miro metadata has no video filename
Sometimes Miro metadata has no video filename. Skip and remove these invalid Miro items. (cherry picked from commit 57d0e8b)
1 parent bfa8451 commit bcd91d5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ def do_mythtv_getunwatched(self, line):
278278
if hasattr(it.get_parent(), u'url'):
279279
if filetypes.is_torrent_filename(it.get_parent().url):
280280
continue
281+
282+
# Any item without a proper file name needs to be removed as Miro metadata is corrupt
283+
if it.get_filename() == None:
284+
it.expire()
285+
self.statistics[u'Miro_videos_deleted']+=1
286+
logging.info(u'Unwatched video (%s) has been removed from Miro as item had no valid file name' % it.get_title())
287+
continue
288+
281289
self.printItems(it)
282290
self.videofiles.append(self._get_item_dict(it))
283291
if self.verbose:
@@ -304,6 +312,14 @@ def do_mythtv_getwatched(self, line):
304312
if hasattr(it.get_parent(), u'url'):
305313
if filetypes.is_torrent_filename(it.get_parent().url):
306314
continue
315+
316+
# Any item without a proper file name needs to be removed as Miro metadata is corrupt
317+
if it.get_filename() == None:
318+
it.expire()
319+
self.statistics[u'Miro_videos_deleted']+=1
320+
logging.info(u'Watched video (%s) has been removed from Miro as item had no valid file name' % it.get_title())
321+
continue
322+
307323
self.printItems(it)
308324
self.videofiles.append(self._get_item_dict(it))
309325
if self.verbose:

0 commit comments

Comments
 (0)