diff --git a/src/components/pages/settings/applicationSettings.tsx b/src/components/pages/settings/applicationSettings.tsx index ba77367..b0ea497 100644 --- a/src/components/pages/settings/applicationSettings.tsx +++ b/src/components/pages/settings/applicationSettings.tsx @@ -309,6 +309,7 @@ function AppFilesystemSettings() { const filenameTemplate = useSettingsPageStatesStore(state => state.settings.filename_template); const windowsFilenames = useSettingsPageStatesStore(state => state.settings.windows_filenames); const restrictFilenames = useSettingsPageStatesStore(state => state.settings.restrict_filenames); + const uniqueFilenames = useSettingsPageStatesStore(state => state.settings.unique_filenames); const downloadStates = useDownloadStatesStore(state => state.downloadStates); const ongoingDownloads = downloadStates.filter(state => @@ -462,6 +463,15 @@ function AppFilesystemSettings() { +
Make filenames unique by appending download ID, playlist index at the end of the filename (recommended, disabling it may cause issue with some downloads, also it may cause paused downloads to re-start from begining)
+Make filenames windows-compatible, allow only ASCII characters and replace spaces with underscore (recommended, disabling it may cause issue with some downloads, also it may cause paused downloads to re-start from begining)
diff --git a/src/helpers/use-downloader.ts b/src/helpers/use-downloader.ts index 19c7b20..49d48dc 100644 --- a/src/helpers/use-downloader.ts +++ b/src/helpers/use-downloader.ts @@ -74,7 +74,8 @@ export default function useDownloader() { disable_innertube: DISABLE_INNERTUBE, pot_server_port: POT_SERVER_PORT, windows_filenames: WINDOWS_FILENAMES, - restrict_filenames: RESTRICT_FILENAMES + restrict_filenames: RESTRICT_FILENAMES, + unique_filenames: UNIQUE_FILENAMES, } = useSettingsPageStatesStore(state => state.settings); const isRunningPotServer = useSettingsPageStatesStore(state => state.isRunningPotServer); @@ -349,9 +350,17 @@ export default function useDownloader() { } if (isMultiplePlaylistItems) { - args.push('--output', `%(playlist_title|Unknown)s[${downloadId}]/[%(playlist_index|0)d]_${FILENAME_TEMPLATE}.%(ext)s`); + if (UNIQUE_FILENAMES) { + args.push('--output', `%(playlist_title|Untitled)s[${downloadId}]/[%(playlist_index|0)d]_${FILENAME_TEMPLATE}.%(ext)s`); + } else { + args.push('--output', `%(playlist_title|Untitled)s/${FILENAME_TEMPLATE}.%(ext)s`); + } } else { - args.push('--output', `${FILENAME_TEMPLATE}[${downloadId}].%(ext)s`); + if (UNIQUE_FILENAMES) { + args.push('--output', `${FILENAME_TEMPLATE}[${downloadId}].%(ext)s`); + } else { + args.push('--output', `${FILENAME_TEMPLATE}.%(ext)s`); + } } if (WINDOWS_FILENAMES) { diff --git a/src/services/store.ts b/src/services/store.ts index 5f0f89a..888ae76 100644 --- a/src/services/store.ts +++ b/src/services/store.ts @@ -204,7 +204,7 @@ export const useSettingsPageStatesStore = create