Help us shape the future of Go! Take the 2026 Go Developer Survey

animemap

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package animemap maps TMDB titles to the anime databases (Kitsu, MyAnimeList, AniList, AniDB) whose ids anime-only Stremio addons look titles up by.

The mapping is the community anime-lists dataset (Fribb/anime-lists on GitHub), read at runtime only when an addon needs it. Ether ships no copy. The dataset is untrusted input: the download is size- and time-bounded, failures back off, and any ambiguity yields no mapping rather than a guess, so callers keep their IMDb lookups and simply skip the addon.

Index

Constants

View Source
const (
	Kitsu   = "kitsu"
	MAL     = "mal"
	AniList = "anilist"
	AniDB   = "anidb"
)

Databases an anime addon may look titles up by (Stremio id prefixes).

View Source
const DefaultURL = "https://raw.githubusercontent.com/Fribb/anime-lists/master/anime-list-mini.json"

DefaultURL is the dataset Ether reads by default.

Variables

View Source
var ErrUnavailable = errors.New("animemap: anime id mapping unavailable")

ErrUnavailable reports that the dataset could not be loaded (or is backing off after a failure). Callers treat it as "no mapping".

Functions

This section is empty.

Types

type Options

type Options struct {
	URL      string       // "" = DefaultURL
	Client   *http.Client // nil = a public-only safefetch client
	Logger   *slog.Logger
	Now      func() time.Time
	TTL      time.Duration // 0 = 24h
	MaxBytes int64         // 0 = 32 MiB
	Timeout  time.Duration // 0 = 90s
}

Options configure a Service.

type Service

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

Service loads the dataset lazily and answers lookups from memory.

func New

func New(opts Options) *Service

New returns a Service; nothing is fetched until the first lookup.

func (*Service) Lookup

func (s *Service) Lookup(ctx context.Context, req core.SearchRequest, db string) (id int64, episode int, ok bool, err error)

Lookup maps a search request to db's id and, for an episode, the episode's number inside that entry. ok is false when the request has no unambiguous mapping. err is non-nil only when the dataset is unavailable.

Jump to

Keyboard shortcuts

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