优化续播

This commit is contained in:
truewhile
2026-09-01 23:16:11 +08:00
parent 3fe37e050b
commit b503fdee7a
57 changed files with 739 additions and 410 deletions
+8 -3
View File
@@ -6,7 +6,8 @@ import toast from 'react-hot-toast'
import { historyAPI } from '../api/history'
import { imageURL } from '../api/client'
import { confirmAction } from '../components/confirmAction'
import type { HistoryItem } from '../types'
import { isRemoteEmbyID } from '../utils/remoteEmby'
import type { HistoryItem, Media } from '../types'
function fmtDuration(ms: number): string {
if (!ms || ms <= 0) return '—'
@@ -90,8 +91,12 @@ export function WatchHistoryPage() {
<div className="space-y-3">
{items.map((h) => {
const m = h.media
if (!m) return null
const m: Media = h.media || ({
id: h.media_id,
title: isRemoteEmbyID(h.media_id) ? '远程媒体' : h.media_id,
poster_url: '',
updated_at: h.watched_at,
} as Media)
const progress =
h.duration_ms > 0 ? h.position_ms / h.duration_ms : 0
return (