fix(subsonic): only return one bookmark entry per row in getBookmarks
fixes #310 https://gitlab.com/ultrasonic/ultrasonic/-/issues/1113
This commit is contained in:
@@ -31,17 +31,17 @@ func (c *Controller) ServeGetBookmarks(r *http.Request) *spec.Response {
|
|||||||
Type: specid.IDT(bookmark.EntryIDType),
|
Type: specid.IDT(bookmark.EntryIDType),
|
||||||
Value: bookmark.EntryID,
|
Value: bookmark.EntryID,
|
||||||
}
|
}
|
||||||
entries := []*spec.BookmarkEntry{{
|
entry := spec.BookmarkEntry{
|
||||||
ID: specid,
|
ID: specid,
|
||||||
Type: bookmark.EntryIDType,
|
Type: bookmark.EntryIDType,
|
||||||
}}
|
}
|
||||||
sub.Bookmarks.List = append(sub.Bookmarks.List, &spec.Bookmark{
|
sub.Bookmarks.List = append(sub.Bookmarks.List, &spec.Bookmark{
|
||||||
Username: user.Name,
|
Username: user.Name,
|
||||||
Position: bookmark.Position,
|
Position: bookmark.Position,
|
||||||
Comment: bookmark.Comment,
|
Comment: bookmark.Comment,
|
||||||
Created: bookmark.CreatedAt,
|
Created: bookmark.CreatedAt,
|
||||||
Changed: bookmark.UpdatedAt,
|
Changed: bookmark.UpdatedAt,
|
||||||
Entries: entries,
|
Entry: entry,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return sub
|
return sub
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ type Bookmarks struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Bookmark struct {
|
type Bookmark struct {
|
||||||
Entries []*BookmarkEntry `xml:"entry,omitempty" json:"entry,omitempty"`
|
Entry BookmarkEntry `xml:"entry,omitempty" json:"entry,omitempty"`
|
||||||
Username string `xml:"username,attr" json:"username"`
|
Username string `xml:"username,attr" json:"username"`
|
||||||
Position int `xml:"position,attr" json:"position"`
|
Position int `xml:"position,attr" json:"position"`
|
||||||
Comment string `xml:"comment,attr" json:"comment"`
|
Comment string `xml:"comment,attr" json:"comment"`
|
||||||
|
|||||||
Reference in New Issue
Block a user