feat: show release year instead of type on top release cards

Added date field to LBTopReleaseGroup from the LB API's
release_group.date. Card now displays the 4-digit year
extracted via extractYear() instead of the release type.
This commit is contained in:
2026-03-30 00:20:20 -04:00
parent 1f9b3452fa
commit 078db73e75
3 changed files with 6 additions and 1 deletions
+3
View File
@@ -114,6 +114,7 @@ type LBTopReleaseGroup struct {
Title string `json:"title"` Title string `json:"title"`
ArtistName string `json:"artistName"` ArtistName string `json:"artistName"`
Type string `json:"type"` Type string `json:"type"`
Date string `json:"date"`
TotalListenCount int `json:"totalListenCount"` TotalListenCount int `json:"totalListenCount"`
} }
@@ -126,6 +127,7 @@ type lbTopReleaseGroupWire struct {
ReleaseGroup struct { ReleaseGroup struct {
Name string `json:"name"` Name string `json:"name"`
Type string `json:"type"` Type string `json:"type"`
Date string `json:"date"`
} `json:"release_group"` } `json:"release_group"`
Artist struct { Artist struct {
Artists []struct { Artists []struct {
@@ -145,6 +147,7 @@ func (w lbTopReleaseGroupWire) toPublic() LBTopReleaseGroup {
Title: w.ReleaseGroup.Name, Title: w.ReleaseGroup.Name,
ArtistName: artistName, ArtistName: artistName,
Type: w.ReleaseGroup.Type, Type: w.ReleaseGroup.Type,
Date: w.ReleaseGroup.Date,
TotalListenCount: w.TotalListenCount, TotalListenCount: w.TotalListenCount,
} }
} }
@@ -1212,7 +1212,7 @@ export class ExploreArtistDetails extends LitElement {
${rg.title} ${rg.title}
</div> </div>
<div class="top-release-meta"> <div class="top-release-meta">
${rg.type ? html`<span>${rg.type}</span>` : nothing} ${rg.date ? html`<span>${extractYear(rg.date)}</span>` : nothing}
</div> </div>
</div> </div>
</div> </div>
+2
View File
@@ -39,6 +39,7 @@ export namespace explore {
title: string; title: string;
artistName: string; artistName: string;
type: string; type: string;
date: string;
totalListenCount: number; totalListenCount: number;
static createFrom(source: any = {}) { static createFrom(source: any = {}) {
@@ -51,6 +52,7 @@ export namespace explore {
this.title = source["title"]; this.title = source["title"];
this.artistName = source["artistName"]; this.artistName = source["artistName"];
this.type = source["type"]; this.type = source["type"];
this.date = source["date"];
this.totalListenCount = source["totalListenCount"]; this.totalListenCount = source["totalListenCount"];
} }
} }