From ed4c0aa1f89ce9ce12e7bdb12ec883c9eff37033 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Thu, 7 Dec 2023 08:53:01 +0100 Subject: [PATCH] jspf: add MB playlist extension, public field must be boolean --- internal/backends/jspf/jspf.go | 6 ++++++ pkg/jspf/extensions.go | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/backends/jspf/jspf.go b/internal/backends/jspf/jspf.go index 6aeb5ca..47bd2ec 100644 --- a/internal/backends/jspf/jspf.go +++ b/internal/backends/jspf/jspf.go @@ -149,6 +149,12 @@ func (b JSPFBackend) writeJSPF(tracks []jspf.Track) error { Identifier: b.identifier, Date: time.Now(), Tracks: tracks, + Extension: map[string]any{ + jspf.MusicBrainzPlaylistExtensionId: jspf.MusicBrainzPlaylistExtension{ + LastModifiedAt: time.Now(), + Public: true, + }, + }, }, } diff --git a/pkg/jspf/extensions.go b/pkg/jspf/extensions.go index fe5fef2..07cd3c1 100644 --- a/pkg/jspf/extensions.go +++ b/pkg/jspf/extensions.go @@ -51,9 +51,8 @@ type MusicBrainzPlaylistExtension struct { // deleted, this field will be set to true and the copied_from field will not // be returned. CopiedFromDeleted bool `json:"copied_from_deleted,omitempty"` - // Indicates if this playlist is public or private. Must contain the value - // "true" or "false". - Public string `json:"public,omitempty"` + // Indicates if this playlist is public or private. + Public bool `json:"public,omitempty"` // The timestamp for when this playlist was last modified. LastModifiedAt time.Time `json:"last_modified_at,omitempty"` // This dict allows a playlist creator to submit additional track metadata