Documentation
¶
Index ¶
- Constants
- Variables
- type Browser
- type Cover
- type DirectoryInfo
- type Entries
- type Entry
- type ImageCache
- type ListFilter
- func ByArtist() ListFilter
- func ByFrequent() ListFilter
- func ByGenre(genre string) ListFilter
- func ByName() ListFilter
- func ByNewest() ListFilter
- func ByRandom() ListFilter
- func ByRating() ListFilter
- func ByRecent() ListFilter
- func ByStarred() ListFilter
- func ByYear(fromYear, toYear int) ListFilter
- func SongsByGenre(genre string) ListFilter
- func SongsByRandom(genre string, fromYear, toYear int) ListFilter
- type ListGenerator
- type MediaStreamer
- type NowPlayingInfo
- type NowPlayingRepository
- type Players
- type PlaylistInfo
- type Playlists
- type Ratings
- type Scrobbler
- type Search
- type Stream
- type TranscodingCache
- type Users
Constants ¶
View Source
const NowPlayingExpire = 60 * time.Minute
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Browser ¶
type Browser interface {
MediaFolders(ctx context.Context) (model.MediaFolders, error)
Indexes(ctx context.Context, mediaFolderId string, ifModifiedSince time.Time) (model.ArtistIndexes, time.Time, error)
Directory(ctx context.Context, id string) (*DirectoryInfo, error)
Artist(ctx context.Context, id string) (*DirectoryInfo, error)
Album(ctx context.Context, id string) (*DirectoryInfo, error)
GetSong(ctx context.Context, id string) (*Entry, error)
GetGenres(ctx context.Context) (model.Genres, error)
}
func NewBrowser ¶
type DirectoryInfo ¶
type Entries ¶
type Entries []Entry
func FromAlbums ¶
func FromArtists ¶
func FromMediaFiles ¶
func FromMediaFiles(mfs model.MediaFiles) Entries
type Entry ¶
type Entry struct {
Id string
Title string
IsDir bool
Parent string
Album string
Year int
Artist string
Genre string
CoverArt string
Starred time.Time
Track int
Duration int
Size int64
Suffix string
BitRate int
ContentType string
Path string
PlayCount int32
DiscNumber int
Created time.Time
AlbumId string
ArtistId string
Type string
UserRating int
SongCount int
UserName string
MinutesAgo int
PlayerId int
PlayerName string
AlbumCount int
AbsolutePath string
}
func FromArtist ¶
func FromMediaFile ¶
type ImageCache ¶ added in v0.14.0
func NewImageCache ¶ added in v0.14.0
func NewImageCache() (ImageCache, error)
type ListFilter ¶ added in v0.15.0
type ListFilter model.QueryOptions
func ByArtist ¶ added in v0.15.0
func ByArtist() ListFilter
func ByFrequent ¶ added in v0.15.0
func ByFrequent() ListFilter
func ByGenre ¶ added in v0.15.0
func ByGenre(genre string) ListFilter
func ByName ¶ added in v0.15.0
func ByName() ListFilter
func ByNewest ¶ added in v0.15.0
func ByNewest() ListFilter
func ByRandom ¶ added in v0.15.0
func ByRandom() ListFilter
func ByRating ¶ added in v0.15.0
func ByRating() ListFilter
func ByRecent ¶ added in v0.15.0
func ByRecent() ListFilter
func ByStarred ¶ added in v0.15.0
func ByStarred() ListFilter
func ByYear ¶ added in v0.15.0
func ByYear(fromYear, toYear int) ListFilter
func SongsByGenre ¶ added in v0.15.0
func SongsByGenre(genre string) ListFilter
func SongsByRandom ¶ added in v0.15.0
func SongsByRandom(genre string, fromYear, toYear int) ListFilter
type ListGenerator ¶
type ListGenerator interface {
GetAllStarred(ctx context.Context) (artists Entries, albums Entries, mediaFiles Entries, err error)
GetNowPlaying(ctx context.Context) (Entries, error)
GetSongs(ctx context.Context, offset, size int, filter ListFilter) (Entries, error)
GetAlbums(ctx context.Context, offset, size int, filter ListFilter) (Entries, error)
}
func NewListGenerator ¶
func NewListGenerator(ds model.DataStore, npRepo NowPlayingRepository) ListGenerator
type MediaStreamer ¶ added in v0.6.0
type MediaStreamer interface {
NewStream(ctx context.Context, id string, reqFormat string, reqBitRate int) (*Stream, error)
}
func NewMediaStreamer ¶ added in v0.6.0
func NewMediaStreamer(ds model.DataStore, ffm transcoder.Transcoder, cache TranscodingCache) MediaStreamer
type NowPlayingInfo ¶
type NowPlayingRepository ¶
type NowPlayingRepository interface {
// Insert at the head of the queue
Enqueue(*NowPlayingInfo) error
// Removes and returns the element at the end of the queue
Dequeue(playerId int) (*NowPlayingInfo, error)
// Returns the element at the head of the queue (last inserted one)
Head(playerId int) (*NowPlayingInfo, error)
// Returns the element at the end of the queue (first inserted one)
Tail(playerId int) (*NowPlayingInfo, error)
// Size of the queue for the playerId
Count(playerId int) (int64, error)
// Returns all heads from all playerIds
GetAll() ([]*NowPlayingInfo, error)
}
This repo must have the semantics of a FIFO queue, for each playerId
func NewNowPlayingRepository ¶
func NewNowPlayingRepository() NowPlayingRepository
type Players ¶ added in v0.10.0
type Players interface {
Get(ctx context.Context, playerId string) (*model.Player, error)
Register(ctx context.Context, id, client, typ, ip string) (*model.Player, *model.Transcoding, error)
}
func NewPlayers ¶ added in v0.10.0
type PlaylistInfo ¶
type Playlists ¶
type Playlists interface {
GetAll(ctx context.Context) (model.Playlists, error)
Get(ctx context.Context, id string) (*PlaylistInfo, error)
Create(ctx context.Context, playlistId, name string, ids []string) error
Delete(ctx context.Context, playlistId string) error
Update(ctx context.Context, playlistId string, name *string, idsToAdd []string, idxToRemove []int) error
}
func NewPlaylists ¶
type Ratings ¶
type Ratings interface {
SetStar(ctx context.Context, star bool, ids ...string) error
SetRating(ctx context.Context, id string, rating int) error
}
func NewRatings ¶
type Scrobbler ¶
type Scrobbler interface {
Register(ctx context.Context, playerId int, trackId string, playDate time.Time) (*model.MediaFile, error)
NowPlaying(ctx context.Context, playerId int, playerName, trackId, username string) (*model.MediaFile, error)
}
func NewScrobbler ¶
func NewScrobbler(ds model.DataStore, npr NowPlayingRepository) Scrobbler
type Search ¶
type Stream ¶
func (*Stream) ContentType ¶ added in v0.8.4
func (*Stream) EstimatedContentLength ¶ added in v0.13.0
type TranscodingCache ¶ added in v0.14.0
func NewTranscodingCache ¶ added in v0.8.3
func NewTranscodingCache() (TranscodingCache, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.