Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { ID string `json:"id,omitempty"` URI string `json:"uri,omitempty"` Name string `json:"name,omitempty"` Type ItemType `json:"type,omitempty"` Duration time.Duration `json:"duration,omitempty"` AddedAt time.Time `json:"added_at,omitempty"` // Only for episode type ReleaseDate string `json:"release_date,omitempty"` // For comparison ReleaseDateTime time.Time `json:"-"` }
func (*Item) GetFallbackDate ¶
func (*Item) TryResolveReleaseDate ¶
type PlaylistFilterConfig ¶
type PlaylistFilterConfig struct { TargetPlaylistID string `json:"target_playlist_id" validate:"required"` Description string `json:"description" validate:"omitempty"` Sources []*PlaylistFilterSource `json:"sources" validate:"required,dive,required"` // OrderBy is the order of the items in the target playlist // For items having no added time (e.g. shows), the release date is used as fallback OrderBy PlaylistOrder `json:"order_by" validate:"omitempty,oneof=added_at release_date"` AddLatestUpdateDateToDescription bool `json:"add_latest_update_date_to_description" validate:"-"` LatestUpdateDateLocation string `json:"latest_update_date_location" validate:"-"` }
type PlaylistFilterConfigSlice ¶
type PlaylistFilterConfigSlice []*PlaylistFilterConfig
type PlaylistFilterSource ¶
type PlaylistFilterSource struct { PlaylistID string `json:"playlist_id" validate:"required_without=ShowID"` ShowID string `json:"show_id" validate:"required_without=PlaylistID"` Filters *PlaylistFilters `json:"filters" validate:"required"` }
type PlaylistFilters ¶
type PlaylistOrder ¶
type PlaylistOrder string
const ( PlaylistOrderAddedAt PlaylistOrder = "added_at" PlaylistOrderReleaseDate PlaylistOrder = "release_date" )
type Spotifier ¶
type Spotifier interface { SpotifiyAuther SpotifyPlaylister SpotifyShower }
type SpotifiyAuther ¶
type SpotifiyAuther interface { // GetUserToken returns the latest user token, which may be expired. // If the token has never been fetched, this will run authorization process. GetUserToken(ctx context.Context) (string, error) // GetNewUserToken returns a new user token, which is never expired, using the refresh token if present // or running the authorization process otherwise. GetNewUserToken(ctx context.Context) (string, error) // ResetUserTokens resets the user tokens, including the refresh token. // This should be used only for testing ResetUserTokens(ctx context.Context) }
type SpotifyPlaylister ¶
Click to show internal directories.
Click to hide internal directories.