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;
15pub mod id;
16pub mod language;
17pub mod media;
18pub mod model;
19pub mod platform;
20pub mod preferences;
21pub mod required;
22pub mod role;
23pub mod search;
24pub mod serde_time;
25#[cfg(test)]
26mod test_support;
27#[cfg(feature = "uniffi")]
28mod uniffi_methods;
29#[cfg(feature = "uniffi")]
30mod uniffi_types;
31pub mod wire;
32
33#[cfg(feature = "uniffi")]
34uniffi::setup_scaffolding!();
35
36pub use browse::{
37    Counted, DynamicRange, FilterPart, FilterValue, ItemFilter, ItemFilterValues, ItemQuery,
38    ItemSort, Resolution, SortKey, WatchedState,
39};
40pub use capabilities::{CodecProbe, Decoders, candidate_codec_strings};
41pub use codec::{
42    AudioCodec, ClientCapabilities, Container, Delivery, DisplayCapabilities, HdrFormat,
43    SubtitleFormat, VideoCodec, VideoLimits,
44};
45pub use codec_string::{CodecString, CodecStringError, Tier};
46pub use date::{CalendarDate, DateError};
47pub use id::{ArtworkId, IdError, LibraryId, MediaId, MediaKind, Namespace, PersonId};
48pub use media::{
49    AudioRole, AudioTrack, MediaTracks, QuotaOf, SubtitleDownload, SubtitleDownloaded,
50    SubtitleOrigin, SubtitleResult, SubtitleRole, SubtitleSearch, SubtitleSource,
51    SubtitleSourceState, SubtitleSourceStatus, SubtitleSync, SubtitleTiming, SubtitleTrack,
52    VideoTrack,
53};
54pub use model::{
55    Album, Artist, Artwork, ArtworkKind, Caption, CastMember, Episode, Item, Library, LibraryKind,
56    LibraryServer, Marker, MarkerKind, Markers, MergeFacts, Movie, PlaybackState, Progress, Season,
57    Show, Track, YearsAired,
58};
59pub use platform::Platform;
60pub use preferences::{
61    AudioPreferences, BitmapPreference, ForcedPreference, SdhPreference, SubtitleMode,
62    SubtitlePreferences, TrackPreferences,
63};
64pub use role::Role;
65pub use search::{Person, PersonRole, SearchKind, SearchScope};
66
67pub mod pin;
68
69/// Password syntax shared by clients and servers.
70pub mod password {
71    /// The fewest characters a new password may have.
72    pub const MIN_CHARS: usize = 8;
73}
74
75/// The domain every server's app passkeys are made under: a server's
76/// relying party is `<server id>.spoolframe.app`. Every client and the
77/// admin API use this one value.
78pub const APP_RP_DOMAIN: &str = "spoolframe.app";