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

Playback should reset near the end of a video / next episode should show up on the dashboard #713

Closed
EchoDev opened this issue Dec 27, 2018 · 3 comments
Milestone

Comments

@EchoDev
Copy link

EchoDev commented Dec 27, 2018

If a video is in the last 5-10 second (maybe 20 seconds, a percentage or the outro that is set per show in the settings?) it should reset playback to the start of the video.

If you have watched an episode of a show and you return later to it to rewatch it, the video seems to just jump to the end since that is what was registered as last watched, it would be nice if a reset could be implemented at a predefined mark.

If I rewatch a show it just jumps from credits to credits now heh

@EchoDev
Copy link
Author

EchoDev commented Dec 29, 2018

I made a small workaround for this issue. To use this workaround you need to use a mysql backend, I'm not sure how to edit the H2 backend that is selected by default.

To use this workaround you need to create 3 columns in the viewing_status table all three set to datatype INT and default NULL
The columns you need to create are: difference, tvshowprofileid and tempcount

Then you need to set a crontab with the following command, make sure to edit the mysql username, password and database, rest should work fine

mysql --user=mysqlusername --password=mysqlpassword --database=databasename --execute="UPDATE viewing_status SET difference = (runtime-current_play_time); UPDATE viewing_status SET tvshowprofileid = concat(user_id, tv_show_id); UPDATE viewing_status a INNER JOIN ( SELECT tvshowprofileid, COUNT(*) AS tempcount FROM viewing_status GROUP BY tvshowprofileid ) b ON a.tvshowprofileid = b.tvshowprofileid SET a.tempcount = b.tempcount; DELETE FROM viewing_status WHERE difference < 60 AND tempcount > 1; UPDATE viewing_status SET tempcount=NULL"

This SQL query checks for the following:

  1. How large is the difference (in seconds) between the full runtime of an episode and where you left off
  2. It checks how many episodes of a specific show is registered in the viewing_status table
  3. If there are more than 1 episodes of a specific show is registered and the runtime left is less than 60 seconds it deletes the records

This basically makes it possible to rewatch episodes without have to manually skip back to the beginning but makes sure not to delete the record of the episode you are watching right now.

@f1reflyyyylmao
Copy link
Contributor

I think it'd be better to check for this when we add a video to the player:
The player loads a video -> Checks if it's ~120s from the end (discussable, we should also check if it got a timestamp for the credits that we can use) -> If the time is over the threshold reset replay
This way the user can see what he already watched.

@dularion
Copy link
Member

dularion commented Apr 13, 2020

I added this feature now in the backend, when listing the continue-watching list.
I also went for 95%, since it felt like it worked nicely for both tvshows and videos.
Maybe down the road i'll make it configurable if anyone wants a different value

@dularion dularion added this to the 8.1.3 milestone Apr 13, 2020
dularion pushed a commit that referenced this issue Apr 13, 2020
@dularion dularion changed the title Playback should reset if playback is in last 5-10 seconds of video Playback should reset near the end of a video / next episode should show up on the dashboard Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants