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:
parent
5bd82cd3d7
commit
5ba7679284
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue