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

Make progress bars of watched streams filled #6310

Conversation

triallax
Copy link
Contributor

@triallax triallax commented May 15, 2021

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

When you finish a video and see it in your watch history, the red bar usually shown on the thumbnail is not present. The cause is that the player resets the watch progress of videos when they are done, so that when the video is played again it would start from the beginning. This PR instead saves the actual watch progress and then starts from the beginning in the player (still didn't figure out how to do this part).

Fixes the following issue(s)

APK testing

On the website the APK can be found by going to the "Checks" tab below the title and then on "artifacts" on the right.

Due diligence

@@ -65,8 +65,8 @@ public void setProgressTime(final long progressTime) {

public boolean isValid(final int durationInSeconds) {
final int seconds = (int) TimeUnit.MILLISECONDS.toSeconds(progressTime);
return seconds > PLAYBACK_SAVE_THRESHOLD_START_SECONDS
&& seconds < durationInSeconds - PLAYBACK_SAVE_THRESHOLD_END_SECONDS;
return (Math.abs(seconds - durationInSeconds) <= 1) || (seconds > PLAYBACK_SAVE_THRESHOLD_START_SECONDS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's done like this since for some reason, the duration of a video appears to be rounded up from the actual duration (e.g. for a completed video with a length of 50 seconds, seconds might be 49).

@triallax triallax added bug Issue is related to a bug help wanted Help is wanted in fixing this issue labels May 17, 2021
@rey0n
Copy link

rey0n commented Jun 6, 2021

+100 actually came to make very same topic. either it's a bug or needs an improvement, but really uncomfortable to not understand if video was actually watched or i just clicked it and then skipped.

@Stypox
Copy link
Member

Stypox commented Jun 7, 2021

@mhmdanas I'd just consider a StreamStateEntity valid if progressTime > 5000ms, like I did here: https://github.com/TeamNewPipe/NewPipe/pull/3371/files#diff-a0ab8fd31a182abbafe19a264e1d72f8c9bf89707c79821679f57786b1724df7R66

@opusforlife2
Copy link
Collaborator

opusforlife2 commented Nov 12, 2021

Problem already solved, mysteriously. (dun dun duuuuuun)

@Stypox
Copy link
Member

Stypox commented Nov 13, 2021

Yes, this was fixed in #3371

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug help wanted Help is wanted in fixing this issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show completely watched videos
4 participants