Skip to main content

resolve_local_media_path

Function resolve_local_media_path 

Source
pub(super) async fn resolve_local_media_path<S: DatabaseService>(
    db_service: &Arc<S>,
    item_id: &str,
) -> Result<Option<String>, String>
Expand description

Resolve the on-disk file backing a completed download, if there is one.

A downloads row is not proof of a file: it can outlive the bytes (manual deletion, a cleared cache directory, a restored database). Every caller wants “can I play this from disk right now”, so existence is checked here rather than trusted from the row.

Split out from check_for_local_download so the resolution is testable without a DatabaseWrapper, and reusable by the video path.

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