Set Hide Watched option value ?
#1
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:

Hide Watched:
    <myvideos>
        <watchmodemovies>1</watchmodemovies>
        <watchmodetvshows>0</watchmodetvshows>
        <watchmodemusicvideos>0</watchmodemusicvideos>
        <watchmoderecordings>0</watchmoderecordings>
        <playlist>
            <repeat>false</repeat>
            <shuffle>false</shuffle>
        </playlist>
        <needsupdate>0</needsupdate>
    </myvideos>

I'd prefer not to read / write to the xml file.  I feel like I am missing something obvious.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#2
seems like there should be a way to set the property

System.SetBool(myvideos.watchmodemovies) in combination with executebuiltin ?
Reply
#3
(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.
Reply
#4
(2024-12-21, 02:22)izprtxqkft Wrote: seems like there should be a way to set the property

System.SetBool(myvideos.watchmodemovies) in combination with executebuiltin ?

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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#5
(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.

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.

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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#6
(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.
Reply
#7
(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 think Kodi reads the setting on startup -> uses the in memory settings while running -> then writes the setting file back out on shut down.

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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#8
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=...pid2081707 for more info.

HTH
Reply
#9
(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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Set Hide Watched option value ?0
This forum uses Lukasz Tkacz MyBB addons.