CC-2421 : Filename formatting tweaks

padding track numbers with 1 leading zero if 0-9

formatting bitrate 128000 as 128kbps
This commit is contained in:
Naomi Aro 2011-06-24 11:20:42 +02:00
parent fbf5f85509
commit 3f739458cd
1 changed files with 7 additions and 0 deletions

View File

@ -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