fix(downloads,playback): re-encode undecodable audio and carry the media source through

Work from a parallel session in the same working tree, committed here so the
branch is not left half-written. Attribution note: authored in a concurrent
Claude session, not by the author of the preceding commit.

- DR-171: a downloaded video keeps audio the device can actually decode.
  `original` quality asked for a straight copy, so an E-AC-3/AC-3/DTS/TrueHD
  track came down untouched and the webview had nothing to play it with.
- `get_video_download_url` gains the media source, so the URL is built against
  the source actually chosen rather than the item's default.
- Device profile and repository plumbing updated to match.

Verified green as a whole: 656 Rust tests, 945 frontend tests, svelte-check clean.
This commit is contained in:
2026-08-15 23:54:00 +02:00
parent a5535f2941
commit ac4fccd499
10 changed files with 385 additions and 46 deletions
+3 -4
View File
@@ -631,8 +631,6 @@ pub async fn resume_queued_downloads(
) -> Result<ResumeQueuedResult, String> {
use crate::repository::MediaRepository;
use crate::repository::HybridRepository;
let repo = repository.0.get(&handle).ok_or("Repository not found")?;
// The pump needs a target_dir; use the same storage root the other download
@@ -683,12 +681,13 @@ pub async fn resume_queued_downloads(
async move {
if media_type == "video" {
Some(
<HybridRepository as MediaRepository>::get_video_download_url(
crate::repository::resolve_video_download_url(
repo.as_ref(),
&item_id,
&quality,
None,
),
)
.await,
)
} else {
match repo.get_audio_stream_url(&item_id).await {