Documentation ¶
Overview ¶
Package jellyfin implements connection to Jellyfin server. It supports websocket for receiving commands from server and updating status via http post.
Index ¶
- type Cache
- func (c *Cache) Count() int
- func (c *Cache) Delete(id models.Id)
- func (c *Cache) Get(id models.Id) (models.Item, bool)
- func (c *Cache) GetAlbum(id models.Id) *models.Album
- func (c *Cache) GetArtist(id models.Id) *models.Artist
- func (c *Cache) GetBatch(ids []models.Id) ([]models.Item, bool)
- func (c *Cache) GetList(id string) ([]models.Id, bool)
- func (c *Cache) GetPlaylist(id models.Id) *models.Playlist
- func (c *Cache) GetSong(id models.Id) *models.Song
- func (c *Cache) Put(id models.Id, item models.Item, expire bool)
- func (c *Cache) PutBatch(items []models.Item, expire bool) error
- func (c *Cache) PutList(id string, data []models.Id)
- type Jellyfin
- func (jf *Jellyfin) AuthOk() error
- func (jf *Jellyfin) CanCacheSongs() bool
- func (jf *Jellyfin) Connect() error
- func (jf *Jellyfin) ConnectionOk() error
- func (jf *Jellyfin) DefaultMusicView() string
- func (jf *Jellyfin) Download(song *models.Song) (io.ReadCloser, interfaces.AudioFormat, error)
- func (jf *Jellyfin) GetAlbum(id models.Id) (*models.Album, error)
- func (jf *Jellyfin) GetAlbumArtist(album *models.Album) (*models.Artist, error)
- func (jf *Jellyfin) GetAlbumArtists(query *interfaces.QueryOpts) (artistList []*models.Artist, numRecords int, err error)
- func (jf *Jellyfin) GetAlbumSongs(album models.Id) ([]*models.Song, error)
- func (jf *Jellyfin) GetAlbums(opts *interfaces.QueryOpts) (albumList []*models.Album, numRecords int, err error)
- func (jf *Jellyfin) GetArtist(id models.Id) (*models.Artist, error)
- func (jf *Jellyfin) GetArtistAlbums(id models.Id) ([]*models.Album, error)
- func (jf *Jellyfin) GetArtists(query *interfaces.QueryOpts) (artistList []*models.Artist, numRecords int, err error)
- func (jf *Jellyfin) GetCacheItems() int
- func (jf *Jellyfin) GetChildItems(id models.Id) ([]models.Item, error)
- func (jf *Jellyfin) GetConfig() config.Backend
- func (jf *Jellyfin) GetFavoriteAlbums(paging interfaces.Paging) ([]*models.Album, int, error)
- func (jf *Jellyfin) GetFavoriteArtists() ([]*models.Artist, error)
- func (jf *Jellyfin) GetGenreAlbums(genre models.IdName) ([]*models.Album, error)
- func (jf *Jellyfin) GetGenres(paging interfaces.Paging) ([]*models.IdName, int, error)
- func (jf *Jellyfin) GetId() string
- func (jf *Jellyfin) GetImageUrl(item models.Id, itemType models.ItemType) string
- func (jf *Jellyfin) GetInfo() (*models.ServerInfo, error)
- func (jf *Jellyfin) GetInstantMix(item models.Item) ([]*models.Song, error)
- func (jf *Jellyfin) GetItem(id models.Id) (models.Item, error)
- func (jf *Jellyfin) GetLatestAlbums() ([]*models.Album, error)
- func (jf *Jellyfin) GetLink(item models.Item) string
- func (jf *Jellyfin) GetParentItem(id models.Id) (models.Item, error)
- func (jf *Jellyfin) GetPlaylistSongs(playlist models.Id) ([]*models.Song, error)
- func (jf *Jellyfin) GetPlaylists() ([]*models.Playlist, error)
- func (jf *Jellyfin) GetRecentlyPlayed(paging interfaces.Paging) ([]*models.Song, int, error)
- func (jf *Jellyfin) GetSimilarAlbums(album models.Id) ([]*models.Album, error)
- func (jf *Jellyfin) GetSimilarArtists(artist models.Id) ([]*models.Artist, error)
- func (jf *Jellyfin) GetSongs(query *interfaces.QueryOpts) ([]*models.Song, int, error)
- func (jf *Jellyfin) GetSongsById(ids []models.Id) ([]*models.Song, error)
- func (jf *Jellyfin) GetUserViews()
- func (jf *Jellyfin) GetViews() ([]*models.View, error)
- func (jf *Jellyfin) RemoteControlEnabled() error
- func (jf *Jellyfin) ReportCapabilities() error
- func (jf *Jellyfin) ReportProgress(state *interfaces.ApiPlaybackState) error
- func (jf *Jellyfin) Search(query string, itemType models.ItemType, limit int) ([]models.Item, error)
- func (jf *Jellyfin) ServerId() string
- func (jf *Jellyfin) SetDefaultMusicview(id string)
- func (jf *Jellyfin) SetPlayer(p interfaces.Player)
- func (jf *Jellyfin) SetQueue(q interfaces.QueueController)
- func (jf *Jellyfin) SetServerId(id string)
- func (jf *Jellyfin) Start() error
- func (jf *Jellyfin) Stream(song *models.Song) (rc io.ReadCloser, format interfaces.AudioFormat, err error)
- func (jf *Jellyfin) TokenOk() error
- func (jf *Jellyfin) VerifyServerId() error
- func (jf *Jellyfin) WebsocketOk() bool
- type MediaLibrary
- type MediaViewResponse
- type SearchHint
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) GetBatch ¶
GetBatch returns batch of items with given ids. Return array is always same length of ids. However, if not all items are found, return flag is set to false.
type Jellyfin ¶
type Jellyfin struct { task.Task DeviceId string SessionId string // contains filtered or unexported fields }
func NewJellyfin ¶
func (*Jellyfin) CanCacheSongs ¶ added in v0.9.0
func (*Jellyfin) Connect ¶
Connect opens a connection to server. If websockets are supported, use that. Report capabilities to server. This should be called before streaming any media
func (*Jellyfin) ConnectionOk ¶
func (*Jellyfin) DefaultMusicView ¶
func (*Jellyfin) Download ¶
func (jf *Jellyfin) Download(song *models.Song) (io.ReadCloser, interfaces.AudioFormat, error)
func (*Jellyfin) GetAlbumArtist ¶
func (*Jellyfin) GetAlbumArtists ¶
func (*Jellyfin) GetAlbumSongs ¶
GetAlbumSongs gets songs for given album.
func (*Jellyfin) GetAlbums ¶
func (jf *Jellyfin) GetAlbums(opts *interfaces.QueryOpts) (albumList []*models.Album, numRecords int, err error)
GetAlbums returns albums with given paging. It also returns number of all albums
func (*Jellyfin) GetArtistAlbums ¶
GetArtistAlbums retrieves albums for given artist.
func (*Jellyfin) GetArtists ¶
func (jf *Jellyfin) GetArtists(query *interfaces.QueryOpts) (artistList []*models.Artist, numRecords int, err error)
getArtists return artists defined by paging and total number of artists
func (*Jellyfin) GetCacheItems ¶
func (*Jellyfin) GetChildItems ¶
func (*Jellyfin) GetFavoriteAlbums ¶
func (*Jellyfin) GetFavoriteArtists ¶
func (*Jellyfin) GetGenreAlbums ¶
func (*Jellyfin) GetImageUrl ¶ added in v0.9.0
ImageUrl returns primary image url for item, if there is one. Otherwise return empty
func (*Jellyfin) GetInstantMix ¶
GetInstantMix returns instant mix for given item.
func (*Jellyfin) GetParentItem ¶
func (*Jellyfin) GetPlaylistSongs ¶
GetPlaylistSongs returns songs for playlist id
func (*Jellyfin) GetPlaylists ¶
GetPlaylists retrieves all playlists. Each playlists song count is known, but songs must be retrieved separately
func (*Jellyfin) GetRecentlyPlayed ¶
func (*Jellyfin) GetSimilarAlbums ¶
func (*Jellyfin) GetSimilarArtists ¶
func (*Jellyfin) GetSongsById ¶
func (*Jellyfin) GetUserViews ¶
func (jf *Jellyfin) GetUserViews()
func (*Jellyfin) RemoteControlEnabled ¶
func (*Jellyfin) ReportCapabilities ¶
func (*Jellyfin) ReportProgress ¶
func (jf *Jellyfin) ReportProgress(state *interfaces.ApiPlaybackState) error
ReportProgress reports playback status to server
func (*Jellyfin) Search ¶
func (jf *Jellyfin) Search(query string, itemType models.ItemType, limit int) ([]models.Item, error)
Search searches audio items
func (*Jellyfin) SetDefaultMusicview ¶
func (*Jellyfin) SetPlayer ¶
func (jf *Jellyfin) SetPlayer(p interfaces.Player)
func (*Jellyfin) SetQueue ¶
func (jf *Jellyfin) SetQueue(q interfaces.QueueController)
func (*Jellyfin) SetServerId ¶
func (*Jellyfin) Stream ¶
func (jf *Jellyfin) Stream(song *models.Song) (rc io.ReadCloser, format interfaces.AudioFormat, err error)
func (*Jellyfin) VerifyServerId ¶
func (*Jellyfin) WebsocketOk ¶
WebsocketOk returns true if websocket connection is ok
type MediaLibrary ¶
type MediaViewResponse ¶
type MediaViewResponse struct {
Libraries []MediaLibrary `json:"Items"`
}
type SearchHint ¶
type SearchResult ¶
type SearchResult struct {
Items []SearchHint `json:"SearchHints"`
}