resolvers

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2022 License: GPL-3.0 Imports: 29 Imported by: 1

Documentation

Overview

Package resolvers implements resolvers for the GraphQL interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNoAuthorisationError

func CreateNoAuthorisationError() error

CreateNoAuthorisationError returns a standard error for unauthorised requests.

func GraphiQLHandler

func GraphiQLHandler(w http.ResponseWriter, r *http.Request)

GraphiQLHandler returns graphql handler.

func InitSchema

func InitSchema(env *app.MetadataContext) *graphql.Schema

InitSchema inits the graphql schema.

func NewRelayHandler

func NewRelayHandler(env *app.MetadataContext) (*graphql.Schema, *relay.Handler)

NewRelayHandler handles graphql requests.

Types

type BoolResponseResolver

type BoolResponseResolver struct {
	// contains filtered or unexported fields
}

BoolResponseResolver is a resolver with a bool success flag

func (*BoolResponseResolver) Success

func (bs *BoolResponseResolver) Success() bool

Success resolves success

type ByCreationDate

type ByCreationDate []sortable

ByCreationDate is a sortable type to sort by creation date.

func (ByCreationDate) Len

func (a ByCreationDate) Len() int

func (ByCreationDate) Less

func (a ByCreationDate) Less(i, j int) bool

func (ByCreationDate) Swap

func (a ByCreationDate) Swap(i, j int)

type ByUpdatedAt

type ByUpdatedAt []sortable

ByUpdatedAt is a sortable type to sort by updated_at date.

func (ByUpdatedAt) Len

func (a ByUpdatedAt) Len() int

func (ByUpdatedAt) Less

func (a ByUpdatedAt) Less(i, j int) bool

func (ByUpdatedAt) Swap

func (a ByUpdatedAt) Swap(i, j int)

type CreateSTResponse

type CreateSTResponse struct {
	Error             *ErrorResolver
	Jwt               string
	MetadataPath      string
	DASHStreamingPath string
	HLSStreamingPath  string
	Streams           []*StreamResolver
}

CreateSTResponse holds new jwt data.

type CreateSTResponseResolver

type CreateSTResponseResolver struct {
	// contains filtered or unexported fields
}

CreateSTResponseResolver resolves CreateSTResponse.

func (*CreateSTResponseResolver) DASHStreamingPath

func (r *CreateSTResponseResolver) DASHStreamingPath() string

DASHStreamingPath returns URI to DASH manifest.

func (*CreateSTResponseResolver) Error

Error returns error.

func (*CreateSTResponseResolver) HLSStreamingPath

func (r *CreateSTResponseResolver) HLSStreamingPath() string

HLSStreamingPath returns URI to HLS manifest.

func (*CreateSTResponseResolver) Jwt

Jwt returns streaming token.

func (*CreateSTResponseResolver) MetadataPath

func (r *CreateSTResponseResolver) MetadataPath() string

MetadataPath has the path to the various metadata codecs

func (*CreateSTResponseResolver) Streams added in v0.2.0

func (r *CreateSTResponseResolver) Streams() []*StreamResolver

Streams returns all known streams for the file in question

type EpisodeAddedEventResolver added in v0.3.3

type EpisodeAddedEventResolver struct {
	// contains filtered or unexported fields
}

func (*EpisodeAddedEventResolver) Episode added in v0.3.3

type EpisodeDeletedEventResolver added in v0.3.3

type EpisodeDeletedEventResolver struct {
	// contains filtered or unexported fields
}

func (*EpisodeDeletedEventResolver) EpisodeUUID added in v0.3.3

func (r *EpisodeDeletedEventResolver) EpisodeUUID() string

type EpisodeFileResolver

type EpisodeFileResolver struct {
	// contains filtered or unexported fields
}

EpisodeFileResolver resolves episodefile.

func (*EpisodeFileResolver) FileName

func (r *EpisodeFileResolver) FileName() string

FileName returns filename.

func (*EpisodeFileResolver) FilePath

func (r *EpisodeFileResolver) FilePath() (string, error)

FilePath returns filesystem path to file.

func (*EpisodeFileResolver) FileSize

func (r *EpisodeFileResolver) FileSize() string

FileSize returns episode filesize

func (*EpisodeFileResolver) Library added in v0.2.0

func (r *EpisodeFileResolver) Library() *LibraryResolver

Library returns library

func (*EpisodeFileResolver) Streams

func (r *EpisodeFileResolver) Streams() (streams []*StreamResolver)

Streams return stream information.

func (*EpisodeFileResolver) TotalDuration

