Documentation
¶
Overview ¶
Package availability discovers releases incrementally and spends a bounded background allowance validating useful candidates. Recent releases require evidence for discovery; older catalogue entries need no background search.
Index ¶
- func EvidenceWindow(t core.Title, now time.Time) bool
- type Catalog
- type Deps
- type FeedStatus
- type Feeds
- type Observation
- type Service
- func (s *Service) Candidates(ctx context.Context, t *core.Title) []core.Release
- func (s *Service) Cycle(ctx context.Context) error
- func (s *Service) FilterDiscovery(ctx context.Context, items []core.Title) []core.Title
- func (s *Service) Handler() http.Handler
- func (s *Service) HiddenMovies(ctx context.Context) []core.RatingKey
- func (s *Service) HiddenShows(ctx context.Context) []core.RatingKey
- func (s *Service) Hubs(ctx context.Context, limit int) []core.Hub
- func (s *Service) Invalidate(ctx context.Context, id string)
- func (s *Service) Observe(ctx context.Context, t *core.Title, r core.Release)
- func (s *Service) Prioritize(ctx context.Context, items []core.Title) []core.Title
- func (s *Service) RecordSearch(ctx context.Context, t *core.Title, rs []core.Release)
- func (s *Service) Run(ctx context.Context)
- func (s *Service) Status(ctx context.Context) (Status, error)
- type Status
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
DB *sql.DB
Config func() config.Config
Feeds Feeds
Catalog Catalog
Validator Validator
Seal func(string) (string, error)
Open func(string) (string, error)
CacheCheck func(context.Context, []string) (map[string]bool, bool)
Active func() bool
Now func() time.Time
Logger *slog.Logger
}
type FeedStatus ¶
type Observation ¶
type Observation struct {
Key core.RatingKey `json:"key"`
Title string `json:"title"`
Release string `json:"release"`
Protocol string `json:"protocol"`
State string `json:"state"`
Reason string `json:"reason"`
FirstSeen int64 `json:"firstSeen"`
FirstVerified int64 `json:"firstVerified"`
VerifiedAt int64 `json:"verifiedAt"`
NextCheck int64 `json:"nextCheck"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Candidates ¶
Candidates serves remembered descriptors locally; playback still applies its exact viewer/device policy and validates the selected source.
func (*Service) FilterDiscovery ¶ added in v0.2.9
A short local memo keeps repeated Plex artwork/list requests inexpensive. New observations and invalidations clear it immediately. Other cluster nodes see changes within fifteen seconds, without a provider request.
func (*Service) HiddenMovies ¶ added in v0.2.9
HiddenMovies supplies SQL pagination with exclusions from the recent local mirror only. No per-title provider lookup or historical catalogue walk occurs.
func (*Service) HiddenShows ¶ added in v0.2.9
HiddenShows excludes first-day series before SQL pagination, just as movies.
func (*Service) Invalidate ¶
Invalidate retracts positive evidence immediately when playback or the owner invalidates a release. The title and its other sources remain discoverable.
func (*Service) Observe ¶
Observe reuses an actual successful resolver health check. Optimistic starts and prepared sessions without health evidence do not call this method.
func (*Service) Prioritize ¶
func (*Service) RecordSearch ¶ added in v0.2.9
RecordSearch retains descriptors from an actual requested search. It does not initiate searches, grab media or claim health. Policy is reevaluated on reads.