bug处理

This commit is contained in:
truewhile
2026-09-14 21:40:13 +08:00
parent 1ec8303fec
commit fa4c90d47a
7 changed files with 94 additions and 5 deletions
+4 -2
View File
@@ -70,7 +70,9 @@ func SortSeriesCards(cards []SeriesCard, field, order string, history map[string
}
sort.SliceStable(out, func(i, j int) bool {
cmp := compareSeriesByField(out[i], out[j], spec, history)
if cmp == 0 {
// updated_at 表示最后一集添加日期。远程卡片可能没有该字段,此时
// 保持调用方给定的顺序,不要用 ID 再次打乱。
if cmp == 0 && spec.Field != "updated_at" {
cmp = compareID(out[i].Key, out[j].Key)
}
return cmp < 0
@@ -173,7 +175,7 @@ func seriesUpdatedTime(card SeriesCard) (time.Time, bool) {
if card.LastAddedAt != nil && !card.LastAddedAt.IsZero() {
return *card.LastAddedAt, true
}
return mediaUpdatedTime(card.Rep)
return time.Time{}, false
}
func seriesLastPlayed(card SeriesCard, history map[string]time.Time) (time.Time, bool) {