Changed xxx-owner_id.mp3 to owner_id/xxx.mp3

This commit is contained in:
Rudi Grinberg 2012-09-14 14:27:04 -04:00
parent 6c759ea06c
commit 40bd5a0989
1 changed files with 3 additions and 3 deletions

View File

@ -275,6 +275,7 @@ def normalized_metadata(md, original_path):
if not is_airtime_recorded(new_md): if not is_airtime_recorded(new_md):
# Read title from filename if it does not exist # Read title from filename if it does not exist
default_title = no_extension_basename(original_path) default_title = no_extension_basename(original_path)
default_title = re.sub(r'__\d+\.',u'.', default_title)
if re.match(".+-%s-.+$" % unicode_unknown, default_title): if re.match(".+-%s-.+$" % unicode_unknown, default_title):
default_title = u'' default_title = u''
new_md = default_to(dictionary=new_md, keys=['MDATA_KEY_TITLE'], new_md = default_to(dictionary=new_md, keys=['MDATA_KEY_TITLE'],
@ -346,9 +347,8 @@ def organized_path(old_path, root_path, orig_md):
# nasty hack do this properly # nasty hack do this properly
if normal_md['MDATA_KEY_OWNER_ID'] != -1: if normal_md['MDATA_KEY_OWNER_ID'] != -1:
p, e = no_extension_basename(filepath), extension(filepath) p, e = no_extension_basename(filepath), extension(filepath)
filepath = os.path.join( filepath = os.path.join( unicode(normal_md['MDATA_KEY_OWNER_ID']),
os.path.dirname(filepath), filepath)
"%s__%s.%s" % (p, unicode(normal_md['MDATA_KEY_OWNER_ID']), e))
return filepath return filepath