CC-2589 : Create "organize" dir when upgrading
need to set correct permissions/owner for all files/dirs
This commit is contained in:
parent
533f218923
commit
31ba80e07b
|
@ -9,6 +9,7 @@ import json
|
|||
import ConfigParser
|
||||
import pwd
|
||||
import grp
|
||||
import subprocess
|
||||
|
||||
import os.path
|
||||
|
||||
|
@ -48,9 +49,14 @@ mmc.set_needed_file_permissions(organize_dir, True)
|
|||
pairs = []
|
||||
for root, dirs, files in os.walk(mmconfig.storage_directory):
|
||||
for f in files:
|
||||
#print os.path.join(root, f)
|
||||
#print mmc.organize_new_file(os.path.join(root, f))
|
||||
pair = os.path.join(root, f), mmc.organize_new_file(os.path.join(root, f))
|
||||
old_filepath = os.path.join(root, f)
|
||||
new_filepath = mmc.organize_new_file(os.path.join(root, f))
|
||||
pair = old_filepath, new_filepath
|
||||
pairs.append(pair)
|
||||
mmc.set_needed_file_permissions(new_filepath, False)
|
||||
|
||||
#need to set all the dirs in imported to be owned by www-data.
|
||||
command = "chown -R www-data " + stor_dir
|
||||
subprocess.call(command.split(" "))
|
||||
|
||||
print json.dumps(pairs)
|
||||
|
|
|
@ -179,10 +179,8 @@ class MediaMonitorCommon:
|
|||
else:
|
||||
md[m] = orig_md[m]
|
||||
|
||||
self.logger.debug(md['MDATA_KEY_TRACKNUMBER'])
|
||||
if 'MDATA_KEY_TRACKNUMBER' in orig_md:
|
||||
#make sure all track numbers are at least 2 digits long in the filepath.
|
||||
self.logger.debug("formatting track number")
|
||||
md['MDATA_KEY_TRACKNUMBER'] = "%02d" % (int(md['MDATA_KEY_TRACKNUMBER']))
|
||||
|
||||
#format bitrate as 128kbps
|
||||
|
|
Loading…
Reference in New Issue