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

View File

@@ -361,6 +361,36 @@ def initialize():
FOLDER_FORMAT = replace_all(FOLDER_FORMAT, folder_values)
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:
LOG_DIR = os.path.join(DATA_DIR, 'logs')

View File

@@ -329,16 +329,16 @@ def moveFiles(albumpath, release, tracks):
firstchar = sortname[0]
values = { 'Artist': artist,
'Album': album,
'Year': year,
'Type': releasetype,
'First': firstchar,
'artist': artist.lower(),
'album': album.lower(),
'year': year,
'type': releasetype.lower(),
'first': firstchar.lower()
values = { '%Artist%': artist,
'%Album%': album,
'%Year%': year,
'%Type%': releasetype,
'%First%': firstchar,
'%artist%': artist.lower(),
'%album%': album.lower(),
'%year%': year,
'%type%': releasetype.lower(),
'%first%': firstchar.lower()
}
@@ -504,16 +504,16 @@ def renameFiles(albumpath, downloaded_track_list, release):
else:
title = f.title
values = { 'Track': tracknumber,
'Title': title,
'Artist': release['ArtistName'],
'Album': release['AlbumTitle'],
'Year': year,
'track': tracknumber,
'title': title.lower(),
'artist': release['ArtistName'].lower(),
'album': release['AlbumTitle'].lower(),
'year': year
values = { '%Track%': tracknumber,
'%Title%': title,
'%Artist%': release['ArtistName'],
'%Album%': release['AlbumTitle'],
'%Year%': year,
'%track%': tracknumber,
'%title%': title.lower(),
'%artist%': release['ArtistName'].lower(),
'%album%': release['AlbumTitle'].lower(),
'%year%': year
}
ext = os.path.splitext(downloaded_track)[1]