Documentation ¶
Overview ¶
Package server Takeout API
This is the service API for the Takeout media server.
Terms Of Service:
TOS is TBD ¶
Schemes: https Host: yourhost.com BasePath: /api Version: 0.0.1 License: AGPLv3 https://www.gnu.org/licenses/agpl-3.0.en.html Contact: defsub@defsub.com SecurityDefinitions:
Cookie: type: apiKey name: Cookie description: send Cookie Takeout={token} in: header Bearer: type: apiKey name: Authorization description: send Authorization Bearer {token} scheme: bearer in: header
Security:
- Bearer:
- Cookie:
Consumes: - application/json Produces: - application/json
swagger:meta
Package server is the Takeout server.
Index ¶
- Constants
- Variables
- func ArtistView(ctx Context, artist model.Artist) *Artist
- func ArtistsView(ctx Context) *Artists
- func EpisodeView(ctx Context, e model.Episode) *Episode
- func GenreView(ctx Context, name string) *Genre
- func HomeView(ctx Context) *Home
- func IndexView(ctx Context) *Index
- func Job(config *config.Config, name string) error
- func KeywordView(ctx Context, name string) *Keyword
- func MovieView(ctx Context, m model.Movie) *Movie
- func MoviesView(ctx Context) *Movies
- func OffsetView(ctx Context, offset model.Offset) *Offset
- func PlaylistView(ctx Context, playlist model.Playlist) *Playlist
- func PlaylistsView(ctx Context, playlists []model.Playlist) *Playlists
- func PodcastsSubscribedView(ctx Context) *Podcasts
- func PodcastsView(ctx Context) *Podcasts
- func PopularView(ctx Context, artist model.Artist) *Popular
- func ProfileView(ctx Context, p model.Person) *Profile
- func ProgressView(ctx Context) *Progress
- func RadioView(ctx Context) *Radio
- func RefreshStation(ctx Context, s *model.Station) *spiff.Playlist
- func ReleaseView(ctx Context, release model.Release) *Release
- func Resolve(ctx Context, plist *spiff.Playlist) (err error)
- func ResolveActivityTracksPlaylist(ctx Context, v *view.TrackStats, res, path string) *spiff.Playlist
- func ResolveArtistPlaylist(ctx Context, v *view.Artist, path, nref string) *spiff.Playlist
- func ResolveMoviePlaylist(ctx Context, v *view.Movie, path string) *spiff.Playlist
- func ResolveReleasePlaylist(ctx Context, v *view.Release, path string) *spiff.Playlist
- func ResolveSeriesEpisodePlaylist(ctx Context, series *view.Series, v *view.Episode, path string) *spiff.Playlist
- func ResolveSeriesPlaylist(ctx Context, v *view.Series, path string) *spiff.Playlist
- func ResolveTrackPlaylist(ctx Context, track model.Track, path string) *spiff.Playlist
- func SearchView(ctx Context, query string) *Search
- func SeriesView(ctx Context, s model.Series) *Series
- func Serve(config *config.Config) error
- func SinglesView(ctx Context, artist model.Artist) *Singles
- func TrackHistoryView(ctx Context, d date.DateRange) *TrackHistory
- func TrackStatsView(ctx Context, d date.DateRange) *TrackStats
- func WantListView(ctx Context, artist model.Artist) *WantList
- func WatchView(ctx Context, m model.Movie) *Watch
- type ArtistResponse
- type ArtistsResponse
- type Context
- type EpisodeResponse
- type GenreResponse
- type HomeResponse
- type IndexResponse
- type KeywordResponse
- type LoginParam
- type Media
- type MovieResponse
- type MoviesResponse
- type OffsetResponse
- type PlaylistResponse
- type PodcastsResponse
- type PopularResponse
- type ProfileResponse
- type ProgressResponse
- type RadioResponse
- type ReleaseResponse
- type RequestContext
- func (ctx RequestContext) Activity() *activity.Activity
- func (ctx RequestContext) ArtistBackground(a model.Artist) string
- func (ctx RequestContext) ArtistImage(a model.Artist) string
- func (ctx RequestContext) Auth() *auth.Auth
- func (ctx RequestContext) Config() *config.Config
- func (ctx RequestContext) EpisodeImage(e model.Episode) string
- func (ctx RequestContext) FindArtist(id string) (model.Artist, error)
- func (ctx RequestContext) FindEpisode(id string) (model.Episode, error)
- func (ctx RequestContext) FindMovie(id string) (model.Movie, error)
- func (ctx RequestContext) FindPlaylist(id string) (model.Playlist, error)
- func (ctx RequestContext) FindRelease(id string) (model.Release, error)
- func (ctx RequestContext) FindReleaseTracks(release model.Release) []model.Track
- func (ctx RequestContext) FindSeries(id string) (model.Series, error)
- func (ctx RequestContext) FindSeriesEpisodes(series model.Series) []model.Episode
- func (ctx RequestContext) FindStation(id string) (model.Station, error)
- func (ctx RequestContext) FindTrack(id string) (model.Track, error)
- func (ctx RequestContext) ImageClient() client.Getter
- func (RequestContext) LocateEpisode(e model.Episode) string
- func (RequestContext) LocateMovie(v model.Movie) string
- func (RequestContext) LocateTrack(t model.Track) string
- func (ctx RequestContext) MovieImage(m model.Movie) string
- func (ctx RequestContext) Music() *music.Music
- func (ctx RequestContext) Podcast() *podcast.Podcast
- func (ctx RequestContext) Progress() *progress.Progress
- func (ctx RequestContext) Session() auth.Session
- func (ctx RequestContext) Template() *template.Template
- func (ctx RequestContext) TrackImage(t model.Track) string
- func (ctx RequestContext) User() auth.User
- func (ctx RequestContext) Video() *video.Video
- type SearchResponse
- type SeriesResponse
- type SinglesResponse
- type StatusResponse
Constants ¶
const ( ApplicationJson = "application/json" ParamID = "id" ParamRes = "res" ParamName = "name" ParamEID = "eid" ParamUUID = "uuid" QuerySearch = "q" QueryStart = "start" QueryEnd = "end" QueryTime = "time" QueryToken = "token" )
const ( AllowCookie bits = 1 << iota AllowAccessToken AllowMediaToken BearerAuthorization = "Bearer" )
const ( IntentAuth = "TAKEOUT_AUTH" IntentPlay = "TAKEOUT_PLAY" IntentNew = "TAKEOUT_NEW" UserParamCookie = "cookie" )
const ( CoverArtArchivePrefix = "https://coverartarchive.org" TMDBPrefix = "https://image.tmdb.org" FanArtPrefix = "https://assets.fanart.tv/fanart" )
const ( LoginPage = "/static/login.html" LinkPage = "/static/link.html" SuccessRedirect = "/" LinkRedirect = LinkPage LoginRedirect = LoginPage FormUser = "user" FormPass = "pass" FormCode = "code" FormPassCode = "passcode" )
Variables ¶
var ( ErrNoMedia = errors.New("media not available") ErrInvalidMethod = errors.New("invalid request method") ErrInvalidCode = errors.New("invalid code") ErrNotFound = errors.New("not found") ErrInvalidOffset = errors.New("invalid offset") ErrAccessDenied = errors.New("access denied") ErrAccessDeniedRedirect = errors.New("access denied with redirect") ErrMissingToken = errors.New("missing token") ErrMissingAccessToken = errors.New("missing access token") ErrMissingMediaToken = errors.New("missing media token") ErrMissingFileToken = errors.New("missing file token") ErrMissingCodeToken = errors.New("missing code token") ErrMissingCookie = errors.New("missing cookie") ErrInvalidSession = errors.New("invalid session") ErrInvalidUUID = errors.New("invalid uuid") ErrInvalidContent = errors.New("invalid content") ErrMissingTitle = errors.New("missing title") ErrMissingParameter = errors.New("missing required parameter") ErrInvalidParameter = errors.New("invalid parameter") )
Functions ¶
func ArtistView ¶
func ArtistsView ¶
func ArtistsView(ctx Context) *Artists
func EpisodeView ¶
func KeywordView ¶
func MoviesView ¶
func MoviesView(ctx Context) *Movies
func OffsetView ¶
func PlaylistView ¶ added in v0.17.0
func PlaylistsView ¶ added in v0.17.0
func PodcastsSubscribedView ¶ added in v0.11.8
func PodcastsSubscribedView(ctx Context) *Podcasts
func PodcastsView ¶
func PodcastsView(ctx Context) *Podcasts
func PopularView ¶
func ProfileView ¶
func ProgressView ¶
func ProgressView(ctx Context) *Progress
func ReleaseView ¶
func ResolveArtistPlaylist ¶
func ResolveMoviePlaylist ¶
func ResolveReleasePlaylist ¶
func ResolveSeriesPlaylist ¶
func ResolveTrackPlaylist ¶ added in v0.18.1
func SearchView ¶
func SeriesView ¶
func SinglesView ¶
func TrackHistoryView ¶ added in v0.21.0
func TrackStatsView ¶ added in v0.21.0
func WantListView ¶
Types ¶
type ArtistResponse ¶
swagger:response
type ArtistsResponse ¶
swagger:response
type Context ¶
type Context interface { Activity() *activity.Activity Auth() *auth.Auth Config() *config.Config Music() *music.Music Podcast() *podcast.Podcast Progress() *progress.Progress Template() *template.Template User() auth.User Session() auth.Session Video() *video.Video ImageClient() client.Getter LocateTrack(model.Track) string LocateMovie(model.Movie) string LocateEpisode(model.Episode) string FindArtist(string) (model.Artist, error) FindRelease(string) (model.Release, error) FindReleaseTracks(model.Release) []model.Track FindTrack(string) (model.Track, error) FindStation(string) (model.Station, error) FindPlaylist(string) (model.Playlist, error) FindMovie(string) (model.Movie, error) FindSeries(string) (model.Series, error) FindSeriesEpisodes(model.Series) []model.Episode FindEpisode(string) (model.Episode, error) TrackImage(model.Track) string ArtistImage(model.Artist) string ArtistBackground(model.Artist) string MovieImage(model.Movie) string EpisodeImage(model.Episode) string }
type EpisodeResponse ¶
swagger:response
type GenreResponse ¶
swagger:response
type HomeResponse ¶
swagger:response
type IndexResponse ¶
swagger:response
type KeywordResponse ¶
swagger:response
type LoginParam ¶
type LoginParam struct { // in: body Body struct { // contains filtered or unexported fields } }
swagger:parameters Login
type MovieResponse ¶
swagger:response
type MoviesResponse ¶
swagger:response
type OffsetResponse ¶
swagger:response
type PlaylistResponse ¶
swagger:response
type PodcastsResponse ¶
swagger:response
type PopularResponse ¶
swagger:response
type ProfileResponse ¶
swagger:response
type ProgressResponse ¶
swagger:response
type RadioResponse ¶
swagger:response
type ReleaseResponse ¶
swagger:response
type RequestContext ¶
type RequestContext struct {
// contains filtered or unexported fields
}
func (RequestContext) Activity ¶
func (ctx RequestContext) Activity() *activity.Activity
func (RequestContext) ArtistBackground ¶
func (ctx RequestContext) ArtistBackground(a model.Artist) string
func (RequestContext) ArtistImage ¶
func (ctx RequestContext) ArtistImage(a model.Artist) string
func (RequestContext) Auth ¶
func (ctx RequestContext) Auth() *auth.Auth
func (RequestContext) Config ¶
func (ctx RequestContext) Config() *config.Config
func (RequestContext) EpisodeImage ¶
func (ctx RequestContext) EpisodeImage(e model.Episode) string
func (RequestContext) FindArtist ¶
func (ctx RequestContext) FindArtist(id string) (model.Artist, error)
func (RequestContext) FindEpisode ¶
func (ctx RequestContext) FindEpisode(id string) (model.Episode, error)
func (RequestContext) FindMovie ¶
func (ctx RequestContext) FindMovie(id string) (model.Movie, error)
func (RequestContext) FindPlaylist ¶ added in v0.17.0
func (ctx RequestContext) FindPlaylist(id string) (model.Playlist, error)
func (RequestContext) FindRelease ¶
func (ctx RequestContext) FindRelease(id string) (model.Release, error)
func (RequestContext) FindReleaseTracks ¶ added in v0.14.0
func (ctx RequestContext) FindReleaseTracks(release model.Release) []model.Track
func (RequestContext) FindSeries ¶
func (ctx RequestContext) FindSeries(id string) (model.Series, error)
func (RequestContext) FindSeriesEpisodes ¶ added in v0.14.0
func (ctx RequestContext) FindSeriesEpisodes(series model.Series) []model.Episode
func (RequestContext) FindStation ¶
func (ctx RequestContext) FindStation(id string) (model.Station, error)
func (RequestContext) FindTrack ¶
func (ctx RequestContext) FindTrack(id string) (model.Track, error)
func (RequestContext) ImageClient ¶
func (ctx RequestContext) ImageClient() client.Getter
func (RequestContext) LocateEpisode ¶
func (RequestContext) LocateEpisode(e model.Episode) string
func (RequestContext) LocateMovie ¶
func (RequestContext) LocateMovie(v model.Movie) string
func (RequestContext) LocateTrack ¶
func (RequestContext) LocateTrack(t model.Track) string
func (RequestContext) MovieImage ¶
func (ctx RequestContext) MovieImage(m model.Movie) string
func (RequestContext) Music ¶
func (ctx RequestContext) Music() *music.Music
func (RequestContext) Podcast ¶
func (ctx RequestContext) Podcast() *podcast.Podcast
func (RequestContext) Progress ¶
func (ctx RequestContext) Progress() *progress.Progress
func (RequestContext) Session ¶
func (ctx RequestContext) Session() auth.Session
func (RequestContext) Template ¶
func (ctx RequestContext) Template() *template.Template
func (RequestContext) TrackImage ¶
func (ctx RequestContext) TrackImage(t model.Track) string
func (RequestContext) User ¶
func (ctx RequestContext) User() auth.User
func (RequestContext) Video ¶
func (ctx RequestContext) Video() *video.Video
type SearchResponse ¶
swagger:response
type SeriesResponse ¶
swagger:response
type SinglesResponse ¶
swagger:response