Skip to content

Conversation

@absidue
Copy link
Member

@absidue absidue commented Aug 19, 2023

Fix playlist view on the watch page not reacting to playlist changes

Pull Request Type

  • Bugfix

Related issue

#3895 (comment)

Description

Currently the playlist view on the watch page doesn't react to the playlist changing, when you jump directly from one playlist to another one, without leaving the watch page in between.

This bug exists because unlike the other components on the watch page, the playlist view stays mounted when the video changes, this is to avoid refetching the playlist for every video in the same playlist.

Screenshots

Screenshot from the comment:
image

Testing

Paste the first playlist URL into the search bar, afterwards the second one, the playlist view on the watch page should update to the second playlist instead of continuing to show the first one.

playlist 1: https://www.youtube.com/watch?v=xEyR5dCQs60&list=PLa4zmfXkL4P2khNoEOGA8NEOgFwHIWGIX

playlist 2: https://www.youtube.com/watch?v=HUlR6zQjTmw&list=PLa4zmfXkL4P0UaXti2bPFpsyi3K_IE0rB

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 19, 2023
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) August 19, 2023 12:13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}
},
playlistId: function (newVal, oldVal) {
if (oldVal !== newVal) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this conditional...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to refetch the playlist if the id is the same

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's called when value not updated too? (It's inside watch)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, we definitely set the property every time the video changes, but i'm not sure if watch is triggered on every set or just when the value changes. We have this pattern inside watches in a few places which made me think it might get triggered for every set but i'm not sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can always remove the check later, if we find out that it's redundant.

@FreeTubeBot FreeTubeBot merged commit 8c6bfaa into FreeTubeApp:development Aug 21, 2023
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 21, 2023
@absidue absidue deleted the fix-watch-playlist-change branch August 21, 2023 01:13
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Aug 21, 2023
* development:
  Fix playlist view on the watch page not reacting to playlist changes (FreeTubeApp#3897)
  Bump version number to v0.19.0
  Fix linting issues
  Translated using Weblate (Bulgarian)
  Ignore broken audio tracks for videos with multiple audio tracks (FreeTubeApp#3851)
  local API: Add support for PageHeader hashtag header (FreeTubeApp#3896)
  Translated using Weblate (German)
  Translated using Weblate (Swedish)
  Upgrade YouTube.js to version 6.0 (FreeTubeApp#3895)

# Conflicts:
#	src/renderer/components/ft-list-playlist/ft-list-playlist.vue
#	src/renderer/components/watch-video-playlist/watch-video-playlist.vue
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Aug 21, 2023
* feature/playlist-2023-05:
  Fix playlist view on the watch page not reacting to playlist changes (FreeTubeApp#3897)
  Bump version number to v0.19.0
  Fix linting issues
  Translated using Weblate (Bulgarian)
  Ignore broken audio tracks for videos with multiple audio tracks (FreeTubeApp#3851)
  local API: Add support for PageHeader hashtag header (FreeTubeApp#3896)
  Translated using Weblate (German)
  Translated using Weblate (Swedish)
  Upgrade YouTube.js to version 6.0 (FreeTubeApp#3895)
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.

5 participants