func (r *EpisodeFileResolver) TotalDuration() *float64

TotalDuration returns the total duration in seconds based on the first encountered videostream.

func (*EpisodeFileResolver) UUID

func (r *EpisodeFileResolver) UUID() string

UUID returns uuid.

type EpisodeResolver

type EpisodeResolver struct {
	// contains filtered or unexported fields
}

EpisodeResolver resolves episode.

func (*EpisodeResolver) AirDate

func (r *EpisodeResolver) AirDate() string

AirDate returns air date.

func (*EpisodeResolver) EpisodeNumber

func (r *EpisodeResolver) EpisodeNumber() int32

EpisodeNumber returns episode number.

func (*EpisodeResolver) Files

func (r *EpisodeResolver) Files() (files []*EpisodeFileResolver)

Files return all files for this episode.

func (*EpisodeResolver) Name

func (r *EpisodeResolver) Name() string

Name returns name.

func (*EpisodeResolver) Overview

func (r *EpisodeResolver) Overview() string

Overview returns overview.

func (*EpisodeResolver) PlayState

func (r *EpisodeResolver) PlayState(ctx context.Context) *PlayStateResolver

PlayState returns episode playstate information.

func (*EpisodeResolver) Season

func (r *EpisodeResolver) Season() *SeasonResolver

Season returns the season the episode belongs to.

func (*EpisodeResolver) StillPath

func (r *EpisodeResolver) StillPath() string

StillPath returns uri to still image.

func (*EpisodeResolver) TmdbID

func (r *EpisodeResolver) TmdbID() int32

TmdbID returns tmdb id.

func (*EpisodeResolver) UUID

func (r *EpisodeResolver) UUID() string

UUID returns uuid.

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is a generic user level error.

func CreateErr

func CreateErr(err error) Error

CreateErr creates an error object with the given error.

type ErrorResolver

type ErrorResolver struct {
	// contains filtered or unexported fields
}

ErrorResolver holds error information.

func CreateErrResolver

func CreateErrResolver(err error) *ErrorResolver

CreateErrResolver creates a resolver around the given error.

func (*ErrorResolver) HasError

func (r *ErrorResolver) HasError() bool

HasError returns bool if an error has been found.

func (*ErrorResolver) Message

func (r *ErrorResolver) Message() string

Message returns the error message.

type InviteResolver

type InviteResolver struct {
	// contains filtered or unexported fields
}

InviteResolver is a resolver for the invite model.

func (*InviteResolver) Code

func (ir *InviteResolver) Code() *string

Code returns the invite code.

func (*InviteResolver) User

func (ir *InviteResolver) User() (*UserResolver, error)

User returns the user who redeemed this invite.

type LibResResolv

type LibResResolv struct {
	// contains filtered or unexported fields
}

LibResResolv holds a library response.

func (*LibResResolv) Error

func (r *LibResResolv) Error() *ErrorResolver

Error returns an error.

func (*LibResResolv) Library

func (r *LibResResolv) Library() *LibraryResolver

Library returns the library.

type Library

type Library struct {
	db.Library
	Movies   []*MovieResolver
	Episodes []*EpisodeResolver
}

Library wrapper around the db.Library package so it can contain related resolvers.

type LibraryResolver

type LibraryResolver struct {
	// contains filtered or unexported fields
}

LibraryResolver resolver for Library.

func (*LibraryResolver) Backend added in v0.2.0

func (r *LibraryResolver) Backend() int32

Backend returns library's backend type

func (*LibraryResolver) Episodes

func (r *LibraryResolver) Episodes() (eps []*EpisodeResolver)

Episodes returns episodes in Library.

func (*LibraryResolver) FilePath

func (r *LibraryResolver) FilePath() string

FilePath returns filesystem path for library.

func (*LibraryResolver) Healthy added in v0.2.0

func (r *LibraryResolver) Healthy() bool

Healthy returns library name

func (*LibraryResolver) ID

func (r *LibraryResolver) ID() int32

ID returns library ID

func (*LibraryResolver) IsRefreshing added in v0.1.2

func (r *LibraryResolver) IsRefreshing() bool

IsRefreshing tells us whether the library is currently doing a scan.

func (*LibraryResolver) Kind

func (r *LibraryResolver) Kind() int32

Kind returns library type.

func (*LibraryResolver) Movies

func (r *LibraryResolver) Movies(ctx context.Context) []*MovieResolver

Movies returns movies in Library.

func (*LibraryResolver) Name

func (r *LibraryResolver) Name() string

Name returns library name

func (*LibraryResolver) RcloneName added in v0.2.0

func (r *LibraryResolver) RcloneName() *string

RcloneName returns library Rclonename

func (*LibraryResolver) Series added in v0.4.0

func (r *LibraryResolver) Series() (series []*SeriesResolver)

Series return seasons based on episodes in a Library.

type LibraryResponse

type LibraryResponse struct {
	Error   *ErrorResolver
	Library *LibraryResolver
}

LibraryResponse generic response.

type MediaItemResolver

type MediaItemResolver struct {
	// contains filtered or unexported fields
}

MediaItemResolver is a resolver around media types.

func (*MediaItemResolver) ToEpisode

func (r *MediaItemResolver) ToEpisode() (*EpisodeResolver, bool)

ToEpisode tries to convert media to Episode

func (*MediaItemResolver) ToMovie

func (r *MediaItemResolver) ToMovie() (*MovieResolver, bool)

ToMovie tries to convert media to Movie

type MediaStatsResolver added in v0.4.0

type MediaStatsResolver struct{}

func (*MediaStatsResolver) EpisodeCount added in v0.4.0

func (r *MediaStatsResolver) EpisodeCount() (int32, error)

func (*MediaStatsResolver) MovieCount added in v0.4.0

func (r *MediaStatsResolver) MovieCount() (int32, error)

func (*MediaStatsResolver) SeasonCount added in v0.4.0

func (r *MediaStatsResolver) SeasonCount() (int32, error)

func (*MediaStatsResolver) SeriesCount added in v0.4.0

func (r *MediaStatsResolver) SeriesCount() (int32, error)

type MetadataEventResolver added in v0.3.3

type MetadataEventResolver struct {
	// contains filtered or unexported fields
}

func ToEventResolver added in v0.3.3

func ToEventResolver(e *metadata.MetadataEvent) *MetadataEventResolver

func (*MetadataEventResolver) ToEpisodeAddedEvent added in v0.3.3

func (r *MetadataEventResolver) ToEpisodeAddedEvent() (*EpisodeAddedEventResolver, bool)

func (*MetadataEventResolver) ToEpisodeDeletedEvent added in v0.3.3

func (r *MetadataEventResolver) ToEpisodeDeletedEvent() (*EpisodeDeletedEventResolver, bool)

func (*MetadataEventResolver) ToMovieAddedEvent added in v0.3.3

func (r *MetadataEventResolver) ToMovieAddedEvent() (*MovieAddedEventResolver, bool)

func (*MetadataEventResolver) ToMovieDeletedEvent added in v0.3.3

func (r *MetadataEventResolver) ToMovieDeletedEvent() (*MovieDeletedEventResolver, bool)

func (*MetadataEventResolver) ToMovieUpdatedEvent added in v0.3.3

func (r *MetadataEventResolver) ToMovieUpdatedEvent() (*MovieUpdatedEventResolver, bool)

func (*MetadataEventResolver) ToSeasonAddedEvent added in v0.3.3

func (r *MetadataEventResolver) ToSeasonAddedEvent() (*SeasonAddedEventResolver, bool)

func (*MetadataEventResolver) ToSeasonDeletedEvent added in v0.3.3

func (r *MetadataEventResolver) ToSeasonDeletedEvent() (*SeasonDeletedEventResolver, bool)

func (*MetadataEventResolver) ToSeriesAddedEvent added in v0.3.3

func (r *MetadataEventResolver) ToSeriesAddedEvent() (*SeriesAddedEventResolver, bool)

func (*MetadataEventResolver) ToSeriesDeletedEvent added in v0.3.3

func (r *MetadataEventResolver) ToSeriesDeletedEvent() (*SeriesDeletedEventResolver, bool)

type MovieAddedEventResolver added in v0.3.3

type MovieAddedEventResolver struct {
	// contains filtered or unexported fields
}

func (*MovieAddedEventResolver) Movie added in v0.3.3

type MovieDeletedEventResolver added in v0.3.3

type MovieDeletedEventResolver struct {
	// contains filtered or unexported fields
}

func (*MovieDeletedEventResolver) MovieUUID added in v0.3.3

func (r *MovieDeletedEventResolver) MovieUUID() string

type MovieFileResolver

type MovieFileResolver struct {
	// contains filtered or unexported fields
}

MovieFileResolver resolves the movie information

func (*MovieFileResolver) FileName

func (r *MovieFileResolver) FileName() string

FileName returns movie filename

func (*MovieFileResolver) FilePath

func (r *MovieFileResolver) FilePath() (string, error)

