diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 37c6a4ef..d5df9e61 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -948,7 +948,7 @@
- Use: $Artist/$artist, $Album/$album, $Year/$year, $Type/$type (release type) and $First/$first (first letter in artist name) + 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]
diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 8e378551..f9be079f 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -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)