Documentation
¶
Index ¶
- func ApplyRequestScopedAudioPolicy(meta *api.PreparedMetadata, cfg config.Config, logger api.Logger)
- func ApplyTagOverrides(path, currentTag, tagsPath string) (string, *api.TagOverride, error)
- func BuildReleaseName(req api.ReleaseNameRequest, logger api.Logger) api.ReleaseNameResult
- func DetectTag(path string) string
- func ParseReleaseInfo(path string) api.ReleaseInfo
- func RebuildReleaseName(meta *api.PreparedMetadata, logger api.Logger)
- type ArrLookupClient
- type ArrLookupResult
- type IMDBClient
- type Option
- func WithBDInfoService(bi *bdinfo.Service) Option
- func WithBlurayClient(client *bluraycom.Client) Option
- func WithConfig(cfg config.Config) Option
- func WithIMDBClient(client IMDBClient) Option
- func WithLogger(logger api.Logger) Option
- func WithMediaInfoExporter(exporter mediainfo.Exporter) Option
- func WithRadarrClient(client ArrLookupClient) Option
- func WithSRRDBPaths(dbPath string) Option
- func WithSceneDetector(detector SceneDetector) Option
- func WithSonarrClient(client ArrLookupClient) Option
- func WithTMDBClient(client TMDBClient) Option
- func WithTVDBClient(client TVDBClient) Option
- func WithTVmazeClient(client TVmazeClient) Option
- func WithTagsPathFromDB(dbPath string) Option
- func WithTrackerDataLookup(lookup TrackerDataLookup) Option
- type SceneDetector
- type SceneResult
- type Service
- func (s *Service) ApplyArrData(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
- func (s *Service) ApplyMediaDetails(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
- func (s *Service) ApplyMediaInfoIDs(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
- func (s *Service) EnrichTrackerData(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
- func (s *Service) Prepare(ctx context.Context, req api.Request) (api.PreparedMetadata, error)
- func (s *Service) RefreshPreparedMetadata(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
- func (s *Service) ResolveExternalIDs(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
- type TMDBClient
- type TVDBClient
- type TVmazeClient
- type TrackerDataLookup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyRequestScopedAudioPolicy ¶
func ApplyRequestScopedAudioPolicy(meta *api.PreparedMetadata, cfg config.Config, logger api.Logger)
ApplyRequestScopedAudioPolicy updates audio labels and tracker audio blocks for the request's active tracker set.
func ApplyTagOverrides ¶
func ApplyTagOverrides(path, currentTag, tagsPath string) (string, *api.TagOverride, error)
func BuildReleaseName ¶
func BuildReleaseName(req api.ReleaseNameRequest, logger api.Logger) api.ReleaseNameResult
func ParseReleaseInfo ¶
func ParseReleaseInfo(path string) api.ReleaseInfo
func RebuildReleaseName ¶
func RebuildReleaseName(meta *api.PreparedMetadata, logger api.Logger)
RebuildReleaseName regenerates the prepared release-name fields from the current metadata and release-name overrides.
Types ¶
type ArrLookupClient ¶
type ArrLookupClient interface {
Lookup(ctx context.Context, meta api.PreparedMetadata) (ArrLookupResult, error)
}
type ArrLookupResult ¶
type IMDBClient ¶
type IMDBClient interface {
Search(ctx context.Context, input imdb.SearchInput) (imdb.SearchResult, error)
GetInfo(ctx context.Context, imdbID string, manualLanguage string, debug bool) (imdb.Info, error)
}
IMDBClient is the IMDb metadata surface used by external-ID resolution.
type Option ¶
type Option func(*Service)
func WithBDInfoService ¶
func WithBlurayClient ¶
func WithConfig ¶
func WithIMDBClient ¶
func WithIMDBClient(client IMDBClient) Option
func WithLogger ¶
func WithMediaInfoExporter ¶
func WithRadarrClient ¶
func WithRadarrClient(client ArrLookupClient) Option
func WithSRRDBPaths ¶
func WithSceneDetector ¶
func WithSceneDetector(detector SceneDetector) Option
func WithSonarrClient ¶
func WithSonarrClient(client ArrLookupClient) Option
func WithTMDBClient ¶
func WithTMDBClient(client TMDBClient) Option
func WithTVDBClient ¶
func WithTVDBClient(client TVDBClient) Option
func WithTVmazeClient ¶
func WithTVmazeClient(client TVmazeClient) Option
func WithTagsPathFromDB ¶
func WithTrackerDataLookup ¶
func WithTrackerDataLookup(lookup TrackerDataLookup) Option
type SceneDetector ¶
type SceneDetector interface {
Detect(ctx context.Context, meta api.PreparedMetadata) (SceneResult, error)
}
SceneDetector resolves scene metadata from a prepared item. Implementations may return a populated result with an error when an optional side effect fails.
type SceneResult ¶
type SceneResult struct {
IsScene bool
SceneName string
TMDBID int
IMDBID int
TVDBID int
TVmazeID int
MALID int
// Service is the normalized service code parsed from a saved scene NFO.
Service string
// ServiceLongName is the display name matching Service when one is known.
ServiceLongName string
// NFOPath is the local filesystem path to a saved scene NFO.
NFOPath string
// NFONew reports whether NFOPath was downloaded during this detection run.
NFONew bool
}
SceneResult captures scene metadata from external sources. NFO fields are best-effort side-effect outputs and may be empty on an otherwise valid match.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo db.MetadataRepository, opts ...Option) *Service
func (*Service) ApplyArrData ¶
func (s *Service) ApplyArrData(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
func (*Service) ApplyMediaDetails ¶
func (s *Service) ApplyMediaDetails(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
ApplyMediaDetails enriches prepared metadata from MediaInfo, BDInfo, filename tokens, overrides, and tracker policies, then rebuilds the release name.
func (*Service) ApplyMediaInfoIDs ¶
func (s *Service) ApplyMediaInfoIDs(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
func (*Service) EnrichTrackerData ¶
func (s *Service) EnrichTrackerData(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
func (*Service) RefreshPreparedMetadata ¶
func (s *Service) RefreshPreparedMetadata(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
RefreshPreparedMetadata reapplies request-scoped audio, naming, rule, and claim state without rereading media files. HDR may be refreshed from the current source path only when it still matches the parsed release HDR.
func (*Service) ResolveExternalIDs ¶
func (s *Service) ResolveExternalIDs(ctx context.Context, meta api.PreparedMetadata) (api.PreparedMetadata, error)
ResolveExternalIDs resolves and persists cross-provider IDs and metadata for a prepared item, honoring fresh stored data, overrides, scene IDs, and tracker matches before falling back to provider searches. Selected BJS, BT, and ASC targets trigger pt-BR TMDB localized metadata when a TMDB ID is known.
type TMDBClient ¶
type TMDBClient interface {
FindByExternalID(ctx context.Context, input tmdb.FindInput) (tmdb.FindResult, error)
SearchID(ctx context.Context, input tmdb.SearchInput) (tmdb.SearchOutcome, error)
FetchMetadata(ctx context.Context, input tmdb.MetadataInput) (tmdb.MetadataResult, error)
GetEpisodeDetails(ctx context.Context, tmdbID, season, episode int) (tmdb.EpisodeDetails, error)
GetSeasonDetails(ctx context.Context, tmdbID, season int) (tmdb.SeasonDetails, error)
DailyToSeasonEpisode(ctx context.Context, tmdbID int, date time.Time) (int, int, error)
GetLocalizedData(ctx context.Context, input tmdb.LocalizedDataInput) (map[string]any, error)
}
TMDBClient is the TMDB metadata surface used by external-ID resolution.
type TVDBClient ¶
type TVDBClient interface {
GetByExternalID(ctx context.Context, imdbID, tmdbID string, tvMovie bool) (int, string, error)
GetSeriesMetadata(ctx context.Context, seriesID int) (tvdb.SeriesMetadata, error)
GetSeriesMetadataWithLanguage(ctx context.Context, seriesID int, language string) (tvdb.SeriesMetadata, error)
GetEpisodes(ctx context.Context, seriesID int, query tvdb.EpisodeQuery) (tvdb.EpisodesData, string, error)
GetEpisodesWithLanguage(ctx context.Context, seriesID int, query tvdb.EpisodeQuery, language string) (tvdb.EpisodesData, string, error)
GetEpisodeTranslation(ctx context.Context, episodeID int, language string) (tvdb.EpisodeTranslation, error)
}
TVDBClient is the TVDB metadata surface used by external-ID resolution.
type TVmazeClient ¶
type TVmazeClient interface {
Search(ctx context.Context, input tvmaze.SearchInput) (tvmaze.SearchResult, error)
GetEpisodeByNumber(ctx context.Context, tvmazeID, season, episode int, lookup tvmaze.EpisodeLookupContext) (*tvmaze.EpisodeData, error)
GetEpisodeByDate(ctx context.Context, tvmazeID int, airdate string) (*tvmaze.EpisodeData, error)
}
TVmazeClient is the TVmaze metadata surface used by external-ID resolution.
type TrackerDataLookup ¶
Source Files
¶
- arr.go
- bluray.go
- external_ids.go
- media_details.go
- mediainfo_ids.go
- mediainfo_languages.go
- mediainfo_parse.go
- naming.go
- overrides.go
- release.go
- release_overrides.go
- scene.go
- service.go
- service_map.go
- service_resolve.go
- source_lookup.go
- tags.go
- tmdb_localized.go
- tracker_artifacts.go
- tracker_claims.go
- tracker_claims_btn.go
- tracker_data.go
- tracker_rules.go