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 {
// Login forces a new OAuth authorization flow, clearing any existing tokens first.
Login(ctx context.Context) error
// Logout removes all tokens from memory and the cache file. It never fails,
// even if the user is not logged in.
Logout(ctx context.Context)
// AuthStatus checks if the user is logged in and whether the tokens are valid.
// Returns (loggedIn bool, err error):
// - loggedIn=false, err=nil: not logged in (no refresh token present)
// - loggedIn=true, err=nil: logged in and refresh token is valid
// - loggedIn=true, err!=nil: tokens present but refresh failed
AuthStatus(ctx context.Context) (bool, error)
}
type SpotifyPlaylister ¶
Click to show internal directories.
Click to hide internal directories.