Documentation
¶
Index ¶
- Constants
- Variables
- type Browser
- type Cover
- type DirectoryInfo
- type Entries
- type Entry
- type ListGenerator
- type MediaStreamer
- type MockNowPlaying
- func (m *MockNowPlaying) ClearAll()
- func (m *MockNowPlaying) Count(playerId int) (int64, error)
- func (m *MockNowPlaying) Dequeue(playerId int) (*NowPlayingInfo, error)
- func (m *MockNowPlaying) Enqueue(info *NowPlayingInfo) error
- func (m *MockNowPlaying) GetAll() ([]*NowPlayingInfo, error)
- func (m *MockNowPlaying) Head(playerId int) (*NowPlayingInfo, error)
- func (m *MockNowPlaying) OverrideNow(t time.Time)
- func (m *MockNowPlaying) SetError(err bool)
- func (m *MockNowPlaying) Tail(playerId int) (*NowPlayingInfo, error)
- type MockProperty
- type NowPlayingInfo
- type NowPlayingRepository
- type PlaylistInfo
- type Playlists
- type Ratings
- type Scrobbler
- type Search
- 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 int
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 ListGenerator ¶
type ListGenerator interface {
GetNewest(ctx context.Context, offset int, size int) (Entries, error)
GetRecent(ctx context.Context, offset int, size int) (Entries, error)
GetFrequent(ctx context.Context, offset int, size int) (Entries, error)
GetHighest(ctx context.Context, offset int, size int) (Entries, error)
GetRandom(ctx context.Context, offset int, size int) (Entries, error)
GetByName(ctx context.Context, offset int, size int) (Entries, error)
GetByArtist(ctx context.Context, offset int, size int) (Entries, error)
GetStarred(ctx context.Context, offset int, size int) (Entries, error)
GetAllStarred(ctx context.Context) (artists Entries, albums Entries, mediaFiles Entries, err error)
GetNowPlaying(ctx context.Context) (Entries, error)
GetRandomSongs(ctx context.Context, size int, genre string) (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, maxBitRate int, format string) (mediaStream, error)
}
func NewMediaStreamer ¶ added in v0.6.0
func NewMediaStreamer(ds model.DataStore) MediaStreamer
type MockNowPlaying ¶
type MockNowPlaying struct {
NowPlayingRepository
// contains filtered or unexported fields
}
func CreateMockNowPlayingRepo ¶
func CreateMockNowPlayingRepo() *MockNowPlaying
func (*MockNowPlaying) ClearAll ¶
func (m *MockNowPlaying) ClearAll()
func (*MockNowPlaying) Dequeue ¶
func (m *MockNowPlaying) Dequeue(playerId int) (*NowPlayingInfo, error)
func (*MockNowPlaying) Enqueue ¶
func (m *MockNowPlaying) Enqueue(info *NowPlayingInfo) error
func (*MockNowPlaying) GetAll ¶
func (m *MockNowPlaying) GetAll() ([]*NowPlayingInfo, error)
func (*MockNowPlaying) Head ¶
func (m *MockNowPlaying) Head(playerId int) (*NowPlayingInfo, error)
func (*MockNowPlaying) OverrideNow ¶
func (m *MockNowPlaying) OverrideNow(t time.Time)
func (*MockNowPlaying) SetError ¶
func (m *MockNowPlaying) SetError(err bool)
func (*MockNowPlaying) Tail ¶
func (m *MockNowPlaying) Tail(playerId int) (*NowPlayingInfo, error)
type MockProperty ¶
type MockProperty struct {
model.PropertyRepository
// contains filtered or unexported fields
}
func CreateMockPropertyRepo ¶
func CreateMockPropertyRepo() *MockProperty
func (*MockProperty) DefaultGet ¶
func (m *MockProperty) DefaultGet(id string, defaultValue string) (string, error)
func (*MockProperty) SetError ¶
func (m *MockProperty) SetError(err bool)
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 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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.