Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update subscription cache when subscribing from the channel page #5717

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Sep 18, 2024

Update subscription cache when subscribing from the channel page

Pull Request Type

  • Feature Implementation

Related issue

#5185 (review)

Inspired by: #4667

Description

When you visit a channel that you are already subscribed to, we update the subscription cache with the data we fetched to display on that channel. This pull request expands that to cover subscribing to a channel on the channel page too, as we already have the data we might as well add it to the cache. While this doesn't specifically help with the scenario in the video in this comment #5185 (review) (subscribing from the search results), it does solve it for the channel page.

As YouTube doesn't provide any published dates on the shorts tab, we unfortunately cannot cache the data from that tab, however we can still cache the videos, live and community tabs.

Testing

  1. Turn off "Subscription Settings" -> "Fetch Feed Automatically"
  2. Refresh your subscriptions
  3. Subscribe to a channel that you are not subscribed to yet from the search page
  4. Visit the subscriptions page
  5. Notice that instead of showing the cached videos it says that you have turned off automatic fetching
  6. Unsubscribe from that channel from any page that is not the channel page
  7. Go back to the subscriptions page and notice that it shows the cached videos again
  8. Visit the channel page of a channel you are not subscribed to yet
  9. Subscribe to that channel from the channel page
  10. Go back to the subscriptions page
  11. It should be showing the previously cached videos as well as the videos from the channel you just subscribed to.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: ddb495a

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) September 18, 2024 20:32
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 18, 2024
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

Works for sub, live, community post

src/renderer/views/Channel/Channel.js Show resolved Hide resolved
PikachuEXE
PikachuEXE previously approved these changes Sep 19, 2024
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

image

Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc left a comment

Choose a reason for hiding this comment

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

All tabs ok but shorts/live tab is showing that i have turned off automatic fetching

Edit: live only not showing up when channel you are subscribing to has a podcast tab and no live tab

2nd edit: this is happening for all tabs under the following condition. If channel you are subscribing to only has one tab e.g. only shorts tab. You will see the message in the subscription page on the videos/live/community tab

3rd edit: if channel has shorts the message still shows up but i think that has todo with YT breaking us so that will probably be fixed in #5679. Lol cant read ty @PikachuEXE

@PikachuEXE
Copy link
Collaborator

As YouTube doesn't provide any published dates on the shorts tab, we unfortunately cannot cache the data from that tab, however we can still cache the videos, live and community tabs.

@absidue absidue dismissed stale reviews from PikachuEXE and ChunkyProgrammer via ab39a45 September 19, 2024 17:21
@FreeTubeBot FreeTubeBot merged commit 841e301 into FreeTubeApp:development Sep 20, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 20, 2024
@absidue absidue deleted the sub-cache-on-subscribe branch September 20, 2024 05:41
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Sep 21, 2024
* development:
  Fix video start time handling (FreeTubeApp#5719)
  Local API: Handle new shorts node (FreeTubeApp#5679)
  Update subscription cache when subscribing from the channel page (FreeTubeApp#5717)
  Translated using Weblate (English (United Kingdom))
  Implement persistent subscription cache (FreeTubeApp#5185)
  Translated using Weblate (Belarusian)
  Bump npm-run-all2 from 6.2.2 to 6.2.3 (FreeTubeApp#5708)
  Translated using Weblate (Swedish)
  Bump shaka-player from 4.11.1 to 4.11.3 (FreeTubeApp#5707)
  Translated using Weblate (Persian)
  v Downgrade electron-builder 25.x > 24.x (FreeTubeApp#5712)
  Translated using Weblate (Persian)
  Translated using Weblate (Persian)

# Conflicts:
#	src/renderer/views/Channel/Channel.js
#	src/renderer/views/Channel/Channel.vue
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