jspf: add MB playlist extension, public field must be boolean

This commit is contained in:
Philipp Wolfer 2023-12-07 08:53:01 +01:00
parent 7a2fcc091e
commit ed4c0aa1f8
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
2 changed files with 8 additions and 3 deletions

View file

@ -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,
},
},
},
}

View file

@ -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