From a06f87f5f6cd9dac872344c0bcb31da763ceb78a Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 5 Jul 2026 06:08:44 +0200 Subject: [PATCH] feat(plex): P2 subtitle + audio track selector (closes P2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backend: item detail returns audio_streams + subtitle_streams (from Plex Part.Stream ordinals). The HLS session accepts audio/subtitle stream ordinals — the selected audio is mapped (transcoded to AAC), a selected subtitle is muxed in as a WebVTT rendition via a MASTER playlist (-master_pl_name + -var_stream_map sgroup:subs) so ffmpeg keeps it in sync per-session. Selecting a track forces the HLS path (even for direct files). Generic /stream/{rk}/hls/{filename} endpoint serves the master/media/vtt/ts artifacts. Frontend: gear menu lists real audio + subtitle tracks; changing one restarts the session at the current position (seek-restart mechanism). hls.js subtitle enabled on SUBTITLE_TRACKS_UPDATED (not just MANIFEST_PARSED, else the VTT is never fetched). Cues auto-nudged to line 88% (the full-height