FilePath returns filesystem path

func (*MovieFileResolver) FileSize

func (r *MovieFileResolver) FileSize() string

FileSize returns movie filesize

func (*MovieFileResolver) Library added in v0.2.0

func (r *MovieFileResolver) Library() *LibraryResolver

Library returns library

func (*MovieFileResolver) LibraryID

func (r *MovieFileResolver) LibraryID() int32

LibraryID returns library id

func (*MovieFileResolver) Streams

func (r *MovieFileResolver) Streams() (streams []*StreamResolver)

Streams return all streams

func (*MovieFileResolver) TotalDuration

func (r *MovieFileResolver) TotalDuration() *float64

TotalDuration returns the total duration in seconds based on the first encountered videostream.

func (*MovieFileResolver) UUID

func (r *MovieFileResolver) UUID() string

UUID returns movie uuid.

type MovieResolver

type MovieResolver struct {
	// contains filtered or unexported fields
}

MovieResolver is a resolver for movies.

func (*MovieResolver) BackdropPath

func (r *MovieResolver) BackdropPath() string

BackdropPath returns backdrop

func (*MovieResolver) Files

func (r *MovieResolver) Files() (res []*MovieFileResolver)

Files return files for movie.

func (*MovieResolver) ImdbID

func (r *MovieResolver) ImdbID() string

ImdbID returns imdb id

func (*MovieResolver) Name

func (r *MovieResolver) Name() string

Name returns movie name

func (*MovieResolver) Overview

func (r *MovieResolver) Overview() string

Overview returns movie summary

func (*MovieResolver) PlayState

func (r *MovieResolver) PlayState(ctx context.Context) *PlayStateResolver

PlayState returns playstate for given user.

func (*MovieResolver) PosterPath

func (r *MovieResolver) PosterPath() string

PosterPath returns poster

func (*MovieResolver) PosterURL added in v0.4.0

func (r *MovieResolver) PosterURL(ctx context.Context, args *posterURLArgs) string

PosterURL returns poster's URL for the given size

func (*MovieResolver) Title

func (r *MovieResolver) Title() string

Title returns movie title

func (*MovieResolver) TmdbID

func (r *MovieResolver) TmdbID() int32

TmdbID returns tmdb id

func (*MovieResolver) UUID

func (r *MovieResolver) UUID() string

UUID returns movie uuid

func (*MovieResolver) Year

func (r *MovieResolver) Year() string

Year returns year

type MovieSort added in v0.4.0

type MovieSort string

func (*MovieSort) ToString added in v0.4.0

func (ms *MovieSort) ToString() string

type MovieUpdatedEventResolver added in v0.3.3

type MovieUpdatedEventResolver struct {
	// contains filtered or unexported fields
}

func (*MovieUpdatedEventResolver) Movie added in v0.3.3

type NearbyEpisodesQueryArgs added in v0.4.0

type NearbyEpisodesQueryArgs struct {
	Uuid          string
	PreviousLimit int32
	NextLimit     int32
}

NearbyEpisodesQueryArgs contains the arguments that can be passed into the nearbyEpisodes query

type NearbyEpisodesResolver added in v0.4.0

type NearbyEpisodesResolver struct {
	// contains filtered or unexported fields
}

NearbyEpisodesResolver resolves the episodes directly before and after any given episode, identified by its UUID.

func (*NearbyEpisodesResolver) Next added in v0.4.0

Next returns the next n episodes before the one identified by the given UUID.

func (*NearbyEpisodesResolver) Previous added in v0.4.0

func (r *NearbyEpisodesResolver) Previous() ([]*EpisodeResolver, error)

Previous returns the previous n episodes before the one identified by the given UUID.

type PlayStateResolver

type PlayStateResolver struct {
	// contains filtered or unexported fields
}

PlayStateResolver resolves playstate

func (*PlayStateResolver) Finished

func (res *PlayStateResolver) Finished() bool

Finished returns a bool when content has been watched.

func (*PlayStateResolver) Playtime

func (res *PlayStateResolver) Playtime() float64

Playtime current playtime.

func (*PlayStateResolver) UUID

func (res *PlayStateResolver) UUID() string

UUID returns UUID of the mediaItem

type PlayStateResponseResolver

type PlayStateResponseResolver struct {
	// contains filtered or unexported fields
}

PlayStateResponseResolver returns whether the playstate was created.

func (*PlayStateResponseResolver) PlayState

func (res *PlayStateResponseResolver) PlayState() *PlayStateResolver

PlayState holds the ps object

