Skip to main content

Crate spoolframe_types

Crate spoolframe_types 

Source
Expand description

The types every Spoolframe client sees: the media model and its identifiers.

These are Spoolframe’s own models, not Plex’s. Plex is a source of metadata behind the server; these types do not depend on it.

Permissively licensed (MIT OR Apache-2.0) so that any client, open or proprietary, can link it. It never depends on an AGPL server crate.

Re-exports§

pub use browse::Counted;
pub use browse::DynamicRange;
pub use browse::FilterPart;
pub use browse::FilterValue;
pub use browse::ItemFilter;
pub use browse::ItemFilterValues;
pub use browse::ItemQuery;
pub use browse::ItemSort;
pub use browse::Resolution;
pub use browse::SortKey;
pub use browse::WatchedState;
pub use capabilities::CodecProbe;
pub use capabilities::Decoders;
pub use capabilities::candidate_codec_strings;
pub use codec::AudioCodec;
pub use codec::ClientCapabilities;
pub use codec::Container;
pub use codec::Delivery;
pub use codec::DisplayCapabilities;
pub use codec::HdrFormat;
pub use codec::SubtitleFormat;
pub use codec::VideoCodec;
pub use codec::VideoLimits;
pub use codec_string::CodecString;
pub use codec_string::CodecStringError;
pub use codec_string::Tier;
pub use date::CalendarDate;
pub use date::DateError;
pub use id::ArtworkId;
pub use id::IdError;
pub use id::LibraryId;
pub use id::MediaId;
pub use id::MediaKind;
pub use id::Namespace;
pub use id::PersonId;
pub use media::AudioRole;
pub use media::AudioTrack;
pub use media::MediaTracks;
pub use media::QuotaOf;
pub use media::SubtitleDownload;
pub use media::SubtitleDownloaded;
pub use media::SubtitleOrigin;
pub use media::SubtitleResult;
pub use media::SubtitleRole;
pub use media::SubtitleSearch;
pub use media::SubtitleSource;
pub use media::SubtitleSourceState;
pub use media::SubtitleSourceStatus;
pub use media::SubtitleSync;
pub use media::SubtitleTiming;
pub use media::SubtitleTrack;
pub use media::VideoTrack;
pub use model::Album;
pub use model::Artist;
pub use model::Artwork;
pub use model::ArtworkKind;
pub use model::Caption;
pub use model::CastMember;
pub use model::Episode;
pub use model::Item;
pub use model::Library;
pub use model::LibraryKind;
pub use model::LibraryServer;
pub use model::Marker;
pub use model::MarkerKind;
pub use model::Markers;
pub use model::MergeFacts;
pub use model::Movie;
pub use model::PlaybackState;
pub use model::Progress;
pub use model::Season;
pub use model::Show;
pub use model::Track;
pub use model::YearsAired;
pub use platform::Platform;
pub use preferences::AudioPreferences;
pub use preferences::BitmapPreference;
pub use preferences::ForcedPreference;
pub use preferences::RecentMoviesMode;
pub use preferences::RecentMusicMode;
pub use preferences::RecentShowsMode;
pub use preferences::RecentlyPlayedPreferences;
pub use preferences::SdhPreference;
pub use preferences::SubtitleMode;
pub use preferences::SubtitlePreferences;
pub use preferences::TrackPreferences;
pub use rating::RATING_SOURCE_FIELDS;
pub use rating::RatingProvider;
pub use rating::RatingScale;
pub use rating::RatingSource;
pub use rating::RatingState;
pub use role::Role;
pub use search::Person;
pub use search::PersonRole;
pub use search::SearchKind;
pub use search::SearchScope;

Modules§

browse
Sorting and filtering a library’s items: what a client asks Items to order and keep, and what a library has to filter by.
capabilities
Building ClientCapabilities the same way on every platform: from the decoders a device found (ClientCapabilities::from_decoders), or by asking its player codec string by codec string (ClientCapabilities::probe: Apple’s VideoToolbox, Android’s MediaCodecList, GStreamer), with the defaults every client set by hand: PCM always, range reads then progressive when nothing else is said, no height or bitrate limit, the screen’s HDR as the limit.
codec
The words server and client share for formats.
codec_string
RFC 6381 codec strings (hvc1.2.4.L153.B0, dvh1.08.06): a video stream’s codec with its profile, tier and level, as a player asks about it (Apple: AVURLAsset.isPlayableExtendedMIMEType).
date
A day on the calendar, with no time and no zone: when an episode first aired. On the wire it is "YYYY-MM-DD", so it reads the same in every time zone; a Unix time for a date shows the day before west of UTC.
id
Identifiers. On the wire each one is a namespaced string, for example plex:movie:12345.
language
Language codes as files write them: ISO 639-2 in streams (eng, and both ger and deu), often ISO 639-1 in subtitle file names (en). same_language treats all spellings of one language as equal.
media
What a client learns about a media file before it plays it: its length, what it is (container and picture, to show), and the tracks it can choose between.
model
The media model clients browse: libraries, and the movies, shows and music in them.
password
Password syntax shared by clients and servers.
pin
PIN syntax shared by clients and servers; authentication remains server-side.
platform
What kind of client a device runs: said in its Hello, kept per device by the server, and shown in device and session lists (“Linux app”, “Apple TV app”) in place of a bare “App”.
preferences
How a viewer wants tracks chosen. Kept per user on the server, so a TV and a laptop choose the same.
rating
Whose a rating is: Rotten Tomatoes’ Tomatometer, IMDb’s, TMDB’s (RatingSource, feature spoolframe:rating-sources), read from the catalog’s rating image (Plex’s ratingImage and audienceRatingImage, such as rottentomatoes://image.rating.ripe).
required
A required Option field: the key must be on the wire, with null for none.
role
A user’s role on a server: what clients and the web UI show and switch on.
search
What a search covers and how its results are grouped, and the people it finds.
serde_time
Times and spans on the wire, and in what the SDK keeps on disk, as one integer each, so every client language reads them without serde’s {secs, nanos} struct: #[serde(with = "serde_time::unix_seconds")] on a SystemTime, serde_time::millis on a Duration, and each one’s option on an Option. A field keeps its old wire name with rename (position_ms), so the wire and the stores do not change.
wire
The simple enums’ names on the wire, both ways, and every value an app offers: for an app that keeps a choice in its own settings, or reads one from a link, with the same names the server and the SDK use. No English labels: the apps word them.

Constants§

APP_RP_DOMAIN
The domain every server’s app passkeys are made under: a server’s relying party is <server id>.spoolframe.app. Every client and the admin API use this one value.