Versions in this module Expand all Collapse all v0 v0.1.0 Nov 21, 2026 Changes in this version + var ErrAlreadyExists = errors.New("series already in library") + var ErrFileNotFound = errors.New("episode file not found") + var ErrMetadataNotConfigured = errors.New("metadata provider not configured") + var ErrNotFound = errors.New("series not found") + type AddRequest struct + LibraryID string + MonitorType string + Monitored bool + QualityProfileID string + SeriesType string + TMDBID int + type AnimeLookup interface + CourBounds func(tmdbID int) []CourBound + IsAnime func(tmdbID int) bool + TVDBSeasonToAbsolute func(tmdbID, tvdbSeason, tvdbEpisode int) (int, bool) + type Cour struct + EpisodeCount int64 + EpisodeFileCount int64 + EpisodeIDs []string + EpisodeOffset int + Monitored bool + Name string + TMDBSeason int + TVDBSeason int + TotalSizeBytes int64 + type CourBound struct + Name string + TMDBOffset int + TMDBSeason int + TVDBSeason int + type Episode struct + AbsoluteNumber *int + AirDate string + EpisodeNumber int + HasFile bool + ID string + Monitored bool + Overview string + RuntimeMinutes int + SeasonID string + SeasonNumber int + SeriesID string + StillPath string + Title string + type ExternalIDLookup interface + GetExternalIDs func(ctx context.Context, tmdbID int) (tmdbtv.ExternalIDs, error) + type ListRequest struct + LibraryID string + Page int + PerPage int + type ListResult struct + Page int + PerPage int + Series []Series + Total int64 + type LookupRequest struct + Query string + TMDBID int + Year int + type MetadataProvider interface + DiscoverTVByGenre func(ctx context.Context, genreID, page int) (*tmdbtv.PaginatedSeries, error) + GetAlternativeTitles func(ctx context.Context, tmdbID int) ([]string, error) + GetOnTheAirTV func(ctx context.Context, page int) (*tmdbtv.PaginatedSeries, error) + GetPerson func(ctx context.Context, personID int) (*tmdbtv.Person, error) + GetPersonTVCredits func(ctx context.Context, personID int, personType string) ([]tmdbtv.PersonCredit, error) + GetPopularTV func(ctx context.Context, page int) (*tmdbtv.PaginatedSeries, error) + GetSeasonEpisodes func(ctx context.Context, tmdbID int, seasonNum int) ([]tmdbtv.EpisodeDetail, error) + GetSeries func(ctx context.Context, tmdbID int) (*tmdbtv.SeriesDetail, error) + GetSeriesExtended func(ctx context.Context, tmdbID int) (*tmdbtv.SeriesDetail, error) + GetTVGenres func(ctx context.Context) ([]tmdbtv.Genre, error) + GetTopRatedTV func(ctx context.Context, page int) (*tmdbtv.PaginatedSeries, error) + GetTrendingTV func(ctx context.Context, window string, page int) (*tmdbtv.PaginatedSeries, error) + SearchSeries func(ctx context.Context, query string, year int) ([]tmdbtv.SearchResult, error) + type PersonCredit struct + InLibrary bool + LibrarySeriesID string + type Recycler interface + Delete func(ctx context.Context, path, libraryRoot string) (recycledTo string, err error) + type RenameMove struct + NewPath string + OldPath string + type RenamePreview struct + Extras []RenameMove + FileID string + NewPath string + OldPath string + type RenameSettings struct + ColonReplacement renamer.ColonReplacement + EpisodeFormat string + SeasonFolderFormat string + SeriesFolderFormat string + type Season struct + EpisodeCount int64 + EpisodeFileCount int64 + ID string + Monitored bool + SeasonNumber int + SeriesID string + TotalSizeBytes int64 + type Series struct + AddedAt time.Time + AirTime string + AlternateTitles []string + Certification string + EpisodeCount int64 + EpisodeFileCount int64 + FanartURL string + Genres []string + ID string + IMDBID string + LibraryID string + MetadataRefreshedAt *time.Time + MonitorType string + Monitored bool + Network string + Overview string + Path string + PosterURL string + QualityProfileID string + RuntimeMinutes int + SeriesType string + SortTitle string + Status string + TMDBID int + TVDBID int + Title string + UpdatedAt time.Time + Year int + type Service struct + func NewService(q db.Querier, meta MetadataProvider, anime AnimeLookup, bus *events.Bus, ...) *Service + func (s *Service) Add(ctx context.Context, req AddRequest) (Series, error) + func (s *Service) BackfillAnimeForAllSeries(ctx context.Context) + func (s *Service) BackfillAnimeIfNeeded(ctx context.Context, seriesID string, tmdbID int, currentSeriesType string) bool + func (s *Service) BackfillExternalIDs(ctx context.Context) (int, error) + func (s *Service) Delete(ctx context.Context, id string) error + func (s *Service) DeleteFile(ctx context.Context, fileID string, deleteFromDisk bool) error + func (s *Service) DiscoverByGenre(ctx context.Context, genreID, page int) (*tmdbtv.PaginatedSeries, error) + func (s *Service) DiscoverGenres(ctx context.Context) ([]tmdbtv.Genre, error) + func (s *Service) DiscoverList(ctx context.Context, category string, page int) (*tmdbtv.PaginatedSeries, error) + func (s *Service) Get(ctx context.Context, id string) (Series, error) + func (s *Service) GetCours(ctx context.Context, seriesID string) ([]Cour, error) + func (s *Service) GetEpisode(ctx context.Context, episodeID string) (Episode, error) + func (s *Service) GetEpisodeAbsoluteNumber(ctx context.Context, seriesID string, season, episode int) (int, error) + func (s *Service) GetEpisodes(ctx context.Context, seasonID string) ([]Episode, error) + func (s *Service) GetPerson(ctx context.Context, personID int) (*tmdbtv.Person, []PersonCredit, error) + func (s *Service) GetSeasons(ctx context.Context, seriesID string) ([]Season, error) + func (s *Service) List(ctx context.Context, req ListRequest) (ListResult, error) + func (s *Service) ListAllTMDBIDs(ctx context.Context) ([]int64, error) + func (s *Service) ListFiles(ctx context.Context, seriesID string) ([]db.EpisodeFile, error) + func (s *Service) Lookup(ctx context.Context, req LookupRequest) ([]tmdbtv.SearchResult, error) + func (s *Service) LookupDetail(ctx context.Context, tmdbID int) (*tmdbtv.SeriesDetail, bool, string, error) + func (s *Service) RefreshEpisodeMetadata(ctx context.Context, seriesID string, tmdbID int) error + func (s *Service) RefreshMetadata(ctx context.Context, seriesID string) (Series, error) + func (s *Service) RenameFiles(ctx context.Context, seriesID string, settings RenameSettings, dryRun bool) ([]RenamePreview, error) + func (s *Service) SetCourMonitored(ctx context.Context, seriesID string, tvdbSeason int, monitored bool) error + func (s *Service) SetRecycler(r Recycler) + func (s *Service) TVDBSeasonToAbsolute(tmdbID, tvdbSeason, tvdbEpisode int) (int, bool) + func (s *Service) Update(ctx context.Context, id string, req UpdateRequest) (Series, error) + func (s *Service) UpdateEpisodeMonitored(ctx context.Context, episodeID string, monitored bool) error + func (s *Service) UpdateSeasonMonitored(ctx context.Context, seasonID string, monitored bool) error + type UpdateRequest struct + LibraryID string + Monitored bool + Path string + QualityProfileID string + SeriesType string + Title string