func (*PlayStateResponseResolver) Success

func (res *PlayStateResponseResolver) Success() bool

Success returns true if successfully created.

func (*PlayStateResponseResolver) UUID

func (res *PlayStateResponseResolver) UUID() string

UUID mediaitem

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver container object for all resolvers.

func NewResolver added in v0.3.0

func NewResolver(env *app.MetadataContext) *Resolver

NewResolver creates a new resolver

func (*Resolver) AddLibraryManager added in v0.3.0

func (r *Resolver) AddLibraryManager(lib *db.Library)

AddLibraryManager adds a new manager

func (*Resolver) CreateLibrary

func (r *Resolver) CreateLibrary(ctx context.Context, args *createLibraryArgs) *LibResResolv

CreateLibrary creates a library.

func (*Resolver) CreatePlayState

func (r *Resolver) CreatePlayState(ctx context.Context, args *playStateArgs) *PlayStateResponseResolver

CreatePlayState creates a new playstate (or overwrite an existing one) for the given media.

func (*Resolver) CreateStreamingTicket

func (r *Resolver) CreateStreamingTicket(ctx context.Context, args *struct{ UUID string }) *CreateSTResponseResolver

CreateStreamingTicket create a new streaming request for the given content.

func (*Resolver) CreateUserInvite

func (r *Resolver) CreateUserInvite(ctx context.Context) *UserInviteResponseResolver

CreateUserInvite creates a new invite code.

func (*Resolver) DeleteLibrary

func (r *Resolver) DeleteLibrary(ctx context.Context, args struct{ ID int32 }) *LibResResolv

DeleteLibrary deletes a library.

func (*Resolver) DeleteUser

func (r *Resolver) DeleteUser(ctx context.Context, args struct{ ID int32 }) *UserResponseResolver

DeleteUser deletes the given user.

func (*Resolver) Episode

func (r *Resolver) Episode(ctx context.Context, args *mustUUIDArgs) *EpisodeResolver

Episode returns episode.

func (*Resolver) Folders added in v0.4.0

func (r *Resolver) Folders(ctx context.Context, args *folderArgs) (folders []*string)

Remotes returns all Folders in the given path, takes a FileLocator and returns all folders in the given folder

func (*Resolver) Invites

func (r *Resolver) Invites(ctx context.Context) *[]*InviteResolver

Invites returns all current invites.

func (*Resolver) Libraries

func (r *Resolver) Libraries(ctx context.Context) []*LibraryResolver

Libraries return all libraries.

func (*Resolver) MediaStats added in v0.4.0

func (r *Resolver) MediaStats(ctx context.Context) *MediaStatsResolver

MediaStats returns some stats about the media in your server

func (*Resolver) Movies

func (r *Resolver) Movies(ctx context.Context, args *movieQueryArgs) []*MovieResolver

Movies returns all movies.

func (*Resolver) MoviesChanged added in v0.3.3

func (r *Resolver) MoviesChanged(ctx context.Context) <-chan *MetadataEventResolver

func (*Resolver) NearbyEpisodes added in v0.4.0

NearbyEpisodes returns the next "x" episodes before and after the episode identified by the provided UUID.

func (*Resolver) RecentlyAdded

func (r *Resolver) RecentlyAdded(ctx context.Context) *[]*MediaItemResolver

RecentlyAdded returns recently added media content.

func (*Resolver) RefreshAgentMetadata

func (r *Resolver) RefreshAgentMetadata(ctx context.Context, args struct {
	LibraryID *int32
	UUID      *string
}) bool

RefreshAgentMetadata refreshes all metadata from agent

func (*Resolver) Remotes added in v0.2.0

func (r *Resolver) Remotes() (remotes []*string)

Remotes returns all Rclone remotes.

func (*Resolver) RescanLibraries

func (r *Resolver) RescanLibraries(ctx context.Context) bool

RescanLibraries rescans all libraries for new files.

func (*Resolver) RescanLibrary added in v0.4.0

func (r *Resolver) RescanLibrary(ctx context.Context, args struct {
	ID       *int32
	FilePath *string
}) bool

RescanLibrary can scan (parts) of a Library

func (*Resolver) Search

func (r *Resolver) Search(args *searchArgs) *[]*SearchItemResolver

Search searches for media content.

func (*Resolver) Season

func (r *Resolver) Season(ctx context.Context, args *mustUUIDArgs) *SeasonResolver

Season returns season.

func (*Resolver) SeasonChanged added in v0.3.3

