mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-11 22:29:36 +01:00
Merge pull request #1811 from piejanssens/Begall-renamer-origfolder
Add $OriginalFolder flag to renamer (thx Begall)
This commit is contained in:
@@ -948,7 +948,7 @@
|
||||
<div class="row">
|
||||
<label>Folder Format</label>
|
||||
<input type="text" name="folder_format" value="${config['folder_format']}" size="43">
|
||||
<small>Use: $Artist/$artist, $Album/$album, $Year/$year, $Type/$type (release type) and $First/$first (first letter in artist name)
|
||||
<small>Use: $Artist/$artist, $Album/$album, $Year/$year, $Type/$type (release type) and $First/$first (first letter in artist name), $OriginalFolder/$originalfolder (downloaded directory name)
|
||||
E.g.: $Type/$First/$artist/$album [$year] = Album/G/girl talk/all day [2010]</small>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -622,20 +622,27 @@ def moveFiles(albumpath, release, tracks):
|
||||
firstchar = '0-9'
|
||||
else:
|
||||
firstchar = sortname[0]
|
||||
|
||||
|
||||
for r,d,f in os.walk(albumpath):
|
||||
try:
|
||||
origfolder = os.path.basename(os.path.normpath(r))
|
||||
except:
|
||||
origfolder = ''
|
||||
|
||||
values = { '$Artist': artist,
|
||||
'$SortArtist': sortname,
|
||||
'$Album': album,
|
||||
'$Year': year,
|
||||
'$Type': releasetype,
|
||||
'$OriginalFolder': origfolder,
|
||||
'$First': firstchar.upper(),
|
||||
'$artist': artist.lower(),
|
||||
'$sortartist': sortname.lower(),
|
||||
'$album': album.lower(),
|
||||
'$year': year,
|
||||
'$type': releasetype.lower(),
|
||||
'$first': firstchar.lower()
|
||||
'$first': firstchar.lower(),
|
||||
'$originalfolder': origfolder.lower()
|
||||
}
|
||||
|
||||
folder = helpers.replace_all(headphones.FOLDER_FORMAT.strip(), values)
|
||||
|
||||
Reference in New Issue
Block a user