add missed files in previous commit
This commit is contained in:
@@ -267,6 +267,10 @@ type LyricsProvider interface {
|
|||||||
GetLyrics(track *Track) (*Lyrics, error)
|
GetLyrics(track *Track) (*Lyrics, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RadioProvider interface {
|
||||||
|
GetRadioStations() ([]*RadioStation, error)
|
||||||
|
}
|
||||||
|
|
||||||
type JukeboxProvider interface {
|
type JukeboxProvider interface {
|
||||||
JukeboxStart() error
|
JukeboxStart() error
|
||||||
JukeboxStop() error
|
JukeboxStop() error
|
||||||
|
|||||||
@@ -386,6 +386,7 @@ func (s *subsonicMediaProvider) GetLyrics(track *mediaprovider.Track) (*mediapro
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CanSavePlayQueue interface
|
// CanSavePlayQueue interface
|
||||||
|
var _ mediaprovider.CanSavePlayQueue = (*subsonicMediaProvider)(nil)
|
||||||
|
|
||||||
func (s *subsonicMediaProvider) SavePlayQueue(trackIDs []string, currentTrackIdx int, timeSeconds int) error {
|
func (s *subsonicMediaProvider) SavePlayQueue(trackIDs []string, currentTrackIdx int, timeSeconds int) error {
|
||||||
if len(trackIDs) == 0 {
|
if len(trackIDs) == 0 {
|
||||||
@@ -413,6 +414,24 @@ func (s *subsonicMediaProvider) GetPlayQueue() (*mediaprovider.SavedPlayQueue, e
|
|||||||
return savedQueue, nil
|
return savedQueue, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RadioProvider interface
|
||||||
|
var _ mediaprovider.RadioProvider = (*subsonicMediaProvider)(nil)
|
||||||
|
|
||||||
|
func (s *subsonicMediaProvider) GetRadioStations() ([]*mediaprovider.RadioStation, error) {
|
||||||
|
rs, err := s.client.GetInternetRadioStations()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return sharedutil.MapSlice(rs, func(rs *subsonic.InternetRadioStation) *mediaprovider.RadioStation {
|
||||||
|
return &mediaprovider.RadioStation{
|
||||||
|
ID: "radio-" + strings.ReplaceAll(rs.Name, " ", ""),
|
||||||
|
Name: rs.Name,
|
||||||
|
HomePageURL: rs.HomePageUrl,
|
||||||
|
StreamURL: rs.StreamUrl,
|
||||||
|
}
|
||||||
|
}), nil
|
||||||
|
}
|
||||||
|
|
||||||
func toTrack(ch *subsonic.Child) *mediaprovider.Track {
|
func toTrack(ch *subsonic.Child) *mediaprovider.Track {
|
||||||
if ch == nil {
|
if ch == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user