MoojMidge / service.upnext

GNU General Public License v2.0
19 stars 5 forks source link

Kodi 21 / Playcount is occasionally resetting during normal playback which is affecting check if still watching #30

Closed booyakafoo closed 1 month ago

booyakafoo commented 1 month ago

https://paste.kodi.tv/cohilafiqe.kodi

I have noticed that occasionally I am seeing playbacks continuing on without stopping. Other times it seems to stop playback when it should be when "Auto played in a row: 3 of 3". I noticed this after upgrading to Kodi Omega v21 (21.0.1)

At line 154-2024-05-13 10:05:33.807 you can see there is a video check attempt #1 and it looks like it is successful and gets the required info. There is a status of a pupup due and popup starting in 1361s.

Then there is a reset at line 162

Then another video check #1 at line 163

Then a play count reset at line 168 due to group change but there should have been no group change.
2024-05-13 10:05:43.967 T:16916 debug : [service.upnext] UpNextState -> Reset playcount: group change - unknown to 179-Married... with Children-3

MoojMidge commented 1 month ago

Then there is a reset at line 162

It is doing this this because for some reason you are getting two playback events for the same file. UpNext responds to both, but thinks the second event is unrelated to previous video playback because it has already handled that in the first playback event, and therefore resets the internal state.

Not sure why this would occur. Would need to see a proper Kodi debug log to see what may have caused this to occur.

booyakafoo commented 1 month ago

https://paste.kodi.tv/ejuluqiwus.kodi

Here is another occurrence with a full debug.

MoojMidge commented 1 month ago

Weird, it is definitely opening the same exact file twice.

Does this happen all the time or just occasionally?

What do you have set for this Kodi setting: https://kodi.wiki/view/Settings/Player/Videos#Play_next_video_automatically

Try disabling this and seeing what happens.

booyakafoo commented 1 month ago

Play next video automatically was set to TV shows. I will test without that.

It doesn't happen every time but often enough that it has been noticeable. Thanks

booyakafoo commented 1 month ago

Changing the Play next video automatically didn't seem to make any difference. It's still happening.

MoojMidge commented 1 month ago

Yeah didn't think it would but just wanted to check.

Won't have time to check what Kodi is doing for a while.

In the meantime there is a start delay setting in Settings > Expert > Troubleshooting > Start delay.

Default is 5 seconds. Try changing it to 10 seconds and see if that avoids the problem.

booyakafoo commented 1 month ago

I appreciate you taking the time. No rush. I seem to be able to reproduce it fairly easily. I had already changed the start delay to 10 seconds to see if there was a difference but there isn't.

My setup might be a little unique. Arctic Fuse, TheMovieDb Helper addon, I'm playing from the TMDb helper addon either from Your Next Episodes or browsing series/episodes in TMDb helper addon and playing but I have all the episodes in my library so they are playing from the library and not another addon/player. If I use an addon player I don't expect or want Up Next to work. Only if I have the episodes in my library.

Here is some additional info on when it seems to only check once vs when it checks twice. If you need any full debugs, let me know. Thanks again.

https://paste.kodi.tv/kajanemaji.kodi

MoojMidge commented 1 month ago

Oh I think i know what the problem is now. Try to disable Settings > Expert > Enable UpNext queue > Pre-emptive UpNext queue reset and see if it works.

If so, then https://github.com/MoojMidge/service.upnext/commit/5bf4219bf9c4a1f4403338167bd04021e042198c should fix the problem with the setting enabled

booyakafoo commented 1 month ago

That did work. I had to exit Kodi and restart for that setting change to take effect (I think). Wasn't working when I initially changed it but is working after changing and restarting Kodi. I think this can be closed out now. Thank you for the help!!

MoojMidge commented 1 month ago

And does it also work with the setting enabled and the linked changes?

booyakafoo commented 1 month ago

Yes it is working with the recent changes as well. I've tested multiple times and am no longer seeing the double video check attempt with the "Pre-emptive upnext queue reset" enabled or disabled. Thanks.

MoojMidge commented 1 month ago

Thanks for confirming