-
Notifications
You must be signed in to change notification settings - Fork 117
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
Cannot disable refresh after watching #1072
Comments
Got a log of loading My Subscriptions, playing a video, and seeing the listing reload? |
Ok, so it just so happened I got 9s on initial load and for the refresh after first play. 8^d So afterwards I did a manual refresh and another play, and got 33s and 40s respectively. I also did another run, per the first and got 9s initial load and a 28s refresh after first play. Having said all of that, I would still prefer NOT to refresh after every play (but preferably when the cache timer expires)...! 8^D |
This option was always just a refresh of the Kodi container content, and I believe it was originally intended to update a video listing so that the Kodi watched status was properly displayed. It serves no purpose in recent versions of Kodi and this addon, since:
People complained about the play related context menu items being too far down in the list... there have also been recent changes in the Kodi context menu that may make it necessary to have these items at the top of the list. The compromise was to have refresh close to the bottom of the list so it can be selected quickly by scrolling up (rather that down) in the context menu.
Your logs indicate that things are working largely as expected. The reason that the caching doesn't appear to work is because new content is available that is not in your cache. That being said, it is not necessary to check all your subscriptions all the time. The current beta changed to fetching subscriptions sorted by last active, and this can be extended further. Try the following:
|
Thanks @MoojMidge That's all very helpful.
I guess the retort to this is if I'm likely to have new content in my feed, then I'm unlikely to hit the cache. I can't check it right now, but I have probably forgotten to increase my cache size since last setup wizard run. Also the changes in 2faf94b look like they will certainly help. I'll try to run #1073 asap and let you know. |
That made a demonstrable difference. Formatted log: https://paste.kodi.tv/hegidoqeto.kodi |
The refresh happens all the time. It is done by Kodi itself and cannot be disabled. However you are making things worse for yourself because you are manually triggering a refresh (which bypasses the addon cache) and then when Kodi does its own refresh it will then also bypass the cache. Normally when a plugin url does not change then the plugin invocation will just silently use the internal Kodi disc cache. Except when Kodi does its own forced refresh. To manually trigger a refresh the addon therefore needs to change the plugin url and does this by adding a query parameter to the plugin url, which is the parsed and used to identify that the addon cache should be bypassed. However now everytime you play a video from the same listing, Kodi will force refresh the listing (can't be disabled), and because you triggered a manual refresh previously which added the refresh query parameter to the plugin url, every single one of the forced refreshes will also bypass the addon cache. Try #1073 again, it has been updated to include some improvements to handling the various locks used in the addon, which the profiler indicates is causing slowdowns on your device, and also workaround the Kodi forced refresh bypassing the addon cache if a manual refresh was triggered beforehand. |
Take 3... 8^d 8^D |
And again. The changes to disable the refresh parameter has broader consequences that needed to be properly handled. Don't really see any changes on a faster system, but it should result in some noticeable improvements for slower systems I think. Already saw duration drop from 20s to 15s and 9s to 6s in your logs, depending on whether the feeds needed to be fetched and parsed, let's see if the lock contention changes offer any further improvements. |
Thanks @MoojMidge All good. Giving that a try now... |
Updated again. Profiler seems to indicate that disk I/O used for the data cache may be a bottleneck. |
Thanks. I'll give it a try shortly.
Yep, SD card. |
That's almost bearable... 8^D Formatted log: https://paste.kodi.tv/olatikacib.kodi |
Lol you are tough to please. Not sure there is more to be optimised, but that will do for now. |
Many thanks for the optimisations...! I'm adjusting... 8^d |
Don't quite get this. Kodi has been doing this since version 16 or 17 I think. Are you saying that something has actually changed recently?
Try changing this from
|
Thanks for further works..!
Yeah, when you said this earlier, it had me thinking that perhaps I just wasn't perceiving it before...
Yes, it has definitely changed.
I see the recent commit (MoojMidge@2906797), so I'll give your master another go... |
Can you get a debug log when using https://github.com/anxdpanic/plugin.video.youtube/releases/tag/v7.1.0.1? Recent version are consistently faster than this older version for me. |
Formatted log: https://paste.kodi.tv/cediqoxupe.kodi Notable differences in experience with v7.1.0.1:
Differences [3] and [4] are illusory, for which I wouldn't suggest any change. Difference [1] is really the one that I struggle with, especially after mistakenly playing the wrong video, or when needing to replay a video due to issues like that at [2]. The refresh after stopping in more recent versions adds to the frustration of needing to replay the video. I think I probably stop many videos early too. Previously, I might have skipped to the end to pre-empt an expected refresh. Regarding speed, it wasn't clear to me which version was faster, as each version has a somewhat different experience. |
Thanks for the logs.
That is not what your log shows. Everytime the video stops, the previous video listing is reloaded. This has been standard Kodi behavior for a very long time. It takes around 3 seconds to refresh the listing according to your logs. However one key difference between v7.1.0.1 is that the listing wasn't filled if you were filtering, so in v7.1.0.1 you are only displaying around 25 items but in recent versions you are displaying the full 50. The last log you provided showed that this takes around 5 seconds in newer versions, and I would expect the latest commits to make that slightly faster again.
As mentioned in your other issue there is nothing in your log that would indicate why you are not hearing the audio. The logs are pretty much identical in that regards. The recent version will add some latency to the streaming, but can't see why that would stop the audio (and not the video) completely. One thing you could check is the Player process info and confirm that what it says about the audio for a working and non-working play through.
Now this might explain what you are perceiving to be a slowdown. The newer versions have a progress dialog, and I suspect what you are seeing is Kodi queueing these GUI dialogs up so that the busy spinner that occurs after video playback completes prior to the next dialog is shown, which delays the refresh of the listing. To confirm you can comment out these two lines:
|
Thanks for having a look.
This resolved the issue for me. Neither the Kodi spinner nor progress dialog now show after stopping a video. I'm guessing users might be split as to preference on this one. Perhaps a new setting can help accommodate both? The refresh is now certainly quick. Thank you for the tuning. |
Not going to happen unfortunately. If the latest commits (https://github.com/MoojMidge/plugin.video.youtube/archive/refs/heads/master.zip) don't resolve the problem, you will either need to live with it or comment out those lines yourself. |
Good thing your latest cut appears to offer a reasonable compromise...! 8^D In practice, in seems to not refresh (returning immediately to the list) if the watched threshold hasn't yet been reached. It's looking pretty polished. Thanks again..! |
That's not really what's happening, of course. It's a bit of a mixed bag. It seems a little less stable... Trying the latest master... |
Very rarely getting a change of viewtype (from WideList) when stopping a video early, where the watched status icon becomes a thumbnail. This hasn't shown up in some time, being a previously fixed bug. Sometimes the watched status is volatile (disappears after playing other videos) or does not update. This happens quite a lot but every time I run debug logging it doesn't happen... Maybe a race somewhere? Anyway, iinm these seem to have been (re)introduced with commits addressing this issue.... EDIT: Tagged Mooj in case this was overlooked... |
Context
Expected Behavior
When "Refresh after watching" is disabled, My Subscriptions will not be refreshed when a video finishes.
Current Behavior
My Subscriptions is refreshed after every video finishes despite setting of "Refresh after watching".
Additional Information
iirc, the setting "Refresh after watching" was originally implemented by @anxdpanic as a stop-gap measure prior to the introduction of the cache mechanism to slow the rate of Data API calls and hence quota limit hits, and to improve performance. At some point the setting appears to have been relegated to the subsection Mark as watched, and perhaps no longer serves it's original purpose.
Due to recent changes re refresh of My Subscriptions, the list is refreshed after every video plays and every page navigation. With 248 channels and 3 bookmarked (MadeForKids) channels this takes over 20 seconds each time on some of my platforms. Previously, this would take 20s on the initial load and then about 9s for each refresh, per this. This then improved to 10 to 11 seconds for the initial load, per this. We are now back to 20+ seconds per refresh and I must say there is no longer a perception that there is any caching performed whatsoever.
This very significant reduction in performance is ruining the user experience and is very frustrating.
It is my understanding the present refresh solution was implemented due to complaints that the My Subscriptions list was not updating at a sufficiently high enough frequency for some users. I would suggest a more widely acceptable solution might be to have a setting dictate the refresh frequency with choices being the standard cache retention periods + an option to refresh after every video is watched.
In similar vein, if refreshes do not occur after every video is watched, the Refresh context menu item would best be relocated back to the top of the menu rather than somewhere near the middle bottom...
The text was updated successfully, but these errors were encountered: