mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-04 00:47:00 +01:00
Most files that are not fansub releases carry no chapters, so they had no skip button. AniSkip knows where an episode's opening and ending are, by MyAnimeList id and episode number. ani.zip sends each entry's MyAnimeList id and enrichment now keeps it on every episode row; schema v14 adds the column and marks AniList titles un-enriched, deleting nothing, as v13 did. When a file has loaded with no chapter naming an opening or ending, and its length is known, each client asks once, with enrichment on only. The answer lives as long as the file is open. with_skip_ranges cuts it into the chapters as chapters named Opening and Ending, so the skip button, auto-skip, the up-next countdown and the seek bar's marks all work through the code a chaptered file uses. A file's own opening or ending always wins over AniSkip's. PRIVACY.md lists what is sent: the MyAnimeList id, the episode number and the file's length.
47 lines
2.0 KiB
Rust
47 lines
2.0 KiB
Rust
//! Matching a library's titles against a metadata provider.
|
|
//!
|
|
//! What this crate is for is the gap between what a filename says and what a
|
|
//! poster wall wants: a share filled by the Proton Drive Linux client carries no
|
|
//! thumbnails at all — Proton renders those at upload time and that client
|
|
//! attaches none — so without enrichment every tile in the grid is a pair of
|
|
//! initials on a grey rectangle. See `docs/DEVELOPMENT.md`.
|
|
//!
|
|
//! ```text
|
|
//! Title ──▶ Query ──▶ Provider::search ──▶ [Candidate] ──▶ matching::best
|
|
//! (anilist, then tvmaze | tmdb) │
|
|
//! ▼
|
|
//! Enrichment ◀── Provider::enrich ◀──────────────────── TitleMetadata
|
|
//! (episodes, fanart) (anilist relations + ani.zip | tvmaze | tmdb)
|
|
//! ```
|
|
//!
|
|
//! Three things are worth knowing before touching any of it:
|
|
//!
|
|
//! * **It is off by default and says why.** Enrichment sends the titles in
|
|
//! someone's library to a third party. The switch is theirs, the reasoning is
|
|
//! in `pstr_core::metadata`, and nothing here runs until it is on.
|
|
//! * **A wrong match is worse than no match.** The wrong poster does not look
|
|
//! like a bug, it looks like the library is wrong — so
|
|
//! [`matching::MATCH_FLOOR`] is high and a weak field yields nothing.
|
|
//! * **Misses are cached and failures are not.** See [`service`].
|
|
//!
|
|
//! The model — [`pstr_core::metadata::TitleMetadata`] and friends — deliberately
|
|
//! lives in `pstr-core`, so the catalog can store it and the UI can draw it
|
|
//! without either depending on this crate.
|
|
|
|
pub mod anilist;
|
|
pub mod aniskip;
|
|
pub mod anizip;
|
|
pub mod error;
|
|
pub mod limiter;
|
|
pub mod matching;
|
|
pub mod provider;
|
|
pub mod service;
|
|
pub mod settings;
|
|
pub mod tmdb;
|
|
pub mod tvmaze;
|
|
|
|
pub use error::{Error, Result};
|
|
pub use matching::{Candidate, Query};
|
|
pub use provider::Provider;
|
|
pub use service::MetadataService;
|