Fix #646: Sort artist discography by full date

This commit is contained in:
Drew Weymouth
2025-06-24 08:33:40 -07:00
parent 62cfcfffd8
commit b8f83ae399
2 changed files with 22 additions and 2 deletions
+20
View File
@@ -38,6 +38,26 @@ type ItemDate struct {
Day *int
}
func (i ItemDate) After(other ItemDate) bool {
a := []*int{i.Year, i.Month, i.Day}
b := []*int{other.Year, other.Month, other.Day}
for i := range a {
if a[i] == nil {
return false
}
if b[i] == nil {
return true
}
if *a[i] < *b[i] {
return false
}
if *a[i] > *b[i] {
return true
}
}
return false
}
type Album struct {
ID string
CoverArtID string