Documentation
¶
Overview ¶
Package plexmeta caches Plex metadata-provider details for Plex apps. TMDB stays the catalogue and the fallback. Viewer policy uses the safer (more mature) of the TMDB and Plex content ratings when this overlay is on; Plex apps still display Plex's own rating. Date-added stays the catalogue release/air date — Plex dates never change addedAt.
Index ¶
Constants ¶
const RemoteArt = "plex"
RemoteArt is the sentinel ApplyDisplay writes when Plex supplies artwork and TMDB has none, so convert can emit a thumb URL and images can fall back.
Variables ¶
This section is empty.
Functions ¶
func ApplyDisplay ¶
ApplyDisplay copies present Plex fields onto t for the Plex convert path. Released and AddedAt stay on the caller — Plex dates must not change date-added. TMDB genres and person ids stay; Plex only enriches matching names so person pages and genre filters keep working.
func SaferRating ¶
SaferRating is the more mature of two stored ratings. An unrated side is ignored so a missing Plex label does not hide a rated TMDB title; if both are unrated the TMDB value is kept.
Types ¶
type Options ¶
type Options struct {
HTTP *http.Client
// ClientIdentifier is the per-install id shared with plexguid.
ClientIdentifier func() string
BaseURL string
Token func() string
// GUID returns a verified plex:// mapping; empty means skip the key.
GUID func(context.Context, core.RatingKey) string
// Enabled is the owner toggle and claimed check. Nil means off.
Enabled func() bool
Background bool
Now func() time.Time
}
Options configure the background metadata cache.
type Overlay ¶
type Overlay struct {
ContentRating string `json:"contentRating,omitempty"`
Year int `json:"year,omitempty"`
AvailableAt time.Time `json:"availableAt,omitempty"`
Summary string `json:"summary,omitempty"`
Tagline string `json:"tagline,omitempty"`
Studio string `json:"studio,omitempty"`
ThumbURL string `json:"thumbUrl,omitempty"`
ArtURL string `json:"artUrl,omitempty"`
Rating float64 `json:"rating,omitempty"`
AudienceRating float64 `json:"audienceRating,omitempty"`
RatingImage string `json:"ratingImage,omitempty"`
AudienceRatingImage string `json:"audienceRatingImage,omitempty"`
Genres []string `json:"genres,omitempty"`
Cast []Person `json:"cast,omitempty"`
Directors []Person `json:"directors,omitempty"`
Writers []Person `json:"writers,omitempty"`
}
Overlay is one title's cached Plex metadata. Empty fields mean "keep TMDB".
type Person ¶
type Person struct {
Name string `json:"name,omitempty"`
Role string `json:"role,omitempty"`
Thumb string `json:"thumb,omitempty"`
}
Person is a Plex Role/Director/Writer tag.
type RatingSQL ¶
type RatingSQL struct{}
RatingSQL is the catalogue SQL helper for Plex viewer limits. Catalog calls HideExceeding instead of naming plexmeta_titles itself.
func (RatingSQL) HideExceeding ¶
HideExceeding is true unless a cached overlay for keyColumn exceeds the bound level AND that overlay's guid still matches the verified plex:// mapping. A remapped title is ignored so a stale adult rating cannot hide it.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service caches Plex metadata-provider payloads. Reads never wait on Plex.
func (*Service) CachedMany ¶
CachedMany batch-loads overlays by rating key only.