Documentation ¶
Overview ¶
Package music provides support for all music and radio media.
Index ¶
- Constants
- Variables
- func Cover(r Release, size string) string
- func CoverArtArchiveImage(r Release) string
- func FuzzyName(name string) string
- func Shuffle(tracks []Track) []Track
- type Music
- func (m *Music) Artist(artist string) (Artist, error)
- func (m *Music) ArtistBackground(artist Artist) string
- func (m *Music) ArtistDeep(artist Artist, depth int) []Track
- func (m *Music) ArtistImage(artist Artist) string
- func (m *Music) ArtistLike(artist string) (Artist, error)
- func (m *Music) ArtistPopularTracks(a Artist, limit ...int) []Track
- func (m *Music) ArtistRadio(artist Artist) []Track
- func (m *Music) ArtistReleases(a Artist) []Release
- func (m *Music) ArtistShuffle(artist Artist, depth int) []Track
- func (m *Music) ArtistSimilar(artist Artist, depth int, breadth int) []Track
- func (m *Music) ArtistSingleTracks(a Artist, limit ...int) []Track
- func (m *Music) ArtistTracks(a Artist) []Track
- func (m *Music) Artists() []Artist
- func (m *Music) ClearStations()
- func (m *Music) Close()
- func (m *Music) CoverSmall(o interface{}) string
- func (m *Music) CreatePlaylist(p *Playlist) error
- func (m *Music) CreateStation(s *Station) error
- func (m *Music) CreateStations()
- func (m *Music) DeletePlaylist(user auth.User, id int) error
- func (m *Music) DeleteStation(s *Station) error
- func (m *Music) DeleteStations()
- func (m *Music) FindArtist(identifier string) (Artist, error)
- func (m *Music) FindPlaylist(user auth.User, identifier string) (Playlist, error)
- func (m *Music) FindRelease(identifier string) (Release, error)
- func (m *Music) FindStation(identifier string) (Station, error)
- func (m *Music) FindTrack(identifier string) (Track, error)
- func (m *Music) FindTracks(identifiers []string) []Track
- func (m *Music) HasMusic() bool
- func (m *Music) HasPlaylists(user auth.User) bool
- func (m *Music) LastModified() time.Time
- func (m *Music) LookupARID(arid string) (Artist, error)
- func (m *Music) LookupArtist(id int) (Artist, error)
- func (m *Music) LookupETag(etag string) (Track, error)
- func (m *Music) LookupPlaylist(user auth.User, id int) (Playlist, error)
- func (m *Music) LookupREID(reid string) (Release, error)
- func (m *Music) LookupRID(rid string) (Track, error)
- func (m *Music) LookupRelease(id int) (Release, error)
- func (m *Music) LookupStation(id int) (Station, error)
- func (m *Music) LookupTrack(id int) (Track, error)
- func (m *Music) LookupUUID(uuid string) (Track, error)
- func (m *Music) Open() (err error)
- func (m *Music) PlaylistsLike(user auth.User, name string) []Playlist
- func (m *Music) Query(query string) ([]Artist, []Release, []Track, []Station)
- func (m *Music) RecentlyAdded() []Release
- func (m *Music) RecentlyReleased() []Release
- func (m *Music) RelatedArtists(a Artist, limit ...int) []Artist
- func (m *Music) ReleasePopular(release Release) []Track
- func (m *Music) ReleaseSingles(release Release) []Track
- func (m *Music) ReleaseTracks(release Release) []Track
- func (m *Music) ReleasesLike(name string) []Release
- func (m *Music) Search(q string, limit ...int) []Track
- func (m *Music) SearchTracks(title, artist, album string) []Track
- func (m *Music) SimilarArtists(a Artist, limit ...int) []Artist
- func (m *Music) SimilarReleases(a Artist, r Release) []Release
- func (m *Music) Stations(user auth.User) []Station
- func (m *Music) StationsLike(name string) []Station
- func (m *Music) Sync(options SyncOptions)
- func (m *Music) SyncCovers(c client.Getter) error
- func (m *Music) SyncFanArt(c client.Getter) error
- func (m *Music) TrackCount() int64
- func (m *Music) TrackCover(t Track, size string) string
- func (m *Music) TrackImage(t Track) *url.URL
- func (m *Music) TrackLookup(etag string) (Track, error)
- func (m *Music) TrackRadio(track Track) []Track
- func (m *Music) TrackURL(t Track) *url.URL
- func (m *Music) UnmatchedTracks() []Track
- func (m *Music) UpdatePlaylist(p *Playlist) error
- func (m *Music) UpdateStation(s *Station) error
- func (m *Music) UserPlaylist(user auth.User) (Playlist, error)
- func (m *Music) UserPlaylistCount(user auth.User) int64
- func (m *Music) UserPlaylists(user auth.User) []Playlist
- func (m *Music) WantArtistReleases(a Artist) []Release
- func (m *Music) WantList() []Release
- type SyncOptions
- type TopTrack
Constants ¶
const ( FieldArtist = "artist" FieldAsin = "asin" FieldDate = "date" FieldFirstDate = "first_date" FieldGenre = "genre" FieldLabel = "label" FieldLength = "length" FieldMedia = "media" FieldMediaTitle = "media_title" FieldPopularity = "popularity" FieldRating = "rating" FieldRelease = "release" FieldReleaseDate = "release_date" FieldSeries = "series" FieldStatus = "status" FieldTag = "tag" FieldTitle = "title" FieldTrack = "track" FieldType = "type" FieldBass = "base" FieldClarinet = "clarinet" FieldDrums = "drums" FieldFlute = "flute" FieldGuitar = "guitar" FieldPiano = "piano" FieldSaxophone = "saxophone" FieldVocals = "vocals" TypePopular = "popular" TypeSingle = "single" TypeCover = "cover" TypeLive = "live" )
const ( TakeoutUser = "takeout" VariousArtists = "Various Artists" )
const ( // rename to Radio* or Station* TypeArtist = "artist" // Songs by single artist TypeGenre = "genre" // Songs from one or more genres TypeSimilar = "similar" // Songs from similar artists TypePeriod = "period" // Songs from one or more time periods TypeSeries = "series" // Songs from one or more series (chart) TypeStream = "stream" // Internet radio stream TypeOther = "other" )
Variables ¶
Functions ¶
func CoverArtArchiveImage ¶
func CoverArtArchiveImage(r Release) string
Get the URL for the release cover from The Cover Art Archive. Use REID front cover.
Types ¶
type Music ¶
type Music struct {
// contains filtered or unexported fields
}
func (*Music) ArtistBackground ¶
func (*Music) ArtistDeep ¶
func (*Music) ArtistImage ¶
func (*Music) ArtistLike ¶
Find an artist by name.
func (*Music) ArtistPopularTracks ¶
func (*Music) ArtistRadio ¶
func (m *Music) ArtistRadio(artist Artist) []Track
func (*Music) ArtistReleases ¶
func (m *Music) ArtistReleases(a Artist) []Release
All releases for an artist that have corresponing tracks.
func (*Music) ArtistShuffle ¶
func (*Music) ArtistSimilar ¶
func (*Music) ArtistSingleTracks ¶
func (*Music) ArtistTracks ¶
func (m *Music) ArtistTracks(a Artist) []Track
func (*Music) Artists ¶
func (m *Music) Artists() []Artist
All artist names ordered by sortName from MusicBrainz.
func (*Music) ClearStations ¶
func (m *Music) ClearStations()
func (*Music) CoverSmall ¶
func (*Music) CreatePlaylist ¶
func (*Music) CreateStation ¶
func (*Music) CreateStations ¶
func (m *Music) CreateStations()
func (*Music) DeletePlaylist ¶ added in v0.17.0
func (*Music) DeleteStation ¶
func (*Music) DeleteStations ¶ added in v0.14.2
func (m *Music) DeleteStations()
func (*Music) FindArtist ¶
func (*Music) FindPlaylist ¶ added in v0.17.0
func (*Music) FindRelease ¶
func (*Music) FindStation ¶
func (*Music) FindTracks ¶
func (*Music) LastModified ¶
func (*Music) LookupARID ¶
Lookup an artist given the MusicBrainz ARID.
func (*Music) LookupArtist ¶
Lookup an artist given the internal record ID.
func (*Music) LookupETag ¶
Lookup a track given the etag from the S3 bucket object. Etag can be used as a good external identifier (for playlists) since the interal record ID can change.
func (*Music) LookupPlaylist ¶
Lookup user playlist
func (*Music) LookupREID ¶
Lookup a release given the MusicBrainz REID.
func (*Music) LookupRelease ¶
Lookup a release given the internal record ID.
func (*Music) LookupStation ¶
Obtain user station by id.
func (*Music) LookupTrack ¶
Lookup a track given the internal record ID.
func (*Music) LookupUUID ¶
Lookup a track given the UUID.
func (*Music) PlaylistsLike ¶ added in v0.17.0
func (*Music) Query ¶
Simple sql search for artists, releases, tracks and stations. Use config SearchLimit to change the result count.
func (*Music) RecentlyAdded ¶
func (m *Music) RecentlyAdded() []Release
Recently added releases are ordered by LastModified which comes from the track object in the S3 bucket. Use config Recent and RecentLimit to tune the result count.
func (*Music) RecentlyReleased ¶
func (m *Music) RecentlyReleased() []Release
Recently released releases are ordered by the MusicBrainz first release date of the release, newest first. Use config Recent and RecentLimit to tune the result count.
func (*Music) RelatedArtists ¶ added in v0.18.3
Useful when there are no similar artists. Artists with same genre that started around the same time (default is +/- 5 years)
func (*Music) ReleasePopular ¶
func (m *Music) ReleasePopular(release Release) []Track
func (*Music) ReleaseSingles ¶
func (m *Music) ReleaseSingles(release Release) []Track
func (*Music) ReleaseTracks ¶
func (m *Music) ReleaseTracks(release Release) []Track
Obtain all the tracks for this release, ordered by disc and track number.
func (*Music) ReleasesLike ¶
func (*Music) SearchTracks ¶
func (*Music) SimilarArtists ¶
Similar artists based on similarity rank from Last.fm.
func (*Music) SimilarReleases ¶
func (m *Music) SimilarReleases(a Artist, r Release) []Release
Similar releases based on releases from similar artists in the previous and following year.
func (*Music) StationsLike ¶ added in v0.13.0
Stations by name
func (*Music) Sync ¶
func (m *Music) Sync(options SyncOptions)
func (*Music) TrackCount ¶
func (*Music) TrackCover ¶
Track cover based on assigned release.
func (*Music) TrackLookup ¶
Find track using the etag from the S3 bucket.
func (*Music) TrackRadio ¶ added in v0.18.1
func (m *Music) TrackRadio(track Track) []Track
func (*Music) TrackURL ¶
URL to stream track from the S3 bucket. This will be signed and expired based on config.
func (*Music) UnmatchedTracks ¶
func (m *Music) UnmatchedTracks() []Track
func (*Music) UserPlaylist ¶ added in v0.17.0
func (*Music) UserPlaylistCount ¶ added in v0.17.6
func (*Music) UserPlaylists ¶ added in v0.17.0
func (*Music) WantArtistReleases ¶
func (m *Music) WantArtistReleases(a Artist) []Release
type SyncOptions ¶
type SyncOptions struct { Since time.Time Tracks bool Releases bool Popular bool Similar bool Index bool Artwork bool Artist string Resolve bool }
func NewSyncOptions ¶
func NewSyncOptions() SyncOptions
func NewSyncPopular ¶
func NewSyncPopular() SyncOptions
func NewSyncSimilar ¶
func NewSyncSimilar() SyncOptions