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

Mark (local) episode as watched when playing next #77

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dagwieers
Copy link
Collaborator

@dagwieers dagwieers commented Oct 30, 2019

This PR includes:

  • Mark the current episode as watched
  • Reset resume position of the next episode before playing

This fixes #64 for local media.

@dagwieers

This comment has been minimized.

@dagwieers dagwieers force-pushed the reset-resumetime branch 3 times, most recently from b720728 to 88924e5 Compare December 12, 2019 23:51
@dagwieers
Copy link
Collaborator Author

This is now confirmed to be working. With the new settings we can actually use a large notification time (i.e. 60 secs) for very short episode (e.g. 7 mins) to easily test this.

The default cutoff time for Marking as Watched is 8% which would be 32 secs for a 7 min episode. So if you would click on "Watch Now" the current episode would not be marked as watched, but be marked as unfinished.

This is now fixed, and on top of that, batched JSONRPC queries work as well and are very efficient.

@dagwieers dagwieers force-pushed the reset-resumetime branch 3 times, most recently from 2a5f690 to 53edfd2 Compare December 13, 2019 02:28
@dagwieers dagwieers changed the title Reset resumetime before playing Mark (local) episode as watched when playing next Dec 13, 2019
@dagwieers dagwieers force-pushed the reset-resumetime branch 3 times, most recently from 3ed467c to 4d345ba Compare December 13, 2019 18:46
This PR includes:
- Mark the current episode as watched
- Reset resume_time for next episode so it starts from beginning
@dagwieers dagwieers added the enhancement New feature or request label Dec 25, 2019
@dagwieers dagwieers added this to the v1.1.0 milestone Dec 25, 2019
@dagwieers dagwieers removed this from the v1.1.0 milestone Jan 14, 2020
sleep(200)

# Mark the current episode as watched and reset position
jsonrpc(dict(method='VideoLibrary.SetEpisodeDetails', params=dict(episodeid=current_episodeid, playcount=1, resume=dict(position=0))))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We probably want to increase the existing playcount, rather than set it to 1 to indicate watched.

Copy link
Owner

Choose a reason for hiding this comment

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

Not to sure, from memory I think Kodi only cares about it being either 0 or 1 and I think some addons possibly check for it actually being 1 to mark as watched.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct if you only consider the Watched flag. But I just recently made a pull request to add this information to the Video info pane so it is exposed to the user in Kodi Matrix 🙄

So we might as well do the right thing here. Especially since we already have the playcount IIRC.

Copy link
Owner

Choose a reason for hiding this comment

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

Cool so my memory was correct! Yeah let’s go for it then 😉

@dagwieers dagwieers added this to the v1.1.1 milestone Jan 21, 2020
@notoco
Copy link
Contributor

notoco commented Jan 22, 2020

I've just noticed that I've been having this problem, too - I'm looking forward to turning on this PR

@dagwieers
Copy link
Collaborator Author

@notoco This is just for local media, we are waiting for changes in Kodi (see xbmc/xbmc#17202) to be accepted. That would allow us to do the same for VOD content (plugin:// URLs). Which would be a neat feature for Up Next to have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When next episode was already partly watched, a selection comes up
3 participants