From 3f739458cdceba4cf76def3944ef5fad8fee0445 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Fri, 24 Jun 2011 11:20:42 +0200 Subject: [PATCH] CC-2421 : Filename formatting tweaks padding track numbers with 1 leading zero if 0-9 formatting bitrate 128000 as 128kbps --- .../airtimefilemonitor/airtimeprocessevent.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py index 7673daee8..c7dba42e6 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimeprocessevent.py @@ -166,6 +166,13 @@ class AirtimeProcessEvent(ProcessEvent): else: md[m] = orig_md[m] + #make sure all track numbers are at least 2 digits long in the filepath. + if len(str(md['MDATA_KEY_TRACKNUMBER'])) == 1: + md['MDATA_KEY_TRACKNUMBER'] = "0"+str(md['MDATA_KEY_TRACKNUMBER']) + + #format bitrate as 128kbps + md['MDATA_KEY_BITRATE'] = str(md['MDATA_KEY_BITRATE'])[0:3]+"kbps" + filepath = None #file is recorded by Airtime #/srv/airtime/stor/recorded/year/month/year-month-day-time-showname-bitrate.ext