CC-1799 : Live Studio Playout from media library (pytagsfs)

switching to using mutagen to get audio metadata (used by pytagsfs)
passing gunid of file to locate it in airtime
This commit is contained in:
Naomi 2011-04-27 13:36:30 -04:00 committed by martin
parent 90e0a739f5
commit 75d0229d39
1 changed files with 6 additions and 2 deletions

View File

@ -15,6 +15,8 @@ from configobj import ConfigObj
import pyinotify
from pyinotify import WatchManager, Notifier, ProcessEvent
import mutagen
from api_clients import api_client
# configure logging
@ -58,9 +60,11 @@ class MediaMonitor(ProcessEvent):
f = file(event.pathname, 'rb')
m = hashlib.md5()
m.update(f.read())
md5 = m.hexdigest()
md = {'filepath':event.pathname, 'md5':md5}
md5 = m.hexdigest()
gunid = event.name.split('.')[0]
md = {'gunid':gunid, 'md5':md5}
for tag in output.split("\n")[2:] :
key,value = tag.split("=")
md[key] = value