Mikedm139, all I can say is WOW! Thank you so much! There were minor glitches (which I guess you'll find out when you test) but overall, WOW! I had always envisioned such a solution, never thought it possible. Thank you so much for an awesome solution!
Thoughts:
I couldn't however fully test the changes cause I am on OS X 10.6.8 but got to the point where I could connect to the db, after that executing querys just fails due to version mismatch of sqlite3(nothing to do with the plugin code), I have learned that PMS uses respective OS X's python and the built-in version of python's sqlite3. In short, when I "import sqlite3" the version of Python is 2.7.6 and SQLite3 is 3.6.12. PMS uses I think(not sure) Sqlite3 3.8.2 or higher to write to the PMS database via libsqlite3.0.dylib (not sure). OS X 10.6.8 ships with Python 2.6, which I upgraded to 2.7 to use PlexConnect. I could update to a higher version of Python but don't want to have 3 versions in parallel and a path nightmare.
Should ideally work for any OS X above 10.7.5 (I don’t think it would work for OS X 10.6.8 running Python 2.6 or OS X 10.7.5 running Python 2.7, the corresponding sqlite3 versions don’t match with that used by PMS (the libraries it uses to talk to the db in PMS's internal framework))
I am still trying to wrap my head around why PMS would use one version(internal PMS framework version of Sqlite3) to write to the db for all it's tasks and then use the OS X version(python's sqlite3) for other purposes(like the plugin framework) and how it is doing so. I guess it is to prevent exactly what ppl. like us are trying lol.
Very cross-platform : ), windows users may have to install sqlite3 3.8.2 and Python 3, not sure, theory!
The technique is awesome, I however have not fully understood "dict", is each plugin given its own space in dict or is it like a pool for all plugins to use? I ask this cause I saw that the sql query is being saved in dict(the query that will help restore the section detail when unlocked) before the hide/lock process is executed(which deletes the row identifying the section). If another plugin were to reset or clear dict in some way, would the lock plugin still retain the sql query used to restore/unlock the section(s)?. If dict will still have all the data, then there should be no problem :) Otherwise the novice user would never be able to get back the section lost/locked and risk crippling the database (The fact that you have coded such an advanced plugin tells me you've already thought of this, just checking due to the lack of my knowledge on the subject)
Loved the way you got the path of the DB : ) very, very cool! Makes it cross platform.
Overall, can’t wait for you to test!
(Pl. note I updated the unlock command yesterday cause it was using a method of calling the sqlite3 db by using Sqlite3 3.8.2 residing in my Applications folder in OS X 10.6.8, It is the current workaround I use to edit the PMS db via Terminal line)
Conclusions:
Absolutely fantastic!
Suggestion:
I would like to transfer the git ownership of the repo to you(not that you need it ;) ), since you obviously have put so much work into the “correct way” of approaching the solution to lock/unlock. I’m being sincere, I know when I’m in over my head lol, it took me a day to wrap my head around the awesome code you’ve written and cannot in good conscience feel I will do justice in maintaining such a repo. It is my humble request that you start a new thread and post it as your repo, this thread can be closed or left open for hands-on users still on OS X 10.6.8(I will ammend my initial post pointing people to your post)
P.S: This query “UPDATE metadata_items SET added_at='' WHERE library_section_id=” used as one of the queries to lock the db, actually is intended to change the timestamp of the “added_at” so as to not let the “recently added” section show any of the videos recently added in the section that is getting locked in Plex Web and other clients.
I will always be around to brainstorm about the query’s/db and test(if possible) : )
Thank you so much for taking this plugin/thought to another level!