From aee2446d551ac519795cf0a04041499e3054f1cd Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 19 Aug 2022 18:12:35 +0200 Subject: [PATCH] Added %today% on playlist folder template --- deemix/utils/pathtemplates.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deemix/utils/pathtemplates.js b/deemix/utils/pathtemplates.js index 1b0ba48..52a55eb 100644 --- a/deemix/utils/pathtemplates.js +++ b/deemix/utils/pathtemplates.js @@ -1,4 +1,5 @@ const { TrackFormats } = require('deezer-js') +const { Date: dzDate } = require('../types/Date.js') const bitrateLabels = { [TrackFormats.MP4_RA3]: "360 HQ", @@ -222,6 +223,8 @@ function generateArtistName(foldername, artist, settings, rootArtist){ function generatePlaylistName(foldername, playlist, settings){ let c = settings['illegalCharacterReplacer'] + let today = new Date() + let today_dz = new dzDate(String(today.getDate()).padStart(2, '0'), String(today.getMonth()+1).padStart(2, '0'), String(today.getFullYear())) foldername = foldername.replaceAll("%playlist%", fixName(playlist.title, c)) foldername = foldername.replaceAll("%playlist_id%", fixName(playlist.playlistID, c)) foldername = foldername.replaceAll("%owner%", fixName(playlist.owner['name'], c)) @@ -229,6 +232,7 @@ function generatePlaylistName(foldername, playlist, settings){ foldername = foldername.replaceAll("%year%", playlist.date.year) foldername = foldername.replaceAll("%date%", playlist.dateString) foldername = foldername.replaceAll("%explicit%", playlist.explicit ? "(Explicit)" : "") + foldername = foldername.replaceAll("%today%", today_dz.format(settings['dateFormat'])) foldername = foldername.replaceAll('\\', '/') return antiDot(fixLongName(foldername)) }