Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
v18 How to update UI of different Kodi instances when the database changes?
#1
I've got a setup where two Kodi 18.6 share the same MariaDB database. That's working fine, but when I turn off the TV in the living room and want to watch one more episode in the bedroom I first have to play and stop a random file or reboot Kodi or otherwise update the library to make it refresh watch states or show recently added files on that instance. Is there are way to (preferably automatically) have Kodi monitor the database for changes and update the UI when relevant?

Relevant information: both systems run Kodi 18.6. The one in my living room runs on Windows 10, the one in the bedroom on a Pi 4 with LibreELEC. I have external software that notifies the Kodi instance in the living room of new updates so its database is normally up to date, the one in the bedroom does not get those updates so that I don't end up updating the same information in the shared database at the same time. But that does mean the UI of the instance in the bedroom has no idea that the data changed. Likewise the one in the living room has no idea of the changed play states of individual episodes or movies if I watched something in the bedroom and then move to the living room, though that is less of an issue because that fixes itself as soon as the external software pushes a new file.

Is there anything I can do to keep the UI of both systems in sync with the most recent data in the database?
Reply
#2
You could try and Reload the Skin, that might pull it through, it should be an option in your Power menu.
Reply
#3
I'll give it a try, but that sounds pretty similar to just starting and immediately stopping a random episode. I'd prefer a more robust solution if possible.

I forgot to add in my question that I'm just using the default theme by the way, in case that is relevant.
Reply
#4
So I guess there is no proper solution for this? Seems like a weird oversight for something that is actually documented as a feature.
Reply
#5
(2020-04-12, 20:17)NMe84 Wrote: but when I turn off the TV in the living room and want to watch one more episode in the bedroom

Unless your TV has super powers via CEC (which hardly any TV has), only powering off your TV will not have Kodi come to make a complete stop when its power is being cut off, so-to-speak.
It's probably a 1st World problem, but stopping the video via Kodi (this will store the resume point in Kodi's database) and THEN powering down the TV will make things a lot easier. There is no active link between Kodi clients that will trigger or notify the database update.

You could (re)assign a key for refresh/reloading the Kodi screen, something that developers do all the time. It is not an oversight, it simply works a little different then perhaps advertised.
Reply
#6
(2020-04-18, 19:55)Klojum Wrote: Unless your TV has super powers via CEC (which hardly any TV has), only powering off your TV will not have Kodi come to make a complete stop when its power is being cut off, so-to-speak.
It's probably a 1st World problem, but stopping the video via Kodi (this will store the resume point in Kodi's database) and THEN powering down the TV will make things a lot easier. There is no active link between Kodi clients that will trigger or notify the database update.

You could (re)assign a key for refresh/reloading the Kodi screen, something that developers do all the time. It is not an oversight, it simply works a little different then perhaps advertised. 

Of course I'm stopping the video first, I think you misunderstood the issue. The problem is not that I can't continue watching in the bedroom, the problem is that when I do, the UI doesn't show newly added episodes or remove ones that it already knew about but I've watched on the other Kodi instance. It will update that state the second I play and immediately stop any video or when I restart Kodi so that it refreshes its data from the database but those both seem like stupid workarounds to something that sounds to me like it should have a more elegant solution.

As for assigning keys, I don't think I can assign keys over CEC, can I? To me it would make a lot of sense if I could set it on a timer, so that the database is checked every x minutes (15-60, perhaps configurable?) unless a video is currently playing. The entire idea of sharing a database between multiple instances is to actually share the state and not having that state carry over without manual steps seems to defeat part of the purpose.
Reply
#7
Just re-map a key to Reload the skin, it's literally one key-press. See https://forum.kodi.tv/showthread.php?tid=76233
Reply
#8
(2020-04-19, 13:26)FXB78 Wrote: Just re-map a key to Reload the skin, it's literally one key-press. See https://forum.kodi.tv/showthread.php?tid=76233
It's a press that shouldn't be necessary, IMO. But ignoring that for a minute, as I mentioned above I'm using my TV remote over CEC. I don't think I can map anything to that, can I?
Reply
#9
(2020-04-19, 14:26)NMe84 Wrote:
(2020-04-19, 13:26)FXB78 Wrote: Just re-map a key to Reload the skin, it's literally one key-press. See https://forum.kodi.tv/showthread.php?tid=76233
It's a press that shouldn't be necessary, IMO. But ignoring that for a minute, as I mentioned above I'm using my TV remote over CEC. I don't think I can map anything to that, can I?  
Yes, of course you can. Just turn on Debug logging and the keypress will show in the log with the Key ID you need to use.

Once you find your key id something like this should work in gen.xml (keymap)

Code:
<keymap>
  <global>
    <keyboard>
      <key id="XXX">XBMC.ReloadSkin()</key>
    </keyboard>
  </global>
</keymap>
Reply

Logout Mark Read Team Forum Stats Members Help
How to update UI of different Kodi instances when the database changes?0