add settings dialog radio for saving queue locally or to server
This commit is contained in:
@@ -382,6 +382,9 @@ func (s *subsonicMediaProvider) GetLyrics(track *mediaprovider.Track) (*mediapro
|
||||
// CanSavePlayQueue interface
|
||||
|
||||
func (s *subsonicMediaProvider) SavePlayQueue(trackIDs []string, currentTrackPos int, timeSeconds int) error {
|
||||
if len(trackIDs) == 0 {
|
||||
return nil // don't save an empty queue
|
||||
}
|
||||
return s.client.SavePlayQueue(trackIDs, map[string]string{
|
||||
"current": trackIDs[currentTrackPos],
|
||||
"position": strconv.Itoa(timeSeconds * 1000),
|
||||
|
||||
@@ -3,6 +3,7 @@ package backend
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
@@ -64,6 +65,8 @@ func LoadPlayQueue(filepath string, sm *ServerManager, loadFromServer bool) (*Sa
|
||||
TrackIndex: queue.TrackPos,
|
||||
TimePos: float64(queue.TimePos),
|
||||
}, nil
|
||||
} else {
|
||||
log.Printf("error loading queue from server: %v", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user