func (r *Resolver) SeasonChanged(
	ctx context.Context,
	args *seasonChangedArgs) (<-chan *MetadataEventResolver, error)

func (*Resolver) Series

func (r *Resolver) Series(ctx context.Context, args *seriesQueryArgs) []*SeriesResolver

Series return series.

func (*Resolver) SeriesChanged added in v0.3.3

func (r *Resolver) SeriesChanged(ctx context.Context) <-chan *MetadataEventResolver

func (*Resolver) TmdbSearchMovies added in v0.3.0

func (r *Resolver) TmdbSearchMovies(ctx context.Context,
	args *tmdbSearchMoviesArgs) ([]*TmdbMovieSearchItemResolver, error)

func (*Resolver) TmdbSearchSeries added in v0.3.0

func (r *Resolver) TmdbSearchSeries(ctx context.Context,
	args *tmdbSearchSeriesArgs) ([]*TmdbSeriesSearchItemResolver, error)

func (*Resolver) UnidentifiedEpisodeFiles added in v0.3.0

func (r *Resolver) UnidentifiedEpisodeFiles(
	args *unidentifiedEpisodeFilesArgs) []*EpisodeFileResolver

UnidentifiedEpisodeFiles returns unidentified episode files

func (*Resolver) UnidentifiedMovieFiles added in v0.3.0

func (r *Resolver) UnidentifiedMovieFiles(
	ctx context.Context,
	args *unidentifiedMovieFilesArgs) []*MovieFileResolver

UnidentifiedMovieFiles return unidentified movie files

func (*Resolver) UpNext

func (r *Resolver) UpNext(ctx context.Context) *[]*MediaItemResolver

UpNext returns episode/movie that could populate a dashboard.

func (*Resolver) UpdateEpisodeFileMetadata added in v0.3.0

func (r *Resolver) UpdateEpisodeFileMetadata(
	ctx context.Context,
	args *struct {
		Input UpdateEpisodeFileMetadataInput
	},
) *UpdateEpisodeFileMetadataPayloadResolver

UpdateEpisodeFileMetadata handles the updateMediaItemMetadata mutation

func (*Resolver) UpdateMovieFileMetadata added in v0.3.0

func (r *Resolver) UpdateMovieFileMetadata(
	ctx context.Context,
	args *struct{ Input UpdateMovieFileMetadataInput },
) *UpdateMovieFileMetadataPayloadResolver

UpdateMovieFileMetadata handles the updateMediaItemMetadata mutation

func (*Resolver) UpdateStreams

func (r *Resolver) UpdateStreams(args *mustUUIDArgs) bool

UpdateStreams is a resolver method for the UpdateStreams method

func (*Resolver) Users

func (r *Resolver) Users(ctx context.Context) (users []*UserResolver)

Users returns all present users.

type SearchItemResolver

type SearchItemResolver struct {
	// contains filtered or unexported fields
}

SearchItemResolver wrapper around search items.

func (*SearchItemResolver) ToMovie

func (r *SearchItemResolver) ToMovie() (*MovieResolver, bool)

ToMovie parses content to a movie.

func (*SearchItemResolver) ToSeries

func (r *SearchItemResolver) ToSeries() (*SeriesResolver, bool)

ToSeries parses content to a series.

type SeasonAddedEventResolver added in v0.3.3

type SeasonAddedEventResolver struct {
	// contains filtered or unexported fields
}

func (*SeasonAddedEventResolver) Season added in v0.3.3

type SeasonDeletedEventResolver added in v0.3.3

type SeasonDeletedEventResolver struct {
	// contains filtered or unexported fields
}

func (*SeasonDeletedEventResolver) SeasonUUID added in v0.3.3

func (r *SeasonDeletedEventResolver) SeasonUUID() string

type SeasonResolver

type SeasonResolver struct {
	// contains filtered or unexported fields
}

SeasonResolver resolves season

func (*SeasonResolver) AirDate

func (r *SeasonResolver) AirDate() string

AirDate returns seasonal air date.

func (*SeasonResolver) Episodes

func (r *SeasonResolver) Episodes() []*EpisodeResolver

Episodes returns seasonal episodes.

func (*SeasonResolver) Name

func (r *SeasonResolver) Name() string

Name returns name.

func (*SeasonResolver) Overview

func (r *SeasonResolver) Overview() string

Overview returns season overview.

func (*SeasonResolver) PosterPath

func (r *SeasonResolver) PosterPath() string

PosterPath resturn uri to poster.

func (*SeasonResolver) SeasonNumber

func (r *SeasonResolver) SeasonNumber() int32

