Discover Sonarr episode downloads and keep live tracker updating
Magent CI/CD / verify (push) Canceled after 1m9s
Magent CI/CD / deploy-prod (push) Canceled after 0s
Magent CI/CD / deploy-beta (push) Canceled after 0s

This commit is contained in:
2026-09-06 22:46:01 +12:00
parent bd668715a3
commit 625f9ad7f0
7 changed files with 157 additions and 10 deletions
+4 -7
View File
@@ -445,12 +445,8 @@ export default function RequestTimelinePage() {
const liveDownloadKey = useMemo(() => {
const downloadStage = snapshot?.presentation?.pipeline?.find((stage) => stage.id === 'download')
if (!downloadStage?.visible || downloadStage.state !== 'active') return ''
return (downloadStage.torrents ?? [])
.filter((torrent) => (torrentProgress(torrent) ?? 100) < 100)
.map((torrent) => String(torrent.hash ?? torrent.name ?? 'download'))
.sort()
.join('|')
if (!downloadStage || downloadStage.state === 'complete') return ''
return 'discover-and-track'
}, [snapshot])
useEffect(() => {
@@ -459,7 +455,7 @@ export default function RequestTimelinePage() {
let timer: number | undefined
let controller: AbortController | null = null
const schedule = () => {
if (!stopped) timer = window.setTimeout(() => void refresh(), 2_000)
if (!stopped) timer = window.setTimeout(() => void refresh(), 5_000)
}
const refresh = async () => {
if (document.visibilityState === 'hidden') {
@@ -890,6 +886,7 @@ export default function RequestTimelinePage() {
const progress = torrentProgress(torrent)
return (
<div className="request-torrent" key={torrent.hash ?? torrent.name}>
{torrent.episodeLabel && <small>{torrent.episodeLabel}</small>}
<div><strong>{torrent.name ?? 'Download'}</strong><span>{progress === null ? 'Progress unavailable' : formatProgress(progress)}</span></div>
{progress !== null && (
<div