Add UI for viewing the album info returned by Subsonic getAlbumInfo API

- Adding "Get Info" in album page's "meatball" menu. When the option is clicked a pop up appears with
the album information and links to Last.fm and MusicBrainz.

Screenshot:

Fixes #105
This commit is contained in:
natilou
2023-06-27 09:48:36 -03:00
parent ad97c274f3
commit f26e9dbcbf
6 changed files with 154 additions and 1 deletions
+19
View File
@@ -651,3 +651,22 @@ func (c *Controller) sendNotification(title, content string) {
Content: content,
})
}
func (c *Controller) ShowAlbumInfoDialog(albumID, albumName string, albumCover image.Image) {
go func() {
albumInfo, err := c.App.ServerManager.Server.GetAlbumInfo(albumID)
if err != nil {
log.Print("Error getting album info: ", err)
return
}
dlg := dialogs.NewAlbumInfoDialog(albumInfo, albumName, albumCover)
pop := widget.NewModalPopUp(dlg, c.MainWindow.Canvas())
dlg.OnDismiss = func() {
pop.Hide()
c.doModalClosed()
}
c.ClosePopUpOnEscape(pop)
c.haveModal = true
pop.Show()
}()
}