Skip to main content

enqueue_playback_stopped

Function enqueue_playback_stopped 

Source
pub async fn enqueue_playback_stopped(
    db: &Arc<RusqliteService>,
    user_id: &str,
    item_id: &str,
    position_ticks: i64,
) -> Result<(), String>
Expand description

Queue a watch position that could not be reported to the server.

The stop-report path pushed straight to the server and, on failure, logged and dropped the position — so closing a video while the server was unreachable lost the resume point outright, even though the queue and its drain (DR-131) were built and running. This is the missing producer.

The pending row for an item is replaced rather than appended to. Progress is reported every 10s, so a server that stays down would otherwise grow one row per tick, all of them superseded by the newest — the unbounded queue DR-131 exists to prevent. Only pending/failed rows are superseded: an abandoned row has been given up on and must not be revived, and a completed one is history.

TRACES: UR-025 | DR-154 | UT-151