SeasonNumber returns season number.

func (*SeasonResolver) Series

func (r *SeasonResolver) Series() *SeriesResolver

Series returns the series this season belongs to.

func (*SeasonResolver) TmdbID

func (r *SeasonResolver) TmdbID() int32

TmdbID returns tmdb id.

func (*SeasonResolver) UUID

func (r *SeasonResolver) UUID() string

UUID returns uuid.

func (*SeasonResolver) UnwatchedEpisodesCount

func (r *SeasonResolver) UnwatchedEpisodesCount(ctx context.Context) int32

UnwatchedEpisodesCount returns the amount of unwatched episodes for the given season

type SeriesAddedEventResolver added in v0.3.3

type SeriesAddedEventResolver struct {
	// contains filtered or unexported fields
}

func (*SeriesAddedEventResolver) Series added in v0.3.3

type SeriesDeletedEventResolver added in v0.3.3

type SeriesDeletedEventResolver struct {
	// contains filtered or unexported fields
}

func (*SeriesDeletedEventResolver) SeriesUUID added in v0.3.3

func (r *SeriesDeletedEventResolver) SeriesUUID() string

type SeriesResolver

type SeriesResolver struct {
	// contains filtered or unexported fields
}

SeriesResolver resolvers a serie.

func (*SeriesResolver) BackdropPath

func (r *SeriesResolver) BackdropPath() string

BackdropPath returns uri to backdrop.

func (*SeriesResolver) FirstAirDate

func (r *SeriesResolver) FirstAirDate() string

FirstAirDate returns air date.

func (*SeriesResolver) Name

func (r *SeriesResolver) Name() string

Name returns name.

func (*SeriesResolver) OriginalName added in v0.4.0

func (r *SeriesResolver) OriginalName() string

OriginalName returns original name

func (*SeriesResolver) Overview

func (r *SeriesResolver) Overview() string

Overview returns overview.

func (*SeriesResolver) PosterPath

func (r *SeriesResolver) PosterPath() string

PosterPath resturn uri to poster.

func (*SeriesResolver) Seasons

func (r *SeriesResolver) Seasons() []*SeasonResolver

Seasons returns all seasons.

func (*SeriesResolver) Status

func (r *SeriesResolver) Status() string

Status returns serie status.

func (*SeriesResolver) TmdbID

func (r *SeriesResolver) TmdbID() int32

TmdbID returns tmdb id

func (*SeriesResolver) Type

func (r *SeriesResolver) Type() string

Type returns content type.

func (*SeriesResolver) UUID

func (r *SeriesResolver) UUID() string

UUID returns uuid.

func (*SeriesResolver) UnwatchedEpisodesCount

func (r *SeriesResolver) UnwatchedEpisodesCount(ctx context.Context) int32

UnwatchedEpisodesCount returns the amount of unwatched episodes for the given season

type SeriesSort added in v0.4.0

type SeriesSort string

func (*SeriesSort) ToString added in v0.4.0

func (ss *SeriesSort) ToString() string

type StreamResolver

type StreamResolver struct {
	// contains filtered or unexported fields
}

StreamResolver resolves stream information.

func (*StreamResolver) BitRate

func (r *StreamResolver) BitRate() *int32

BitRate returns stream bitrate if a fixed bitrate is used.

func (*StreamResolver) CodecMime

func (r *StreamResolver) CodecMime() *string

CodecMime returns codecmime

func (*StreamResolver) CodecName

func (r *StreamResolver) CodecName() *string

CodecName returns codecname

func (*StreamResolver) Language

func (r *StreamResolver) Language() *string

Language returns language information for the given string if present.

func (*StreamResolver) Profile

func (r *StreamResolver) Profile() *string

Profile returns codec profile.

func (*StreamResolver) Resolution

func (r *StreamResolver) Resolution() *string

Resolution returns stream resolution if present.

func (*StreamResolver) StreamID

func (r *StreamResolver) StreamID() *int32

StreamID returns stream id.

func (*StreamResolver) StreamType

func (r *StreamResolver) StreamType() *string

StreamType returns stream type (sub/audio/video)

func (*StreamResolver) StreamURL added in v0.2.0

func (r *StreamResolver) StreamURL() *string

StreamURL returns a streamURL

func (*StreamResolver) Title

func (r *StreamResolver) Title() *string

Title returns stream title if present.

func (*StreamResolver) TotalDuration

func (r *StreamResolver) TotalDuration() *float64

TotalDuration returns the total duriation of the stream in seconds.

