This is the defaultspref
[
{
"id": "hide_nsfw",
"type": "bool",
"label": "Hide nsfw (not safe for work) videos?",
"default": "false"
},
{
"id": "show_domains",
"type": "bool",
"label": "Show the Domains menu?",
"default": "true"
},
{
"id": "channel_password",
"label": "Set your password for changing channel preferences.",
"type": "text",
"option": "hidden",
"default": " ",
"secure": "true"
}
]
in my top menu I have this:
# Preferences (This should only show until a new password has been set)
Log('Starting the channel and the password should be')
Log(Prefs['channel_password'])
if Prefs['channel_password'] == " ":
oc.add(PrefsObject
(title='Change channel settings'))
# Enter password for preferences (This should show once the default password has been changed)
if Prefs['channel_password'] != " ":
oc.add(InputDirectoryObject
(key=Callback(verify_prefs_password),
title='Change settings',
summary='You need to enter a password to change the settings for this channel.',
prompt="Enter the channel's password."))
And here's the function
def verify_prefs_password(query):
if query == Prefs['channel_password']:
Log('1. The query matched the prefs password with')
Log(Prefs['channel_password'])
oc = ObjectContainer()
oc.add(PrefsObject(title='Change channel settings'))
#
# The problem seems to be right here. The PrefsObject shows up again, but when I put in a new password, the log shows
# the same old password from before.
return oc
elif Prefs['channel_password'] == " ":
Log('2. The channel password is set to the default with')
Log(Prefs['channel_password'])
return ObjectContainer(header="Channel Settings",
message="You need to set a password in the channel preferences.")
else:
Log('3. The channel password and the query did not match')
Log(Prefs['channel_password'])
Log(query)
return ObjectContainer(header="Channel Settings",
message="You entered the wrong password for changing channel settings.")