mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
7a61d50c42
Pull the ~300 LOC URL → PlayInput dispatch out of audio_play into a new audio/play_input.rs: - PlayInput enum (Bytes / SeekableMedia / Streaming) - PlayInputContext struct holding the precomputed inputs (url, gen, duration_hint, format/cache hints, optional reused chained bytes) - select_play_input() async — handles all four branches: reused chained bytes, psysonic-local://, ranged HTTP with format sniff, and the legacy non-seekable streaming fallback - url_format_hint() — the conservative URL→extension allowlist helper, used to be inline in audio_play audio_play is now focused on the orchestration above the source layer: ghost-command guard, gapless pre-chain detection, bumping generation, loudness/replay-gain math, fade-in setup, building the actual rodio Source pipeline, sink swap with crossfade, spawning progress task. audio/commands.rs: 980 → 676 LOC. play_input.rs: 385 LOC. Behaviour preservation hinges on identical analysis-seed spawning, format-hint fallback chain, range-detection logic, and gen-cancel checks — all moved verbatim. Smoke test focus: psysonic-local playback, manual skip during ranged HTTP, format-hint-less servers (legacy fallback path), preload cache hit replay, manual skip onto pre-chained track.