anidb

package
v0.9.0-dev.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package anidb provides TVDB → AniDB mapping using the community-maintained anime-list.xml from https://github.com/Anime-Lists/anime-lists. Optionally queries the AniDB HTTP API for episode-specific IDs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EpisodeResult

type EpisodeResult struct {
	AniDBEpisodeID int // 0 if API key not configured or lookup failed
}

EpisodeResult holds the resolved AniDB IDs.

type Mapper

type Mapper struct {
	// contains filtered or unexported fields
}

Mapper resolves TVDB IDs to AniDB episode IDs.

func NewMapper

func NewMapper(clientKey string) *Mapper

NewMapper creates an AniDB mapper. clientKey is optional; if empty, only the XML mapping is used (no episode ID resolution).

func (*Mapper) CheckClientKey added in v0.6.0

func (m *Mapper) CheckClientKey(ctx context.Context) error

CheckClientKey reports whether AniDB accepts the configured client key.

`request=main` is the cheapest call behind AniDB's client gate: no anime id, so nothing is looked up. A refused key is *subflux.AuthError; a ban or any other error envelope reports as an incomplete check, because waiting is a different remedy from fixing a field. An absent key is a refusal whose text says so — the key is optional and AnimeTosho searches by title without one.

func (*Mapper) ClientKeyVerdict added in v0.6.6

func (m *Mapper) ClientKeyVerdict() (answered bool, refusal error)

ClientKeyVerdict reports whether AniDB has said anything about the client key, by refusing it or by answering a request carrying it with data, and the refusal when it refused.

func (*Mapper) ForgetClientKeyVerdict added in v0.6.6

func (m *Mapper) ForgetClientKeyVerdict()

ForgetClientKeyVerdict drops AniDB's answer about the client key and the episode IDs cached under it, so the next episode lookup asks AniDB again and latches anew if it refuses.

func (*Mapper) Resolve

func (m *Mapper) Resolve(ctx context.Context, tvdbID, season, episode int) *EpisodeResult

Resolve maps a TVDB series ID + season + episode to AniDB IDs. Returns nil if no mapping exists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL