implemented it in album.js

This commit is contained in:
cool.gitter.choco
2025-02-06 14:38:41 -06:00
parent 3eaea39c7f
commit 55610eb005

View File

@@ -194,7 +194,9 @@ async function startDownload(url, type, item, albumType) {
deezer = '',
spotifyQuality = 'NORMAL',
deezerQuality = 'MP3_128',
realTime = false
realTime = false,
customDirFormat = '',
customTrackFormat = ''
} = config;
const service = url.includes('open.spotify.com') ? 'spotify' : 'deezer';
@@ -220,6 +222,14 @@ async function startDownload(url, type, item, albumType) {
apiUrl += '&real_time=true';
}
// Append custom directory and file format settings if provided.
if (customDirFormat) {
apiUrl += `&custom_dir_format=${encodeURIComponent(customDirFormat)}`;
}
if (customTrackFormat) {
apiUrl += `&custom_file_format=${encodeURIComponent(customTrackFormat)}`;
}
try {
const response = await fetch(apiUrl);
const data = await response.json();