CC-3789: Need to place rejected files into /problem_files directory

-test liquidsoap playability before organizing file
This commit is contained in:
Martin Konecny 2012-05-09 22:03:58 -04:00
parent aeb9db95f0
commit a56755ed47
3 changed files with 93 additions and 66 deletions

View file

@ -15,16 +15,7 @@ class MediaMonitorWorkerProcess:
try:
event = queue.get()
notifier.logger.info("received event %s", event)
if event['mode'] == AirtimeMediaConfig.MODE_CREATE:
filepath = event['filepath']
if self.mmc.test_file_playability(filepath):
notifier.update_airtime(event)
else:
notifier.logger.warn("Liquidsoap integrity check for file at %s failed. Not adding to media library.", filepath)
if self.config.storage_directory in filepath:
self.mmc.move_file(filepath, os.path.join(self.config.problem_directory, os.path.basename(filepath)))
else:
notifier.update_airtime(event)
notifier.update_airtime(event)
except Exception, e:
notifier.logger.error(e)
notifier.logger.error("traceback: %s", traceback.format_exc())