fix(downloads): preserve audio track selection for offline playback

This commit is contained in:
Fredrik Burmester
2026-01-08 21:32:22 +01:00
parent 51ecde1565
commit d1387ec725
7 changed files with 146 additions and 6 deletions

View File

@@ -236,11 +236,23 @@ export const DownloadItems: React.FC<DownloadProps> = ({
);
continue;
}
// Get the audio/subtitle indices that were used for this download
const downloadAudioIndex =
itemsNotDownloaded.length > 1
? getDefaultPlaySettings(item, settings!).audioIndex
: selectedOptions?.audioIndex;
const downloadSubtitleIndex =
itemsNotDownloaded.length > 1
? getDefaultPlaySettings(item, settings!).subtitleIndex
: selectedOptions?.subtitleIndex;
await startBackgroundDownload(
url,
item,
mediaSource,
selectedOptions?.bitrate || defaultBitrate,
downloadAudioIndex,
downloadSubtitleIndex,
);
}
},