Skip to main content

Crate animedb

Crate animedb 

Source
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-db feature; requires rusqlite)
  • remote-first with normalized access to supported providers without local persistence (enabled by default with remote feature)

The easiest entry points are AnimeDb for local catalogs and RemoteApi for direct provider access.

§Feature flags

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.
CanonicalEpisode
Canonical episode data parsed from a provider adapter, used in upsert operations.
CanonicalMedia
Normalized media record as produced by a provider adapter and accepted by AnimeDb::upsert_media.
EpisodeFetchCandidate
A provider-native episode lookup derived from a media record’s external IDs.
EpisodeSourceRecord
Episode record as received from a specific provider (raw/normalized).
ExternalId
A source-specific identifier for a media record.
FieldProvenance
Records which provider field won during merge, with score and reasoning.
MediaDocument
A media record paired with its enriched episode list.
MergeDecision
Result of scoring a single field candidate from a provider.
MetadataCollection
Typed query facade over one local media slice.
PersistedSyncState
Persistent checkpoint for a provider sync, stored in SQLite sync_state.
RemoteApi
Remote-first facade over a single metadata provider.
RemoteCatalog
Remote-first facade over a single metadata provider.
RemoteCollection
Filtered view over one provider and one media slice.
RemoteMetadataCollection
A filtered view over a provider’s catalog for one media kind.
SearchHit
A search result returned by local FTS5 or remote provider search.
SearchOptions
Options that govern local FTS search and remote provider queries.
SourcePayload
Raw per-source payload as received from a provider.
StoredEpisode
Canonical episode data persisted in the local SQLite episode table.
StoredMedia
A media record as persisted in the local SQLite database.
SyncCursor
Cursor for paginating through a provider’s result set.
SyncOutcome
Outcome of a single provider sync run.
SyncReport
Aggregated result of a multi-source sync operation.
SyncRequest
Parameters that guide a single provider-to-catalog sync run.

Enums§

Error
The library’s unified error type.
MediaKind
Discriminates the four supported media kinds.
RemoteSource
Named variants for the built-in providers.
SourceName
Names the remote metadata source that originally supplied a record.
SyncMode
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 CanonicalMedia with an optional existing StoredMedia record.
provider_weight
Returns the 0.0–1.0 provider weight for merge scoring.

Type Aliases§

Result