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

Add Distraction Free Settings -> Hide Upcoming Premieres #2853

Merged
merged 1 commit into from Nov 24, 2022
Merged

Add Distraction Free Settings -> Hide Upcoming Premieres #2853

merged 1 commit into from Nov 24, 2022

Conversation

miangraham
Copy link
Contributor

@miangraham miangraham commented Nov 10, 2022

Add Distraction Free Settings → Hide Upcoming Premieres

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #507
see also #1070, #2755

Description

Add a new boolean setting to Distraction Free: "Hide Upcoming Premieres."

When enabled, removes non-live future premieres from subscription and channel pages.

YT-side data unpredictably flips some streams that get "waiting" viewers from premieres into live streams and back. The live streams introduced can be removed by also enabling the "Hide Live Streams" setting.

Seeking feedback: Due to the weird shapeshifting streams issue above, and in order to avoid adding yet another setting, IMO there's a good argument for combining this new option with "Hide Live Streams" and having one switch do both. If you want one on, you probably want the other. I definitely need both myself. Made it a separate switch for now but happy to make the change if maintainers think combining makes sense.

Screenshots

New setting

prem_new_setting

An affected video

prem_vid_info

Setting OFF

The first item is our target.

prem_before

Setting ON

And it's gone.

prem_after

Testing

I've tested the new setting using npm run dev against Local API (no fallback) due to Invidious API not cooperating at present, with Fetch Feeds from RSS both OFF and ON.

For a quick test:

  1. Find a channel with a non-live upcoming premiere video. Subscribe to the channel.
  2. With the setting OFF, verify that the target video appears in Subscriptions.
  3. Turn the setting ON.
  4. Return to Subscriptions and reload.
  5. Verify that the target video no longer appears.

I've tested Subscriptions, Channel and Search pages. If you see areas where I'm not removing videos as appropriate please let me know.

Desktop

  • OS: NixOS
  • OS Version: 22.05
  • FreeTube version: 3f7a2cf

Additional context

This PR conflicts with #2849 and the later merge will need rebasing/fixing. I'm borrowing their excellent showResult() addition to ft-list-lazy-wrapper.js since it's easier to work with than the previous v-if one-liner.

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 10, 2022
@PikachuEXE
Copy link
Collaborator

#2849 might require some time to be merged
Is it possible to exclude the logic (but not the code pattern, like showResult can be keep but without splitChannels)

@miangraham
Copy link
Contributor Author

miangraham commented Nov 11, 2022

Yes, if #2849 looks like it should come after I can definitely clean this one up with the aim of landing first and having no stubs in the meantime.

If that looks likely then I'm also considering moving the new option (and related data/getter additions) higher in the list to sit alongside Hide Live Streams, both because it makes sense for them to have adjacent positions and because it should help avoid many-but-not-all merge conflicts when #2849 needs to rebase on top.

@miangraham miangraham marked this pull request as ready for review November 11, 2022 13:41
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 11, 2022 14:01
@miangraham
Copy link
Contributor Author

I've done some more testing and I think this is ready for a look.

First time contributor playing it by ear on style since it looks like prettier hasn't been used in awhile. Glad to make tweaks as needed--let me know!

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.

Tested locally
Thanks for your work!

}
if (this.hideUpcomingPremieres &&
(data.isUpcoming || data.premiere || data.durationText === 'PREMIERE' ||
(data.isRSS && data.viewCount === '0'))) {
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if we should include the rss check as there could be videos that aren't premiers that will be hidden

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this is (data.isRSS && data.viewCount === '0')
Meaning if using RSS feed and view count is zero, assume it's premiere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pika is correct. This is the only feasible way to remove them in the case of RSS data. There are currently no other flags to pivot on without making an additional request per video.

With RSS data as my only working option at the moment, that line (and the equivalent in Subscriptions.js) is the only reason this feature does anything for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some additional comments alongside this to clarify.

auto-merge was automatically disabled November 14, 2022 08:18

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 14, 2022 08:18
@FreeTubeBot FreeTubeBot merged commit 207d72a into FreeTubeApp:development Nov 24, 2022
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 24, 2022
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.

[Feature Request] Settings to hide video premieres
5 participants