Skip to main content

## player_local_media_path

# Function player_local_media_path

Source

    pub async fn player_local_media_path(
        db: State<'_, DatabaseWrapper>,
        item_id: String,
    ) -> Result<Option<String>, String>

Expand description

The on-disk path for a downloaded item, for playback surfaces that resolve their own source rather than going through the queue.

The video player is the reason this exists: audio has preferred local files since queue construction, but video asks the repository for a stream URL and never consults `downloads`, so a downloaded film was still streamed — costing bandwidth that had already been spent and failing outright when offline.

Returns `None` when nothing is downloaded or the file is missing, so the caller falls back to streaming.

TRACES: UR-071 | DR-123 | UT-116