CC-2441 : media-monitor exception on import, cancels all importing

checking if file md fails.
This commit is contained in:
Naomi Aro 2011-06-28 14:34:16 +02:00
parent 4eff714f32
commit 164c06a5e5
3 changed files with 30 additions and 16 deletions

View file

@ -123,6 +123,8 @@ class AirtimeNotifier(Notifier):
if (os.path.exists(filepath) and (mode == self.config.MODE_CREATE)):
if file_md is None:
mutagen = self.md_manager.get_md_from_file(filepath)
if mutagen is None:
return
md.update(mutagen)
if d['is_recorded_show']:
@ -132,6 +134,8 @@ class AirtimeNotifier(Notifier):
elif (os.path.exists(filepath) and (mode == self.config.MODE_MODIFY)):
mutagen = self.md_manager.get_md_from_file(filepath)
if mutagen is None:
return
md.update(mutagen)
self.api_client.update_media_metadata(md, mode)
@ -163,5 +167,5 @@ class AirtimeNotifier(Notifier):
if mm.is_audio_file(full_filepath):
self.logger.info("importing %s", full_filepath)
event = {'filepath': full_filepath, 'mode': self.config.MODE_CREATE, 'is_recorded_show': False}
mm.file_events.put(event)
mm.multi_queue.put(event)