![]() |
Set Hide Watched option value ? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Set Hide Watched option value ? (/showthread.php?tid=379849) |
Set Hide Watched option value ? - jbinkley60 - 2024-12-21 I've searched through the forums, looked through the built-in functions and JSON RPC calls and can't find an answer to the question of whether the current value of the side blade Hide Watched setting can be retrieved and set via any programmatic method from an addon ? I see that it is stored in the guisettings.xml file under myvideos vs. a setting id. It is pretty a coarse option vs. view settings which are by playlist / folder:
I'd prefer not to read / write to the xml file. I feel like I am missing something obvious. Thanks, Jeff RE: Set Hide Watched option value ? - izprtxqkft - 2024-12-21 seems like there should be a way to set the property System.SetBool(myvideos.watchmodemovies) in combination with executebuiltin ? RE: Set Hide Watched option value ? - roidy - 2024-12-21 (2024-12-21, 00:50)jbinkley60 Wrote: I've searched through the forums, looked through the built-in functions and JSON RPC calls and can't find an answer to the question of whether the current value of the side blade Hide Watched setting can be retrieved and set via any programmatic method from an addon ? It's 2 different buttons in a skin, id's 10 and 14. ID 10 cycles through All Videos, Unwatched and Watched. Where as id 14 only cycles through All Videos and Unwatched. So to get the value just call Control.GetLabel(10) and check the returned string for the localized versions of All Videos, Unwatched and Watched. Setting the value is more cumbersome as you need to call SendClick(10) and then read the value again until it's the setting you want. Also this would only work on the MyVideoNav.xml windows as it need direct access to the control. RE: Set Hide Watched option value ? - jbinkley60 - 2024-12-21 (2024-12-21, 02:22)izprtxqkft Wrote: seems like there should be a way to set the property Yeah it would seem that it should be that easy but I am not seeing it. I thought JSON RPC might have something but I am not seeing it there either except for items in guisettings.xml which have a setting id parameter. Thanks, Jeff RE: Set Hide Watched option value ? - jbinkley60 - 2024-12-21 (2024-12-21, 10:25)roidy Wrote: It's 2 different buttons in a skin, id's 10 and 14. ID 10 cycles through All Videos, Unwatched and Watched. Where as id 14 only cycles through All Videos and Unwatched. Yeah, I had seen that in another post from Ronnie and did not want to go that route for a few reasons, including this being checked by an addon service routine, which doesn't interact with the GUI and any Kodi windows. It looks like the path of least resistance is direct XML parsing and writing to guisettings.xml . <sigh> Thanks, Jeff RE: Set Hide Watched option value ? - roidy - 2024-12-21 (2024-12-21, 11:47)jbinkley60 Wrote: It looks like the path of least resistance is direct XML parsing and writing to guisettings.xml . <sigh>I think the problem with that may be that guisettings.xml is only read when Kodi first starts up, and rewritten when Kodi shuts down. That's why any threads talking about making changes to guisetting.xml tell you to make the changes while Kodi isn't running as changes made while Kodi is running don't stick. I think Kodi reads the setting on startup -> uses the in memory settings while running -> then writes the setting file back out on shut down. RE: Set Hide Watched option value ? - jbinkley60 - 2024-12-21 (2024-12-21, 11:57)roidy Wrote: I think the problem with that may be that guisettings.xml is only read when Kodi first starts up, and rewritten when Kodi shuts down. That's why any threads talking about making changes to guisetting.xml tell you to make the changes while Kodi isn't running as changes made while Kodi is running don't stick. I am not completely sure on that with regards to writing. I had seen that in other posts. I did some testing and when I change the Hide Watched value in the GUI I see the guisettings.xml file get changed immediately. But reading appears to be as you say. When I update the guisettings.xml file Kodi doesn't read the setting change and, as you indicate, the running settings overwrite the guisettings.xml file on shutdown so the interim writing to guisettings.xml while running seems a bit meaningless, except maybe to share with other things which may be monitoring the file. Worse yet if I have a playlists with mixed content (i.e. TV Shows and Movies) neither movies nor TV shows seem to matter in the GUI or guisettings.xml file. This looks ripe for a JSON RPC update. My near term choices seem to be: do nothing or monitor the guisettings.xml file and alert the user on changes to the Hide Watch settings. I'll need to think about this a bit more. Thanks, Jeff RE: Set Hide Watched option value ? - pixel8tor - 2024-12-22 Not exactly sure what you want to do, but if you just want to toggle the Hide Watched setting, I set a keyboard keymap: <w mod="ctrl">sendclick(14)</w> So [Ctrl+w] toggles the setting. See: http://forum.kodi.tv/showthread.php?tid=235402&pid=2081707#pid2081707 for more info. HTH RE: Set Hide Watched option value ? - jbinkley60 - 2024-12-22 (2024-12-21, 12:27)jbinkley60 Wrote: My near term choices seem to be: do nothing or monitor the guisettings.xml file and alert the user on changes to the Hide Watch settings. I'll need to think about this a bit more. I've decided to go with the "monitor the guisettings.xml file and alert the user on changes to the Hide Watch settings" approach. Just a few lints of code to read the xml file from my addon monitor service. Not optimal but good enough. Thanks, Jeff |