♻️ refactor stream detection and queue sync logic

- Replace `is_continuous_stream_url` with new canonical check using metadata + fallback
- Extract stream duration comparison logic to `queue::stream_duration_*` helpers  
- Improve queue sync concurrency: add worker loop, pending/cancel flags
- Make `stream_duration_*` functions public(crate) for reuse
This commit is contained in:
2026-04-12 20:17:05 +02:00
parent 8ddee7d94f
commit 82197c8103
6 changed files with 154 additions and 135 deletions

View File

@@ -19,7 +19,7 @@ use crate::{errors::ControlPointError, RendererInfo};
/// Returns true if `new_dur` < `old_dur` (both parseable as HH:MM:SS/MM:SS/SS).
/// Used to protect stream durations from decreasing for the same track.
pub(super) fn stream_duration_decreased(old_dur: &str, new_dur: &str) -> bool {
pub(crate) fn stream_duration_decreased(old_dur: &str, new_dur: &str) -> bool {
match (
parse_time_flexible(old_dur).ok(),
parse_time_flexible(new_dur).ok(),
@@ -30,7 +30,7 @@ pub(super) fn stream_duration_decreased(old_dur: &str, new_dur: &str) -> bool {
}
/// Returns true if `new_dur` > `old_dur` (both parseable as HH:MM:SS/MM:SS/SS).
pub(super) fn stream_duration_increased(old_dur: &str, new_dur: &str) -> bool {
pub(crate) fn stream_duration_increased(old_dur: &str, new_dur: &str) -> bool {
match (
parse_time_flexible(old_dur).ok(),
parse_time_flexible(new_dur).ok(),