Repository navigation
FIX: Render each video in a post with its own status - #107
Merged
Merged
Conversation
Previously, `renderVideos` applied every entry of `post.discourse_video` to every video embed in the post, and an entry for another video fell through to the pending placeholder. In a post with several videos, an errored video could show as pending depending on the order of the entries, and an embed of an unknown video id always did. A video embedded twice, which has one entry per embed, got two players in each embed and two download links. This change looks up the status of each embed's own video, as the code did before 723959a (#25). Embeds without a status are left untouched, as they already were in posts without any status. It also adds acceptance tests for per-embed statuses and repeated embeds.
This was referenced Oct 22, 2026
Grubba27
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously,
renderVideosapplied every entry ofpost.discourse_videoto every video embed in the post, and an entry for another video fell through to the pending placeholder. In a post with several videos, an errored video could show as pending depending on the order of the entries, and an embed of an unknown video id always did. A video embedded twice, which has one entry per embed, got two players in each embed and two download links.This change looks up the status of each embed's own video, as the code did before 723959a (#25). Embeds without a status are left untouched, as they already were in posts without any status.
It also adds acceptance tests for per-embed statuses and repeated embeds.
Part of a stack of PRs, to be merged in order: