pub enum ResourceRequest {
Artwork {
request: ArtworkRequest,
max_bytes: u64,
},
Media {
request: MediaRead,
revision: u64,
},
Subtitle {
session: SessionId,
handle: PlaybackHandle,
revision: u64,
offset: u64,
version: Option<u64>,
},
SubtitleSegment {
session: SessionId,
handle: PlaybackHandle,
revision: u64,
segment: u32,
},
SetPlaylistArt {
session: SessionId,
id: String,
length: u64,
},
Download {
session: SessionId,
id: String,
offset: u64,
length: u64,
},
}Variants§
Artwork
Media
Subtitle
SubtitleSegment
SetPlaylistArt
Upload a cover for playlist id (spoolframe:playlist-art):
the only request whose stream goes on past it, with exactly
length bytes of a JPEG, PNG, WebP or HEIC picture. Answered
ready { length: 0, playlist_art { artwork } }, with no body.
Refused before the picture is read when the user may not edit the
playlist (NotAllowed) or length is past
crate::playlists::MAX_ART_BYTES (ImageTooLarge).
Download
Read download id’s file (spoolframe:downloads): at most
length bytes from offset, and no more than crate::MAX_READ.
Any offset may be asked, so a download broken off resumes where it
stopped. Answered ready { length, download { size } } with the
bytes; length is short only at the file’s end. NotFound for an
id that is not the session user’s; DownloadNotReady until its
state is ready. Not a playback: it takes no playback slot.