Added a toggle to choose between using Artist property or AlbumArtist property for folder name (#169)
* Corrected function call to correctly download albums vs playlists * Added setting to prefer AlbumArtist as folder name. - In practice, this prevents albums with multiple artists, featured artists, collaborations, or collections like soundtracks, from being split up - This is occasionally desirable behavior, so I added it as a toggle rather than a default behavior
This commit is contained in:
@@ -50,8 +50,13 @@ export function useDownload() {
|
||||
// Replace forward slashes in template data values to prevent them from being interpreted as path separators
|
||||
const placeholder = "__SLASH_PLACEHOLDER__";
|
||||
// Build template data for folder path
|
||||
let artistFolderName = artistName;
|
||||
if(settings.useAlbumArtist) {
|
||||
artistFolderName = albumArtist || artistName;
|
||||
}
|
||||
logger.info("Using artist folder name: " + artistFolderName);
|
||||
const templateData: TemplateData = {
|
||||
artist: artistName?.replace(/\//g, placeholder),
|
||||
artist: artistFolderName?.replace(/\//g, placeholder),
|
||||
album: albumName?.replace(/\//g, placeholder),
|
||||
title: trackName?.replace(/\//g, placeholder),
|
||||
track: position,
|
||||
@@ -296,11 +301,15 @@ export function useDownload() {
|
||||
|
||||
let outputDir = settings.downloadPath;
|
||||
let useAlbumTrackNumber = false;
|
||||
|
||||
let artistFolderName = artistName;
|
||||
if(settings.useAlbumArtist) {
|
||||
artistFolderName = albumArtist || artistName;
|
||||
}
|
||||
logger.info("Using artist folder name: " + artistFolderName);
|
||||
// Replace forward slashes in template data values to prevent them from being interpreted as path separators
|
||||
const placeholder = "__SLASH_PLACEHOLDER__";
|
||||
const templateData: TemplateData = {
|
||||
artist: artistName?.replace(/\//g, placeholder),
|
||||
artist: artistFolderName?.replace(/\//g, placeholder),
|
||||
album: albumName?.replace(/\//g, placeholder),
|
||||
title: trackName?.replace(/\//g, placeholder),
|
||||
track: position,
|
||||
|
||||
Reference in New Issue
Block a user