feat: add episode title provider and service interfaces
This commit is contained in:
@@ -8,12 +8,21 @@ type EpisodeAvailability struct {
|
||||
Titles map[int]string
|
||||
}
|
||||
|
||||
type EpisodeAvailabilityProvider interface {
|
||||
type EpisodeProvider interface {
|
||||
Name() string
|
||||
ResolveEpisodeProviderID(ctx context.Context, animeID int, titleCandidates []string) (string, error)
|
||||
}
|
||||
|
||||
type EpisodeAvailabilityProvider interface {
|
||||
EpisodeProvider
|
||||
GetEpisodeAvailabilityByProviderID(ctx context.Context, providerID string) (EpisodeAvailability, error)
|
||||
}
|
||||
|
||||
type EpisodeTitleProvider interface {
|
||||
EpisodeProvider
|
||||
GetEpisodeTitlesByProviderID(ctx context.Context, providerID string) (map[int]string, error)
|
||||
}
|
||||
|
||||
type CanonicalEpisode struct {
|
||||
Number int `json:"number"`
|
||||
Title string `json:"title"`
|
||||
@@ -41,3 +50,7 @@ type EpisodeService interface {
|
||||
GetCanonicalEpisodes(ctx context.Context, anime Anime, forceRefresh bool) (CanonicalEpisodeList, error)
|
||||
RefreshTrackedDue(ctx context.Context, limit int) error
|
||||
}
|
||||
|
||||
type EpisodeTitleService interface {
|
||||
EnrichEpisodeTitles(ctx context.Context, anime Anime) (CanonicalEpisodeList, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user