1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-02-04 17:42:22 +05:30

feat: added support for multiple audio stream selection in combine mode

This commit is contained in:
2026-01-19 20:36:50 +05:30
Verified
parent 4e5a4a1c73
commit 04590d892d
10 changed files with 261 additions and 87 deletions

View File

@@ -48,11 +48,11 @@ export default function DownloaderPage() {
const selectedDownloadFormat = useDownloaderPageStatesStore((state) => state.selectedDownloadFormat);
const selectedCombinableVideoFormat = useDownloaderPageStatesStore((state) => state.selectedCombinableVideoFormat);
const selectedCombinableAudioFormat = useDownloaderPageStatesStore((state) => state.selectedCombinableAudioFormat);
const selectedCombinableAudioFormats = useDownloaderPageStatesStore((state) => state.selectedCombinableAudioFormats);
const selectedPlaylistVideos = useDownloaderPageStatesStore((state) => state.selectedPlaylistVideos);
const setSelectedDownloadFormat = useDownloaderPageStatesStore((state) => state.setSelectedDownloadFormat);
const setSelectedCombinableVideoFormat = useDownloaderPageStatesStore((state) => state.setSelectedCombinableVideoFormat);
const setSelectedCombinableAudioFormat = useDownloaderPageStatesStore((state) => state.setSelectedCombinableAudioFormat);
const setSelectedCombinableAudioFormats = useDownloaderPageStatesStore((state) => state.setSelectedCombinableAudioFormats);
const setSelectedSubtitles = useDownloaderPageStatesStore((state) => state.setSelectedSubtitles);
const setSelectedPlaylistVideos = useDownloaderPageStatesStore((state) => state.setSelectedPlaylistVideos);
const resetDownloadConfiguration = useDownloaderPageStatesStore((state) => state.resetDownloadConfiguration);
@@ -126,14 +126,14 @@ export default function DownloaderPage() {
);
}
})();
const selectedAudioFormat = (() => {
const selectedAudioFormats = (() => {
if (videoMetadata?._type === 'video') {
return allFilteredFormats.find(
(format) => format.format_id === selectedCombinableAudioFormat
return allFilteredFormats.filter(
(format) => selectedCombinableAudioFormats.includes(format.format_id)
);
} else if (videoMetadata?._type === 'playlist') {
return allFilteredFormats.find(
(format) => format.format_id === selectedCombinableAudioFormat
return allFilteredFormats.filter(
(format) => selectedCombinableAudioFormats.includes(format.format_id)
);
}
})();
@@ -186,7 +186,7 @@ export default function DownloaderPage() {
setIsMetadataLoading(true);
setSelectedDownloadFormat('best');
setSelectedCombinableVideoFormat('');
setSelectedCombinableAudioFormat('');
setSelectedCombinableAudioFormats([]);
setSelectedSubtitles([]);
setSelectedPlaylistVideos(["1"]);
resetDownloadConfiguration();
@@ -391,7 +391,7 @@ export default function DownloaderPage() {
selectedFormat={selectedFormat}
selectedFormatFileType={selectedFormatFileType}
selectedVideoFormat={selectedVideoFormat}
selectedAudioFormat={selectedAudioFormat}
selectedAudioFormats={selectedAudioFormats}
containerRef={containerRef}
/>
)}