Nice detective work. I don't think it'll take much to tweak the code for this addition. I'll try to get it updated for testing within the next couple days.
Thank you! I needed to put on my plex glasses :P
Is there a (graceful) way to combine the "UPDATE metadata_items" commands with the ones already being used? My thought is that adding the extra command in sequence rather than parallel means that we're essentially traversing the database twice when locking or unlocking. For large sections that may make a noticeable difference. Or do I not have the concept quite right?
You got the concept right and I see later you implemented the concept brilliantly : )
Can I humbly suggest, that instead of setting the metadata type to 20, then instead add 666 to it.
That way, when unlocking, you substract 666 and get the origen type, thus making it universal for both movies, TV-Shows, and all other currently defined types.
/T
:D
After doing a little more sqlite reading, I think I have a grasp on the way to combine the statements for efficiency.
LOCK_COMMAND_1 = "UPDATE metadata_items SET added_at=?, metadata_type=20 WHERE library_section_id=?;" # section['section_created_at'], section['section_id']and
UNLOCK_COMMAND_1 = "UPDATE metadata_items SET added_at=?, metadata_type=? WHERE library_section_id=?;" # section['section_created_at'], section['section_type'], section['section_id']
Perfect!
Looks like it's throwing an error because it's trying to execute the lock command with no Sections selected. Most likely a by-product of the issues with the setup wizard.
I have 2 concerns with switching from the setup wizard to using prefs.
- There's no proper way to protect the prefs. All users have access to change passwords, change selected sections, etc.
- It's not possible to build a list of prefs dynamically. So allowing users to select which section(s) to lock is not possible via the prefs menu.
I suppose we could use a combination of prefs (for password) and setup wizard (for selecting sections) but that still leaves the gaping security hole associated with the ease of changing password.
@dane22: I think you'll need to manually delete the Dict file for your install to reset the First Run Wizard.
I know that the issue with Plex/Web's handling of multiple InputDirectoryObject's has been brought up before. I'll try to find out if a fix for that is on the horizon. I suspect that if we can't support Plex/Web, that there will be a lot of users getting very frustrated.
Ok, to summarize we have two problems:
- Setup of the channel
- Using PMS internal sqlite3 to make the plugin more cross-platform
Regarding #1 and mind you I’m just thinking out loud here! Is it possible to @route to a HTML.
I was going through the YouTube bundle here (I don’t have a choice I just browse through code coz I’m no good at channel building) and noticed the below lines (133-135)
page_content = HTTP.Request(YOUTUBE_LIVE, cacheTime=0).content page = HTML.ElementFromString(page_content) live_now = page.xpath("//div[contains(@id,'video-page-content')]")[0]
I am guessing page_content is pulling content from a HTML file. I really don’t know what I’m talking about but is it possible to import a static HTML that exists within the bundle? A HTML that is formatted the “plex” way to display all object containers?
If yes, the setup can be done via a HTML that has section data populated via XML(like Mike’s code is currently displaying) and password and confirm password in one page. What I am getting at is Javascript could be used to validate if selections are selected and if the password matches as well. The goal is to save the data in Dict so that too could be done via javascript. I saw the search route uses some version of jQuery. So it is possible, in theory at least?
Completely agree that plexWeb should be the base for setup.
Went through your code from an amateur perspective and could not find the co-relation between SectionSelector and SelectThiSection when does the SelectThiSection get called(event). Maybe that’s why the section is not getting selected.
Also could this(screenshot below) object(checkbox) that we see in PlexWeb be used to select the selections.

Regarding#2 >.> <.< -.- 0.0