type TmdbMovieSearchItemResolver added in v0.3.0

type TmdbMovieSearchItemResolver struct {
	// contains filtered or unexported fields
}

func (*TmdbMovieSearchItemResolver) BackdropPath added in v0.3.0

func (r *TmdbMovieSearchItemResolver) BackdropPath() string

func (*TmdbMovieSearchItemResolver) Overview added in v0.3.0

func (r *TmdbMovieSearchItemResolver) Overview() string

func (*TmdbMovieSearchItemResolver) PosterPath added in v0.3.0

func (r *TmdbMovieSearchItemResolver) PosterPath() string

func (*TmdbMovieSearchItemResolver) ReleaseYear added in v0.3.0

func (r *TmdbMovieSearchItemResolver) ReleaseYear() (*int32, error)

func (*TmdbMovieSearchItemResolver) Title added in v0.3.0

func (*TmdbMovieSearchItemResolver) TmdbID added in v0.3.0

func (r *TmdbMovieSearchItemResolver) TmdbID() int32

type TmdbSeriesSearchItemResolver added in v0.3.0

type TmdbSeriesSearchItemResolver struct {
	// contains filtered or unexported fields
}

func (*TmdbSeriesSearchItemResolver) BackdropPath added in v0.3.0

func (r *TmdbSeriesSearchItemResolver) BackdropPath() string

func (*TmdbSeriesSearchItemResolver) FirstAirYear added in v0.3.0

func (r *TmdbSeriesSearchItemResolver) FirstAirYear() (*int32, error)

func (*TmdbSeriesSearchItemResolver) Name added in v0.3.0

func (*TmdbSeriesSearchItemResolver) PosterPath added in v0.3.0

func (r *TmdbSeriesSearchItemResolver) PosterPath() string

func (*TmdbSeriesSearchItemResolver) TmdbID added in v0.3.0

func (r *TmdbSeriesSearchItemResolver) TmdbID() int32

type UpdateEpisodeFileMetadataInput added in v0.3.0

type UpdateEpisodeFileMetadataInput struct {
	EpisodeFileUUID *string
	SeriesUUID      *string
	TmdbID          int32
}

UpdateEpisodeFileMetadataInput is a request

type UpdateEpisodeFileMetadataPayloadResolver added in v0.3.0

type UpdateEpisodeFileMetadataPayloadResolver struct {
	// contains filtered or unexported fields
}

UpdateEpisodeFileMetadataPayloadResolver is the payload

func (*UpdateEpisodeFileMetadataPayloadResolver) Error added in v0.3.0

Error returns error.

type UpdateMovieFileMetadataInput added in v0.3.0

type UpdateMovieFileMetadataInput struct {
	MovieFileUUID string
	TmdbID        int32
}

UpdateMovieFileMetadataInput is a request

type UpdateMovieFileMetadataPayloadResolver added in v0.3.0

type UpdateMovieFileMetadataPayloadResolver struct {
	// contains filtered or unexported fields
}

UpdateMovieFileMetadataPayloadResolver is the payload

func (*UpdateMovieFileMetadataPayloadResolver) Error added in v0.3.0

Error returns error.

func (*UpdateMovieFileMetadataPayloadResolver) MediaItem added in v0.3.0

MediaItem returns the media item

type UserInviteResponse

type UserInviteResponse struct {
	Error *ErrorResolver
	Code  string
}

UserInviteResponse response when creating a new invite.

type UserInviteResponseResolver

type UserInviteResponseResolver struct {
	// contains filtered or unexported fields
}

UserInviteResponseResolver resolver.

func (*UserInviteResponseResolver) Code

Code returns the given invite code.

func (*UserInviteResponseResolver) Error

Error returns the error for the given object.

type UserResolver

type UserResolver struct {
	// contains filtered or unexported fields
}

UserResolver resolves user.

func (*UserResolver) Admin

func (r *UserResolver) Admin() bool

Admin returns admin status.

func (*UserResolver) ID

func (r *UserResolver) ID() int32

ID returns the unique UserID

func (*UserResolver) Username

func (r *UserResolver) Username() string

Username returns username.

type UserResponse

type UserResponse struct {
	Error *ErrorResolver
	User  *UserResolver
}

UserResponse holds user information and error if needed.

type UserResponseResolver

type UserResponseResolver struct {
	// contains filtered or unexported fields
}

UserResponseResolver resolves userresponse.

func (*UserResponseResolver) Error

func (r *UserResponseResolver) Error() *ErrorResolver

Error returns error.

func (*UserResponseResolver) User

User returns user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL