mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-05-15 16:41:57 +00:00
fix: panic
This commit is contained in:
parent
0db7c3bbd4
commit
361ca69f42
2 changed files with 2 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ui",
|
"name": "ui",
|
||||||
"version": "6.3.65",
|
"version": "6.3.66",
|
||||||
"license": "BUSL-1.1",
|
"license": "BUSL-1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.14.4",
|
"packageManager": "pnpm@9.14.4",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import { authAggregator } from '../auth'
|
|
||||||
|
|
||||||
import type { ScheduleMedia } from './queries'
|
import type { ScheduleMedia } from './queries'
|
||||||
import type { Media } from './types'
|
import type { Media } from './types'
|
||||||
import type { Episode, Episodes } from '../anizip/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 upcoming = media.aired?.n?.[media.aired.n.length - 1]?.e ?? 0
|
||||||
const past = media.notaired?.n?.[media.notaired.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)
|
return Math.max(upcoming, past, progress)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue