Fix for variable renaming in post processor

This commit is contained in:
rembo10
2012-04-14 13:11:21 +05:30
parent ebf19914b4
commit f7a13e87a0
2 changed files with 50 additions and 20 deletions
+30
View File
@@ -361,6 +361,36 @@ def initialize():
FOLDER_FORMAT = replace_all(FOLDER_FORMAT, folder_values) FOLDER_FORMAT = replace_all(FOLDER_FORMAT, folder_values)
CONFIG_VERSION = '1' CONFIG_VERSION = '1'
if CONFIG_VERSION == '1':
from headphones.helpers import replace_all
file_values = { 'Track': '%Track%',
'Title': '%Title%',
'Artist': '%Artist%',
'Album': '%Album%',
'Year': '%Year%',
'track': '%track%',
'title': '%title%',
'artist': '%artist%',
'album': '%album%',
'year': '%year%'
}
folder_values = { 'Artist': '%Artist%',
'Album': '%Album%',
'Year': '%Year%',
'Type': '%Type%',
'First': '%First%',
'artist': '%artist%',
'album': '%album%',
'year': '%year%',
'type': '%type%',
'first': '%first%'
}
FILE_FORMAT = replace_all(FILE_FORMAT, file_values)
FOLDER_FORMAT = replace_all(FOLDER_FORMAT, folder_values)
CONFIG_VERSION = '2'
if not LOG_DIR: if not LOG_DIR:
LOG_DIR = os.path.join(DATA_DIR, 'logs') LOG_DIR = os.path.join(DATA_DIR, 'logs')
+20 -20
View File
@@ -329,16 +329,16 @@ def moveFiles(albumpath, release, tracks):
firstchar = sortname[0] firstchar = sortname[0]
values = { 'Artist': artist, values = { '%Artist%': artist,
'Album': album, '%Album%': album,
'Year': year, '%Year%': year,
'Type': releasetype, '%Type%': releasetype,
'First': firstchar, '%First%': firstchar,
'artist': artist.lower(), '%artist%': artist.lower(),
'album': album.lower(), '%album%': album.lower(),
'year': year, '%year%': year,
'type': releasetype.lower(), '%type%': releasetype.lower(),
'first': firstchar.lower() '%first%': firstchar.lower()
} }
@@ -504,16 +504,16 @@ def renameFiles(albumpath, downloaded_track_list, release):
else: else:
title = f.title title = f.title
values = { 'Track': tracknumber, values = { '%Track%': tracknumber,
'Title': title, '%Title%': title,
'Artist': release['ArtistName'], '%Artist%': release['ArtistName'],
'Album': release['AlbumTitle'], '%Album%': release['AlbumTitle'],
'Year': year, '%Year%': year,
'track': tracknumber, '%track%': tracknumber,
'title': title.lower(), '%title%': title.lower(),
'artist': release['ArtistName'].lower(), '%artist%': release['ArtistName'].lower(),
'album': release['AlbumTitle'].lower(), '%album%': release['AlbumTitle'].lower(),
'year': year '%year%': year
} }
ext = os.path.splitext(downloaded_track)[1] ext = os.path.splitext(downloaded_track)[1]