Hey Zarquon,
I didn't test your script yet because I was busy with implementing my last features (not only because the new Home Plex features are not yet available on my Samsung TV, but also because it's a good exercise to learn Python, Sqlite and Plex's framework; reason why I try a bit of everything: Prefs, Dict, Data, Http Query, etc...)..
Now, there is no customization anymore required in the shell scripts... neither to "hide" the libraries (by deleting the section from the DB) nor to make it "empty" (by changing the section id in the metadata).
I can indeed now do the configuration directly in the plugin. I display a list of the existing libraries and one can select those to be "controlled"...
Next, I pass that list to the scripts as an additional parameters. And to recreate the deleted section, I dump them first in a temporary file...
Here is the scenario:
- First time one starts the plugin, one has access to "Update Feed" and "Configure" as well as to Plugin's Preferences.
- By default, in the Preferences, the locking mode is "empty" (my favorite as one doesn't need to refresh the Plex Client. Also less "risky" as it doesn't delete any data).
- Click on "Configure" to select the libraries to be controlled. (Y) is added in front of the name when a library is controlled. Notice that the display is in "List mode" when using Plex Web and in "Poster mode" when using PHT... I cannot get it?!
- Once the libraries to be controlled are all selected, click "Done". Click "Clear" to deselect all the libraries. Notice that one cannot reselect/deselect a library that has just been deselected/selected... Another point that I cannot get?!
- Once configuration done, one has access to "Lock" (currently with the lock mode between brackets as a reminder while testing)
- if one clicks on "Lock", the controlled libraries' sections are deleted when using hide mode and the metadata are "detached".
If the "Lock" technically succeeds, the button disappears and one has now access to the "Unlock" and "Short Unlock" buttons instead (currently with the unlock mode between brackets as a reminder while testing. The unlock mode is obviously the lock mode that was applied by the "Lock" button. It's required to determine if sections must be recreated). In addition, while libraries are locked, the Configuration button becomes unavailable (changing the controlled libraries while some are locked could result in a mess, especially with the "hide" mode).
If one clicks next on "Unlock" or "Short Unlock" (and the operation technically succeeds), the "Lock" and "Configure" buttons reappear while the two others disappear.
If by any accident an operation fails (ex.: due to any sqlite command failure), both "Lock" and "Unlock" buttons are made available, so then can be used to retry once the bug is fixed in the scripts. But one has to be careful as the losing the temporary file with sections' data could be fatal. Also, the Configure button can be used to reset the "failed" status.
heu... voilà. It still requires a lot of testing and improvement* but the bases is there IMO. Next time I play with it, I will insert your code to handle sqlite!
* for example, there is no "home" button in PHT. So going back to the home screen is a real pain in...