Documentation ¶
Index ¶
- Constants
- func NewAlbumFilter(options AlbumFilterOptions) *albumFilter
- func NewArtistFilter(options ArtistFilterOptions) *artistFilter
- type Album
- type AlbumFilter
- type AlbumFilterOptions
- type AlbumInfo
- type AlbumIterator
- type AlbumWithTracks
- type Artist
- type ArtistFilter
- type ArtistFilterOptions
- type ArtistInfo
- type ArtistIterator
- type ArtistWithAlbums
- type CanSavePlayQueue
- type ContentType
- type Favorites
- type Genre
- type JukeboxProvider
- type JukeboxStatus
- type LoginResponse
- type LyricLine
- type Lyrics
- type LyricsProvider
- type MediaFilter
- type MediaItem
- type MediaItemMetadata
- type MediaItemType
- type MediaIterator
- type MediaProvider
- type Playlist
- type PlaylistWithTracks
- type RadioProvider
- type RadioStation
- type RatingFavoriteParameters
- type ReleaseType
- type ReleaseTypes
- type ReplayGainInfo
- type SavedPlayQueue
- type SearchResult
- type Server
- type SupportsRating
- type SupportsSharing
- type Track
- type TrackIterator
Constants ¶
View Source
const ( // set of all supported album sorts across all media providers // these strings may be translated AlbumSortRecentlyAdded string = "Recently Added" AlbumSortRecentlyPlayed string = "Recently Played" AlbumSortFrequentlyPlayed string = "Frequently Played" AlbumSortRandom string = "Random" AlbumSortTitleAZ string = "Title (A-Z)" AlbumSortArtistAZ string = "Artist (A-Z)" AlbumSortYearAscending string = "Year (ascending)" AlbumSortYearDescending string = "Year (descending)" // set of all supported artist sorts across all media providers // these strings may be translated ArtistSortAlbumCount string = "Album Count" ArtistSortNameAZ string = "Name (A-Z)" ArtistSortRandom string = "Random" )
Variables ¶
This section is empty.
Functions ¶
func NewAlbumFilter ¶ added in v0.10.0
func NewAlbumFilter(options AlbumFilterOptions) *albumFilter
func NewArtistFilter ¶ added in v0.10.0
func NewArtistFilter(options ArtistFilterOptions) *artistFilter
Types ¶
type AlbumFilter ¶
type AlbumFilter = MediaFilter[Album, AlbumFilterOptions]
type AlbumFilterOptions ¶ added in v0.10.0
type AlbumFilterOptions struct { MinYear int MaxYear int // 0 == unset/match any Genres []string // len(0) == unset/match any ExcludeFavorited bool // mut. exc. with ExcludeUnfavorited ExcludeUnfavorited bool // mut. exc. with ExcludeFavorited }
func (AlbumFilterOptions) Clone ¶ added in v0.10.0
func (o AlbumFilterOptions) Clone() AlbumFilterOptions
Clone returns a deep copy of the filter options
type AlbumIterator ¶
type AlbumIterator = MediaIterator[Album]
type AlbumWithTracks ¶
type ArtistFilter ¶ added in v0.10.0
type ArtistFilter = MediaFilter[Artist, ArtistFilterOptions]
type ArtistFilterOptions ¶ added in v0.10.0
type ArtistFilterOptions struct {
SearchQuery string
}
func (ArtistFilterOptions) Clone ¶ added in v0.10.0
func (o ArtistFilterOptions) Clone() ArtistFilterOptions
Clone returns a deep copy of the filter options
type ArtistInfo ¶
type ArtistIterator ¶ added in v0.10.0
type ArtistIterator = MediaIterator[Artist]
type ArtistWithAlbums ¶
type CanSavePlayQueue ¶ added in v0.10.0
type ContentType ¶ added in v0.7.0
type ContentType int
const ( ContentTypeAlbum ContentType = iota ContentTypeArtist ContentTypePlaylist ContentTypeTrack ContentTypeGenre ContentTypeRadioStation )
func (ContentType) String ¶ added in v0.7.0
func (c ContentType) String() string
type JukeboxProvider ¶ added in v0.9.0
type JukeboxProvider interface { JukeboxStart() error JukeboxStop() error JukeboxSeek(idx, seconds int) error JukeboxClear() error JukeboxSet(trackID string) error JukeboxAdd(trackID string) error JukeboxRemove(idx int) error JukeboxSetVolume(vol int) error JukeboxGetStatus() (*JukeboxStatus, error) }
type JukeboxStatus ¶ added in v0.9.0
type LoginResponse ¶ added in v0.8.0
type LyricsProvider ¶ added in v0.10.0
type MediaFilter ¶ added in v0.10.0
type MediaFilter[M, F any] interface { Options() F SetOptions(F) Clone() MediaFilter[M, F] IsNil() bool Matches(*M) bool }
type MediaItem ¶ added in v0.11.0
type MediaItem interface { Metadata() MediaItemMetadata Copy() MediaItem }
type MediaItemMetadata ¶ added in v0.11.0
type MediaItemType ¶ added in v0.11.0
type MediaItemType int
const ( MediaItemTypeTrack MediaItemType = iota MediaItemTypeRadioStation )
type MediaIterator ¶ added in v0.10.0
type MediaIterator[M any] interface { Next() *M }
type MediaProvider ¶
type MediaProvider interface { SetPrefetchCoverCallback(cb func(coverArtID string)) GetTrack(trackID string) (*Track, error) GetAlbum(albumID string) (*AlbumWithTracks, error) GetAlbumInfo(albumID string) (*AlbumInfo, error) GetArtist(artistID string) (*ArtistWithAlbums, error) GetArtistTracks(artistID string) ([]*Track, error) GetArtistInfo(artistID string) (*ArtistInfo, error) GetPlaylist(playlistID string) (*PlaylistWithTracks, error) GetCoverArt(coverArtID string, size int) (image.Image, error) AlbumSortOrders() []string IterateAlbums(sortOrder string, filter AlbumFilter) AlbumIterator IterateTracks(searchQuery string) TrackIterator SearchAlbums(searchQuery string, filter AlbumFilter) AlbumIterator SearchAll(searchQuery string, maxResults int) ([]*SearchResult, error) GetRandomTracks(genre string, count int) ([]*Track, error) GetSimilarTracks(artistID string, count int) ([]*Track, error) GetSongRadio(trackID string, count int) ([]*Track, error) ArtistSortOrders() []string IterateArtists(sortOrder string, filter ArtistFilter) ArtistIterator SearchArtists(searchQuery string, filter ArtistFilter) ArtistIterator GetGenres() ([]*Genre, error) GetFavorites() (Favorites, error) GetStreamURL(trackID string, forceRaw bool) (string, error) GetTopTracks(artist Artist, count int) ([]*Track, error) SetFavorite(params RatingFavoriteParameters, favorite bool) error GetPlaylists() ([]*Playlist, error) CreatePlaylist(name string, trackIDs []string) error CanMakePublicPlaylist() bool EditPlaylist(id, name, description string, public bool) error AddPlaylistTracks(id string, trackIDsToAdd []string) error RemovePlaylistTracks(id string, trackIdxsToRemove []int) error ReplacePlaylistTracks(id string, trackIDs []string) error DeletePlaylist(id string) error // True if the `submission` parameter to TrackEndedPlayback will be respected // If false, the begin playback scrobble registers a play count immediately // when TrackBeganPlayback is invoked. ClientDecidesScrobble() bool TrackBeganPlayback(trackID string) error TrackEndedPlayback(trackID string, positionSecs int, submission bool) error DownloadTrack(trackID string) (io.Reader, error) RescanLibrary() error }
type PlaylistWithTracks ¶
type RadioProvider ¶ added in v0.11.0
type RadioProvider interface { GetRadioStation(id string) (*RadioStation, error) GetRadioStations() ([]*RadioStation, error) }
type RadioStation ¶ added in v0.11.0
func (*RadioStation) Copy ¶ added in v0.11.0
func (r *RadioStation) Copy() MediaItem
func (*RadioStation) Metadata ¶ added in v0.11.0
func (r *RadioStation) Metadata() MediaItemMetadata
type ReleaseType ¶ added in v0.9.0
type ReleaseType = int32
Bit field flag for the ReleaseTypes property
const ( ReleaseTypeAlbum ReleaseType = 0x0001 ReleaseTypeAudiobook ReleaseType = 0x0002 ReleaseTypeAudioDrama ReleaseType = 0x0004 ReleaseTypeBroadcast ReleaseType = 0x0008 ReleaseTypeCompilation ReleaseType = 0x0010 ReleaseTypeDemo ReleaseType = 0x0020 ReleaseTypeDJMix ReleaseType = 0x0040 ReleaseTypeEP ReleaseType = 0x0080 ReleaseTypeFieldRecording ReleaseType = 0x0100 ReleaseTypeInterview ReleaseType = 0x0200 ReleaseTypeLive ReleaseType = 0x0400 ReleaseTypeMixtape ReleaseType = 0x0800 ReleaseTypeRemix ReleaseType = 0x1000 ReleaseTypeSingle ReleaseType = 0x2000 ReleaseTypeSoundtrack ReleaseType = 0x4000 ReleaseTypeSpokenWord ReleaseType = 0x8000 )
Set of possible release types Taken from Picard:
(a) https://picard-docs.musicbrainz.org/en/config/options_releases.html (b) https://musicbrainz.org/doc/Release_Group/Type
type ReplayGainInfo ¶ added in v0.13.0
type SavedPlayQueue ¶ added in v0.10.0
type SearchResult ¶ added in v0.7.0
type Server ¶ added in v0.8.0
type Server interface { Login(username, password string) LoginResponse MediaProvider() MediaProvider }
type SupportsRating ¶ added in v0.8.0
type SupportsRating interface {
SetRating(params RatingFavoriteParameters, rating int) error
}
type SupportsSharing ¶ added in v0.10.0
type SupportsSharing interface {}
type Track ¶
type Track struct { ID string CoverArtID string ParentID string Title string Duration int TrackNumber int DiscNumber int Genres []string ArtistIDs []string ArtistNames []string ComposerIDs []string ComposerNames []string Album string AlbumID string Year int Rating int Favorite bool Size int64 PlayCount int LastPlayed time.Time FilePath string BitRate int ContentType string Comment string BPM int ReplayGain ReplayGainInfo }
func (*Track) Metadata ¶ added in v0.11.0
func (t *Track) Metadata() MediaItemMetadata
type TrackIterator ¶
type TrackIterator = MediaIterator[Track]
Click to show internal directories.
Click to hide internal directories.