mdb

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EpisodeSRRDBInfo added in v1.13.0

type EpisodeSRRDBInfo struct {
	EpisodeNum  int
	ReleaseName string
	Details     *srrdb.DetailsResponse
}

EpisodeSRRDBInfo holds SRRDB details for a single episode in a season pack.

type FuzzyResult

type FuzzyResult struct {
	ImdbID     string
	FuzzyTitle string
	FuzzyScore float64
}

FuzzyResult is a struct for fuzzy search results (stub, implement as needed)

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type MDBClient

type MDBClient struct {
	HTTPClient  HTTPClient
	SrrdbClient *srrdb.Client
	Config      *configs.Config
}

func (*MDBClient) FetchNFOFilename added in v1.12.0

func (c *MDBClient) FetchNFOFilename(releaseName string) (string, error)

FetchNFOFilename queries SRRDB for the original NFO filename without downloading the content.

func (*MDBClient) FetchNFOFromSources added in v1.10.0

func (c *MDBClient) FetchNFOFromSources(releaseName string) (string, string, error)

FetchNFOFromSources tries multiple NFO sources in order.

func (*MDBClient) FetchReleaseFileInfo added in v1.13.0

func (c *MDBClient) FetchReleaseFileInfo(releaseName string) (*srrdb.DetailsResponse, error)

FetchReleaseFileInfo queries SRRDB for full file details including CRC32 checksums.

func (*MDBClient) FetchSeasonEpisodeInfo added in v1.13.0

func (c *MDBClient) FetchSeasonEpisodeInfo(seasonReleaseName string, episodeNumbers []int, episodeNames map[int]string) []EpisodeSRRDBInfo

FetchSeasonEpisodeInfo queries SRRDB for each episode in a season pack. It uses episodeNames (from subfolder names or MKV filenames) for direct lookup first, then falls back to deriving per-episode release names from the season release name. Returns successfully found episodes; episodes not on SRRDB are silently skipped.

func (*MDBClient) IdentifyRelease

func (c *MDBClient) IdentifyRelease(releaseName, nfoContent, imdbID string, tmdbID int, statusCb func(StatusMessage)) (*types.ReleaseMetadata, error)

IdentifyRelease attempts to identify and enrich a release with metadata by querying various media databases and extracting information from the release name and NFO content.

type MediaTitles

type MediaTitles struct {
	TMDBID         int
	IMDBID         string
	TVDBID         int
	Year           int
	GermanTitle    string
	GermanAltTitle string
	EnglishTitle   string
	Keywords       []string
	Score          float64
	IsAnime        bool
}

func FindBestFuzzyMatch

func FindBestFuzzyMatch(mediaTitles []MediaTitles, query string, queryYear int) *MediaTitles

type NFOFetcher added in v1.10.0

type NFOFetcher interface {
	FetchNFO(releaseName string) (filename string, content string, err error)
}

NFOFetcher interface for NFO fetching services.

type SeasonInfo added in v1.11.0

type SeasonInfo struct {
	FinaleAired   bool // Indicates if the season finale has aired
	IsBulk        bool // Indicates if all episodes aired on the same day (bulk release)
	AllowUpload   bool // Indicates if upload should be allowed (considers grace period for bulk releases)
	EpisodeNumber int  // Episode number of the last aired episode
	TotalEpisodes int  // Total number of episodes in the season
	HasError      bool // Indicates if an API error occurred (when true, AllowUpload should be false)
	HasNoData     bool // Indicates if API returned no episodes (when true with no error, may need fallback)
}

type SpecialEpisodeInfo added in v1.12.0

type SpecialEpisodeInfo struct {
	Season         int
	Episode        int
	EpisodeName    string
	MatchScore     float64
	MatchedAgainst string // which title was matched (DE or EN)
}

SpecialEpisodeInfo holds information about a matched special episode

type SrrdbFetcher added in v1.10.0

type SrrdbFetcher struct {
	Client *srrdb.Client
}

SrrdbFetcher implements NFOFetcher for SRRDB using the go-srrdb library.

func (*SrrdbFetcher) FetchNFO added in v1.10.0

func (s *SrrdbFetcher) FetchNFO(releaseName string) (string, string, error)

type StatusMessage

type StatusMessage struct {
	Type    string // "info", "warn", "error", "spinner"
	Message string
}

Jump to

Keyboard shortcuts

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