Closes #351: show reissue year in album page header

This commit is contained in:
Drew Weymouth
2024-03-31 08:26:54 -07:00
parent 0c03ac87a1
commit d5f0971aa2
5 changed files with 20 additions and 5 deletions
+6 -1
View File
@@ -3,6 +3,7 @@ package browsing
import (
"fmt"
"log"
"strconv"
"github.com/dweymouth/supersonic/backend"
"github.com/dweymouth/supersonic/backend/mediaprovider"
@@ -362,7 +363,11 @@ func formatMiscLabelStr(a *mediaprovider.AlbumWithTracks) string {
if a.TrackCount == 1 {
tracks = "track"
}
return fmt.Sprintf("%d · %d %s · %s%s", a.Year, a.TrackCount, tracks, discs, util.SecondsToTimeString(float64(a.Duration)))
yearStr := strconv.Itoa(a.Year)
if a.ReissueYear > a.Year {
yearStr += fmt.Sprintf(" (reissued %d)", a.ReissueYear)
}
return fmt.Sprintf("%s · %d %s · %s%s", yearStr, a.TrackCount, tracks, discs, util.SecondsToTimeString(float64(a.Duration)))
}
func (s *albumPageState) Restore() Page {