jurialmunkey / skin.arctic.fuse

Other
164 stars 23 forks source link

:bug: Autoplay trailers in Spotlight mismatch with current item displayed due to time interval not resetting after button click #949

Closed OfficerKD637 closed 3 months ago

OfficerKD637 commented 3 months ago

Skin section

Widgets

Current Behavior

Hey Jurial!

Hope you have been doing well!

I finally decided to give Complex mode a go after several months of sticking with Classic haha.

I noticed a bug where when going through movies/tv shows in the Spotlight, often the trailers that start playing are of different movies/shows than the one currently displayed. The way to get it to play the right movie trailer is to move the selected button (let's say from the right arrow to the left or the 'info' button) and then it resets to play the right trailer.

After playing around with it for a while, it seems the time interval doesn't reset after every button 'click' but rather with every button 'move'.

Here's an example:

Let's use 'Trending Today' in TMDb movies as spotlight.

You start with movie A, then scroll through it by clicking on the left/right arrows.

You are currently at movie F, but the trailer that starts playing is of movie C (that you passed a while ago).

This is because you moved through the buttons (didn't click anything, just move) when you were on Movie C. But subsequently, you just kept on clicking the right arrow button to reach movie F. Once the time interval runs out (which is approx. 4 secs) it plays the trailer of movie C

Once you move the highlighted button (maybe to one of the other arrow buttons or the info button) the trailer stops and then loads the correct trailer.

Hope this makes sense.

Expected Behavior

Fix auto trailer playback in Spotlight to match the current item being displayed.

Steps To Reproduce

  1. Create a Complex setup with a Spotlight
  2. Enable 'Play trailers automatically (Spotlight)'
  3. Scroll through the spotlight by just clicking on any one of the arrow buttons

Screenshots and Additional Info

No response

Checklist

OfficerKD637 commented 3 months ago

I'm not exactly sure but it seems that maybe System.IdleTime is not respecting enter button clicks (on a Windows PC clicking enter while having either of the arrow buttons in focus) but as soon as I move through the buttons (Play, Info, Context Menu, Arrows) with the arrow keys on my keyboard, the trailer stops and after about 3-4 secs the correct trailer starts playing.

jurialmunkey commented 3 months ago

Yeah one of the many many issues with autoplaying trailers.

Kodi will evaluated $INFO at the time the AlarmClock command to delay playing the trailer is triggered (onfocus of the button). If the item changes from an autoscroll before it triggers then you end up with the wrong trailer.

There is no "onchange" type of trigger to trigger a new alarm when the item changes, and to trigger a new AlarmClock onclick means we get the previous item trailer (because onclick the button hasn't moved the item yet).

All of which makes it impossible to manage well and why I resisted adding for so long. Autoplay trailers is buggy and experimental, and will always be buggy and experimental because Kodi has no good way to do it properly -- any solution is going to be massively complicated to try to handle all the possible scenarios with workaround hacks.

jurialmunkey commented 3 months ago

^^^ This commit will improve it by trying to get the next/prev trailer onclick which should improve it significantly and reduce how frequently this type of scenario occurs when navigating, but it is impossible to fix perfectly because Kodi simply does not have the type of action triggers needed to do it well.

OfficerKD637 commented 3 months ago

Any improvement is always better than nothing! I can't thank you enough for trying to work around Kodi's limitations to cater to such a huge number of requests from all of us.

Truly truly grateful.