fix: panic

This commit is contained in:
ThaUnknown 2025-06-16 20:30:30 +02:00
parent 0db7c3bbd4
commit 361ca69f42
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{
"name": "ui",
"version": "6.3.65",
"version": "6.3.66",
"license": "BUSL-1.1",
"private": true,
"packageManager": "pnpm@9.14.4",

View file

@ -1,5 +1,3 @@
import { authAggregator } from '../auth'
import type { ScheduleMedia } from './queries'
import type { Media } from './types'
import type { Episode, Episodes } from '../anizip/types'
@ -95,7 +93,7 @@ export function episodes (media: Pick<Media, 'aired' | 'notaired' | 'episodes' |
const upcoming = media.aired?.n?.[media.aired.n.length - 1]?.e ?? 0
const past = media.notaired?.n?.[media.notaired.n.length - 1]?.e ?? 0
const progress = authAggregator.mediaListEntry(media)?.progress ?? 0
const progress = media.mediaListEntry?.progress ?? 0
return Math.max(upcoming, past, progress)
}