Fix PostgreSQL migration resume and home crash guard

This commit is contained in:
ShukeBta
2026-06-15 20:13:30 +08:00
parent 0a628a76f1
commit fea1b1dda1
8 changed files with 356 additions and 44 deletions
+4 -2
View File
@@ -60,9 +60,11 @@ function seriesTitleFromPath(path?: string): string {
return normalizeTitle(parts[dirIndex])
}
export function groupSeries(items: Media[]): SeriesCard[] {
export function groupSeries(items: Media[] = []): SeriesCard[] {
const safeItems = Array.isArray(items) ? items : []
const groups = new Map<string, SeriesCard>()
for (const m of items) {
for (const m of safeItems) {
if (!m) continue
const key = getSeriesKey(m)
const g = groups.get(key)