Skip to main content

Module persistence

Module persistence 

Source
Expand description

Download file I/O helpers: partial file detection, stream-to-disk writing, cover art fetch.

Constants§

DOWNLOAD_RETRY_BASE_DELAY_MS
Base delay in milliseconds for download retry exponential backoff.
MAX_DOWNLOAD_RETRIES
Maximum number of retry attempts on download network errors.

Functions§

attempt_download
Performs a single download attempt, optionally resuming from a partial file.
detect_partial_file
Detects whether a partial file exists on disk with non-zero size.
is_retryable_network_error
Checks whether an error is a transient network failure worth retrying.
save_track_to_disk
Saves a streaming response to disk with formatted filename.
write_response_to_file
Writes a streaming HTTP response to a file, optionally appending.