add monitor sync jobs and duplicate-safe qobuz updates
This commit is contained in:
@@ -10,10 +10,11 @@ import (
|
||||
)
|
||||
|
||||
type Data struct {
|
||||
Spotify SpotifyState `json:"spotify"`
|
||||
Qobuz QobuzState `json:"qobuz"`
|
||||
Monitor map[string]string `json:"monitor"`
|
||||
Meta map[string]string `json:"meta,omitempty"`
|
||||
Spotify SpotifyState `json:"spotify"`
|
||||
Qobuz QobuzState `json:"qobuz"`
|
||||
Monitor map[string]string `json:"monitor"`
|
||||
Playlists map[string]PlaylistSyncRef `json:"playlists"`
|
||||
Meta map[string]string `json:"meta,omitempty"`
|
||||
}
|
||||
|
||||
type SpotifyState struct {
|
||||
@@ -30,6 +31,12 @@ type QobuzState struct {
|
||||
AccessToken string `json:"access_token,omitempty"`
|
||||
}
|
||||
|
||||
type PlaylistSyncRef struct {
|
||||
SourceName string `json:"source_name,omitempty"`
|
||||
QobuzPlaylistID int64 `json:"qobuz_playlist_id,omitempty"`
|
||||
Fingerprint string `json:"fingerprint,omitempty"`
|
||||
}
|
||||
|
||||
func DefaultPath() string {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil || strings.TrimSpace(home) == "" {
|
||||
@@ -72,6 +79,9 @@ func Load(path string) (Data, error) {
|
||||
if d.Monitor == nil {
|
||||
d.Monitor = map[string]string{}
|
||||
}
|
||||
if d.Playlists == nil {
|
||||
d.Playlists = map[string]PlaylistSyncRef{}
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user