hook up favorite status with GridView items

This commit is contained in:
Drew Weymouth
2024-12-28 16:37:59 -08:00
parent ee9fd597f9
commit f702ef5c31
4 changed files with 36 additions and 15 deletions
+8 -4
View File
@@ -60,6 +60,8 @@ func (g gridViewAlbumIterator) NextN(n int) []GridViewItemModel {
CoverArtID: al.CoverArtID,
Secondary: al.ArtistNames,
SecondaryIDs: al.ArtistIDs,
CanFavorite: true,
IsFavorite: al.Favorite,
}
if y := al.Date.Year; y != nil {
model.Suffix = strconv.Itoa(*al.Date.Year)
@@ -84,10 +86,12 @@ func (g gridViewArtistIterator) NextN(n int) []GridViewItemModel {
albumsLabel = lang.L("album")
}
return GridViewItemModel{
Name: ar.Name,
ID: ar.ID,
CoverArtID: ar.CoverArtID,
Secondary: []string{fmt.Sprintf("%d %s", ar.AlbumCount, albumsLabel)},
Name: ar.Name,
ID: ar.ID,
CoverArtID: ar.CoverArtID,
Secondary: []string{fmt.Sprintf("%d %s", ar.AlbumCount, albumsLabel)},
CanFavorite: true,
IsFavorite: ar.Favorite,
}
})
}