This commit is contained in:
Croneter 2018-06-15 13:44:46 +02:00
parent 0d1275a1bb
commit d4bd51379d
2 changed files with 13 additions and 8 deletions

View File

@ -112,10 +112,10 @@ class Main():
reset()
elif mode == 'togglePlexTV':
entrypoint.togglePlexTV()
entrypoint.toggle_plex_tv_sign_in()
elif mode == 'resetauth':
entrypoint.resetAuth()
entrypoint.reset_authorization()
elif mode == 'passwords':
passwords_xml()
@ -141,7 +141,7 @@ class Main():
plex_command('RUN_LIB_SCAN', 'textures')
elif mode == 'chooseServer':
entrypoint.chooseServer()
entrypoint.choose_pms_server()
elif mode == 'refreshplaylist':
log.info('Requesting playlist/nodes refresh')

View File

@ -36,7 +36,7 @@ except IndexError:
###############################################################################
def chooseServer():
def choose_pms_server():
"""
Lets user choose from list of PMS
"""
@ -73,7 +73,11 @@ def chooseServer():
sound=False)
def togglePlexTV():
def toggle_plex_tv_sign_in():
"""
Signs out of Plex.tv if there was a token saved and thus deletes the token.
Or signs in to plex.tv if the user was not logged in before.
"""
if settings('plexToken'):
LOG.info('Reseting plex.tv credentials in settings')
settings('plexLogin', value="")
@ -98,9 +102,10 @@ def togglePlexTV():
sound=False)
##### DO RESET AUTH #####
def resetAuth():
# User tried login and failed too many times
def reset_authorization():
"""
User tried login and failed too many times. Reset # of logins
"""
resp = dialog('yesno', heading="{plex}", line1=lang(39206))
if resp == 1:
LOG.info("Reset login attempts.")