How to force update of home screen for random/unwatched/unplayed items?
#1
On its home screen for Movies, TV shows, and Music, Estuary has lists of random and unwatched movies, unwatched TV shows, and random and unplayed music. These lists have different contents each time the home screen is refreshed, and I want to refresh it at will to show me random stuff as another way to browse. I found the method linked below a while back when looking for a way to refresh the home screen after performing a database update on a different machine for my shared database, and while it does work for this new desire, it dumps me back to the Movies home screen if I invoke it while in the TV or Music home screens. To be clear, I'm talking about the Home screen with different items selected from the categories on the left, Movies, TV shows, Music, etc. When I get the currentwindow using JSON, it always returns "Home" regardless of what category is selected. If I invoke this hypothetical refresh function while showing Music on the home screen, I want to stay in the Music section, not be dumped back to Movies. Any ideas?

Here's the method I'm currently using, which works, but dumps me back to the Movies home screen every time:

https://forum.kodi.tv/showthread.php?tid...pid2647874

For anyone contemplating using this, I did have to change control_id from 805 to 806, as Kodi 21 Estuary now uses ID 805.
Reply
#2
Map ReloadSkin() to a button.
Reply
#3
(2024-11-29, 07:15)crawfish Wrote: On its home screen for Movies, TV shows, and Music, Estuary has lists of random and unwatched movies, unwatched TV shows, and random and unplayed music. These lists have different contents each time the home screen is refreshed, and I want to refresh it at will to show me random stuff as another way to browse. I found the method linked below a while back when looking for a way to refresh the home screen after performing a database update on a different machine for my shared database, and while it does work for this new desire, it dumps me back to the Movies home screen if I invoke it while in the TV or Music home screens. To be clear, I'm talking about the Home screen with different items selected from the categories on the left, Movies, TV shows, Music, etc. When I get the currentwindow using JSON, it always returns "Home" regardless of what category is selected. If I invoke this hypothetical refresh function while showing Music on the home screen, I want to stay in the Music section, not be dumped back to Movies. Any ideas?

Here's the method I'm currently using, which works, but dumps me back to the Movies home screen every time:

https://forum.kodi.tv/showthread.php?tid...pid2647874

For anyone contemplating using this, I did have to change control_id from 805 to 806, as Kodi 21 Estuary now uses ID 805.
I don't think you need to reload the skin if you run the library update.  A library update will, as far as I can remember, force a refresh of the widgets on its own.  It's worth trying the option you linked without the reload skin option.  That would keep you from getting dumped back to the movie screen.
Reply
#4
(2024-11-29, 15:09)pkscout Wrote: I don't think you need to reload the skin if you run the library update.  A library update will, as far as I can remember, force a refresh of the widgets on its own.  It's worth trying the option you linked without the reload skin option.  That would keep you from getting dumped back to the movie screen.

Ah. Getting rid of ReloadSkin solved the problem for TV Shows, but the home screen for Music didn't update. However, adding an UpdateLibrary for Music solved that problem. So the new script consists of:

Code:
xbmc.executebuiltin('UpdateLibrary(video,special://skin/sripts)')
xbmc.executebuiltin('UpdateLibrary(music,special://skin/sripts)')

Great! One last thing. I've created a script addon so I can execute this from JSON. I take it that's still the only way? (I know about keymaps but need to do this with JSON.)
Reply
#5
(2024-11-29, 18:02)crawfish Wrote: I've created a script addon so I can execute this from JSON.

there are more ways to execute json rpc than just an addon

https://kodi.wiki/view/HOW-TO:Remotely_update_library

in addition to those a tcp socket can be used even if less popular
Reply
#6
(2024-11-29, 19:31)izprtxqkft Wrote: there are more ways to execute json rpc than just an addon

https://kodi.wiki/view/HOW-TO:Remotely_update_library

in addition to those a tcp socket can be used even if less popular

I use curl extensively to execute JSON commands from autohotkey scripts. The issue is doing things JSON doesn't support, like executing scripts directly. AFAIK, the only way to do that from JSON is to use Addons.ExecuteAddon. However, I see now that JSON does support the directory arguments for VideoLibrary.Scan and AudioLibrary.Scan, so presumably, I should be able to implement the modified script entirely with JSON, making the addon unnecessary. I had previously abandoned that idea because JSON does not appear to support ReloadSkin or the equivalent of xbmc.executebuiltin the script uses, but pkscout was right, and I don't need to use ReloadSkin, so a pure JSON solution seems possible now.

ETA: The pure JSON method does work, no addon necessary. Nice!
Reply
#7
the complete overkill and unnecessary method to do things in kodi not provided by the current json-rpc

create a service addon that runs it's own json rpc server
- https://kodi.wiki/view/Service_add-ons
- https://github.com/gclluch/jsonrpc-server/

then you can proxy existing functions to kodi's own json-rpc and add extra ones to suit your own functionality

-----

just one method, as stated unnecessary though
Reply

Logout Mark Read Team Forum Stats Members Help
How to force update of home screen for random/unwatched/unplayed items?0