Expand description
animedb is a Rust-first anime and manga metadata crate for local media servers.
It exposes two integration modes:
- local-first with SQLite schema management, sync, merge, provenance, and FTS search
(enabled by default with
local-dbfeature; requires rusqlite) - remote-first with normalized access to supported providers without local persistence
(enabled by default with
remotefeature)
The easiest entry points are AnimeDb for local catalogs and RemoteApi for direct
provider access.
§Feature flags
local-db(default): local SQLite storage, sync state persistence, and theAnimeDbtype. This feature pulls inrusqlitewith a bundled SQLite.remote(default): remote provider clients (AniListProvider,TvmazeProvider, etc.) and the normalized data model (CanonicalMedia,SearchOptions, etc.).
To use animedb as a pure remote-only client (no SQLite dependency), disable both
default features and enable only remote:
animedb = { version = "0.1", default-features = false, features = ["remote"] }Re-exports§
pub use provider::AniListProvider;pub use provider::FetchPage;pub use provider::ImdbProvider;pub use provider::JikanProvider;pub use provider::KitsuProvider;pub use provider::Provider;pub use provider::TvmazeProvider;
Modules§
- provider
- Remote provider trait and concrete provider implementations.
- repository
- SQLite persistence layer.
- sync
Structs§
- AnimeDb
- Local-first SQLite-backed catalog entry point.
- Canonical
Episode - Canonical episode data parsed from a provider adapter, used in upsert operations.
- Canonical
Media - Normalized media record as produced by a provider adapter and accepted by
AnimeDb::upsert_media. - Episode
Fetch Candidate - A provider-native episode lookup derived from a media record’s external IDs.
- Episode
Source Record - Episode record as received from a specific provider (raw/normalized).
- External
Id - A source-specific identifier for a media record.
- Field
Provenance - Records which provider field won during merge, with score and reasoning.
- Media
Document - A media record paired with its enriched episode list.
- Merge
Decision - Result of scoring a single field candidate from a provider.
- Metadata
Collection - Typed query facade over one local media slice.
- Persisted
Sync State - Persistent checkpoint for a provider sync, stored in SQLite
sync_state. - Remote
Api - Remote-first facade over a single metadata provider.
- Remote
Catalog - Remote-first facade over a single metadata provider.
- Remote
Collection - Filtered view over one provider and one media slice.
- Remote
Metadata Collection - A filtered view over a provider’s catalog for one media kind.
- Search
Hit - A search result returned by local FTS5 or remote provider search.
- Search
Options - Options that govern local FTS search and remote provider queries.
- Source
Payload - Raw per-source payload as received from a provider.
- Stored
Episode - Canonical episode data persisted in the local SQLite
episodetable. - Stored
Media - A media record as persisted in the local SQLite database.
- Sync
Cursor - Cursor for paginating through a provider’s result set.
- Sync
Outcome - Outcome of a single provider sync run.
- Sync
Report - Aggregated result of a multi-source sync operation.
- Sync
Request - Parameters that guide a single provider-to-catalog sync run.
Enums§
- Error
- The library’s unified error type.
- Media
Kind - Discriminates the four supported media kinds.
- Remote
Source - Named variants for the built-in providers.
- Source
Name - Names the remote metadata source that originally supplied a record.
- Sync
Mode - Controls whether a sync run overwrites all fields or only fills empty ones.
Functions§
- make_
provenance - merge_
canonical_ episodes_ by_ effective_ number - Merges raw remote episode records into one record per flat effective episode number.
- merge_
episode_ source_ records - Merges multiple source episode records for the same media+episode into one canonical record.
- merge_
media - Merges an incoming
CanonicalMediawith an optional existingStoredMediarecord. - provider_
weight - Returns the 0.0–1.0 provider weight for merge scoring.