0.3.49
This commit is contained in:
@@ -82,18 +82,29 @@ type RemotePageConfig struct {
|
||||
// RemoteSectionDefinition is the stable composition contract. Clients render only
|
||||
// known component types and ignore definitions introduced by newer gateways.
|
||||
type RemoteSectionDefinition struct {
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Position int `json:"position"`
|
||||
DataSource string `json:"dataSource"`
|
||||
Component string `json:"component"`
|
||||
MaxItems int `json:"maxItems,omitempty"`
|
||||
Destination string `json:"destination,omitempty"`
|
||||
Settings map[string]any `json:"settings,omitempty"`
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Position int `json:"position"`
|
||||
DataSource string `json:"dataSource"`
|
||||
Component string `json:"component"`
|
||||
MaxItems int `json:"maxItems,omitempty"`
|
||||
Destination string `json:"destination,omitempty"`
|
||||
// Layout overrides the card shape a mediaRow draws: "poster" forces upright poster
|
||||
// cards, "thumb" forces the wide landscape cards Continue Watching uses. Empty leaves
|
||||
// the client's automatic choice (episodes landscape, everything else poster) alone.
|
||||
Layout string `json:"layout,omitempty"`
|
||||
Settings map[string]any `json:"settings,omitempty"`
|
||||
}
|
||||
|
||||
// SectionLayoutPoster and SectionLayoutThumb are the two explicit card shapes an operator
|
||||
// can pin a row to; anything else means "let the client decide".
|
||||
const (
|
||||
SectionLayoutPoster = "poster"
|
||||
SectionLayoutThumb = "thumb"
|
||||
)
|
||||
|
||||
type RemoteContinueWatching struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
IncludeNextUp bool `json:"includeNextUp"`
|
||||
@@ -321,6 +332,9 @@ func validateRemoteConfigSections(document RemoteConfig) error {
|
||||
if section.Position < 0 || section.MaxItems < 0 || section.MaxItems > 500 {
|
||||
return fmt.Errorf("remote configuration section has an invalid position or item limit")
|
||||
}
|
||||
if section.Layout != "" && section.Layout != SectionLayoutPoster && section.Layout != SectionLayoutThumb {
|
||||
return fmt.Errorf("remote configuration section %q has an invalid layout", section.ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user