Skip to main content

spoolframe_types/
lib.rs

1//! The types every Spoolframe client sees: the media model and its
2//! identifiers.
3//!
4//! These are Spoolframe's own models, not Plex's. Plex is a source of
5//! metadata behind the server; these types do not depend on it.
6//!
7//! Permissively licensed (MIT OR Apache-2.0) so that any client, open or
8//! proprietary, can link it. It never depends on an AGPL server crate.
9
10pub mod browse;
11pub mod capabilities;
12pub mod codec;
13pub mod codec_string;
14pub mod date;
15mod duration_ms;
16pub mod id;
17pub mod language;
18pub mod media;
19pub mod model;
20pub mod platform;
21pub mod preferences;
22pub mod required;
23pub mod role;
24pub mod search;
25#[cfg(test)]
26mod test_support;
27#[cfg(feature = "uniffi")]
28mod uniffi_types;
29
30#[cfg(feature = "uniffi")]
31uniffi::setup_scaffolding!();
32
33pub use browse::{
34    Counted, DynamicRange, FilterPart, FilterValue, ItemFilter, ItemFilterValues, ItemQuery,
35    ItemSort, Resolution, SortKey, WatchedState,
36};
37pub use capabilities::{CodecProbe, Decoders, candidate_codec_strings};
38pub use codec::{
39    AudioCodec, ClientCapabilities, Container, Delivery, DisplayCapabilities, HdrFormat,
40    SubtitleFormat, VideoCodec, VideoLimits,
41};
42pub use codec_string::{CodecString, CodecStringError, Tier};
43pub use date::{CalendarDate, DateError};
44pub use id::{ArtworkId, IdError, LibraryId, MediaId, MediaKind, Namespace, PersonId};
45pub use media::{
46    AudioRole, AudioTrack, MediaTracks, QuotaOf, SubtitleDownload, SubtitleDownloaded,
47    SubtitleOrigin, SubtitleResult, SubtitleRole, SubtitleSearch, SubtitleSource,
48    SubtitleSourceState, SubtitleSourceStatus, SubtitleSync, SubtitleTiming, SubtitleTrack,
49    VideoTrack,
50};
51pub use model::{
52    Album, Artist, Artwork, ArtworkKind, Caption, CastMember, Episode, Item, Library, LibraryKind,
53    LibraryServer, Marker, MarkerKind, Movie, PlaybackState, Progress, Season, Show, Track,
54    YearsAired,
55};
56pub use platform::Platform;
57pub use preferences::{
58    AudioPreferences, BitmapPreference, ForcedPreference, SdhPreference, SubtitleMode,
59    SubtitlePreferences, TrackPreferences,
60};
61pub use role::Role;
62pub use search::{Person, PersonRole, SearchKind, SearchScope};
63
64pub mod pin;
65
66/// Password syntax shared by clients and servers.
67pub mod password {
68    /// The fewest characters a new password may have.
69    pub const MIN_CHARS: usize = 8;
70}
71
72/// The domain every server's app passkeys are made under: a server's
73/// relying party is `<server id>.spoolframe.app`. Every client and the
74/// admin API use this one value.
75pub const APP_RP_DOMAIN: &str = "spoolframe.app";