Best way to implement a reset toggle ?

Hello,

 

I would like to implement a feature that performs two actions: resets the User Preferences to those defined in the default, and calls Dict.reset() to clear cached content that was previously generated.  I was thinking of a simple boolean "preference" that, once checked (i.e. True), will trigger the aforementioned actions, then be reset to False.

 

I realise that there are any number of ways to potentially accomplish this, but I'm curious to know if there's a particularly canonical work-flow already established for this sort of scenario.  For example, would putting these actions directly in ValidatePrefs() be appropriate, or should it be elsewhere ?

 

As a corollary, is there a clean way to set User Preferences, i.e. one that doesn't involve crafting HTTP calls to internal endpoints via bespoke URLs ?

 

Thank you.

Described in the doc from this post:

https://forums.plex.tv/topic/87348-undocumented-functionality-and-tips-tricks/?p=506039

And used in the Find_Unmatched bundle (Check my signature)

/T

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.