mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
fix(frontend): exclude /watch from isPlaylistSource
youtube.com/watch?v=...&list=... and music.youtube.com/watch are single videos in the backend (Source::YouTubeVideo / YouTubeMusicTrack) regardless of the list param. Previously isPlaylistSource returned true for these, which would have triggered the playlist probe path while the video probe was already running, and the render would attempt to show playlist UI on an item whose playlistProbeState stays idle. Guard: if pathname === '/watch', return false before the list-param check.
This commit is contained in:
parent
0ea61a29a1
commit
6717fa48cf
3 changed files with 7 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Archivr</title>
|
||||
<script type="module" crossorigin src="/assets/index-JerAE27R.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-BGQ5_lWF.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-vCRGeW0A.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -87,11 +87,16 @@ function isPlaylistSource(locator) {
|
|||
const url = new URL(l)
|
||||
const host = url.hostname
|
||||
if (host === 'youtube.com' || host === 'www.youtube.com' || host === 'm.youtube.com') {
|
||||
// /watch?v=...&list=... is a single video — backend routes it to YouTubeVideo,
|
||||
// not YouTubePlaylist, regardless of the list param.
|
||||
if (url.pathname === '/watch') return false
|
||||
if (url.searchParams.has('list')) return true
|
||||
if (url.pathname.startsWith('/@') || url.pathname.startsWith('/channel/') ||
|
||||
url.pathname.startsWith('/c/') || url.pathname.startsWith('/user/')) return true
|
||||
}
|
||||
if (host === 'music.youtube.com') {
|
||||
// /watch is a single track even if it has a list param
|
||||
if (url.pathname === '/watch') return false
|
||||
if (url.pathname.startsWith('/playlist') || url.searchParams.has('list')) return true
|
||||
}
|
||||
} catch {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue