CC-3428liquidsoap seems to have troubles with this file
-check file integrity before adding to library.
This commit is contained in:
parent
b9e840552b
commit
6e471c0060
2 changed files with 28 additions and 6 deletions
|
@ -1,12 +1,20 @@
|
|||
from mediaconfig import AirtimeMediaConfig
|
||||
import mediamonitorcommon
|
||||
|
||||
class MediaMonitorWorkerProcess:
|
||||
|
||||
#this function is run in its own process, and continuously
|
||||
#checks the queue for any new file events.
|
||||
def process_file_events(self, queue, notifier):
|
||||
|
||||
while True:
|
||||
event = queue.get()
|
||||
notifier.logger.info("received event %s", event)
|
||||
notifier.update_airtime(event)
|
||||
|
||||
|
||||
try:
|
||||
event = queue.get()
|
||||
if event['mode'] == AirtimeMediaConfig.MODE_CREATE:
|
||||
filepath = event['filepath']
|
||||
if mediamonitorcommon.test_file_playability(filepath):
|
||||
notifier.logger.info("received event %s", event)
|
||||
notifier.update_airtime(event)
|
||||
else:
|
||||
notifier.logger.warn("Liquidsoap integrity check for file at %s failed. Not adding to media library.", filepath)
|
||||
except Exception, e:
|
||||
notifier.logger.error(e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue