From 9d9d81bef36e041b521bfd8fe0b202bad46164b7 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Thu, 24 Sep 2026 20:38:32 -0400 Subject: [PATCH] fix(player): mpv draws all Linux video, and no longer runs text from a URL Security (DR-298, DR-299): - The pinned libmpv crate's Mpv::command joins its arguments and calls mpv_command_string, which parses `;` as a command separator. Stream URLs carry server-controlled ids and TranscodingUrl, and a download's file:// path carries its track title, so a crafted title could run any mpv command, `run` included. Every call now goes through mpv_command::command, an argv built for mpv_command. The same parse broke loadfile for every downloaded title containing a space. - mpv's tls-verify defaults to no, and its URLs carry the ApiKey. Every handle is now hardened with tls-verify=yes and ytdl=no before its first loadfile, and fails construction if it cannot be. Linux video (DR-235 phase 1): - native_video::enabled() is unconditional on Linux; the JELLYTAU_NATIVE_VIDEO opt-in is retired. No platform reports a webview video fallback, so the Settings switch no longer appears. Windows keeps the webview element until mpv reaches it (DR-237). - The Linux device profile is unchanged (still h264, DR-234), so this ships the configuration that was tested under the env var. --- CLAUDE.md | 13 +- docs/architecture/05-platform-backends.md | 9 +- docs/native-player-verification.md | 4 +- docs/requirements.md | 19 ++- docs/specs/desktop-native-video.md | 11 +- src-tauri/src/commands/player/mod.rs | 90 +++++------- src-tauri/src/lib.rs | 38 ++--- src-tauri/src/player/mod.rs | 2 + src-tauri/src/player/mpv_backend.rs | 30 ++-- src-tauri/src/player/mpv_command.rs | 161 ++++++++++++++++++++++ src-tauri/src/player/mpv_player.rs | 12 +- src-tauri/src/player/native_video.rs | 61 ++++---- src/lib/api/bindings.ts | 9 +- 13 files changed, 298 insertions(+), 161 deletions(-) create mode 100644 src-tauri/src/player/mpv_command.rs diff --git a/CLAUDE.md b/CLAUDE.md index 1312d5edf..17689ada6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,8 +2,8 @@ A cross-platform Jellyfin client. Business logic lives in a Rust backend (`src-tauri/`); a SvelteKit + TypeScript frontend (`src/`) handles presentation -and talks to it over Tauri v2 IPC. Targets **Linux** (libmpv, WebKitGTK HTML5 -`