Skip to content

fix: ignore stale YouTube duration reports#557

Merged
azfoo merged 1 commit into
devfrom
fix/youtube-duration-video-identity
Jul 24, 2026
Merged

fix: ignore stale YouTube duration reports#557
azfoo merged 1 commit into
devfrom
fix/youtube-duration-video-identity

Conversation

@azfoo

@azfoo azfoo commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

getDuration() is queried asynchronously on each UNSTARTED player-state transition. Opening a second YouTube-backed file reuses the same YouTubePlayer/QWebEngineView instance (media type unchanged, so _change_player_type never tears it down), so a query issued for the first video can resolve after the second has already loaded, silently overwriting App.duration with a value that belongs to the wrong video.

Thread the video_id the query was issued for through the callback chain and discard results that no longer match the currently loaded video.

…ideo

getDuration() is queried asynchronously on each UNSTARTED player-state transition. Opening a second YouTube-backed file reuses the same YouTubePlayer/QWebEngineView instance (media type unchanged, so _change_player_type never tears it down), so a query issued for the first video can resolve after the second has already loaded, silently overwriting App.duration with a value that belongs to the wrong video.

Thread the video_id the query was issued for through the callback chain and discard results that no longer match the currently loaded video.
@azfoo
azfoo merged commit 97039c4 into dev Jul 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant