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() reset()
elif mode == 'togglePlexTV': elif mode == 'togglePlexTV':
entrypoint.togglePlexTV() entrypoint.toggle_plex_tv_sign_in()
elif mode == 'resetauth': elif mode == 'resetauth':
entrypoint.resetAuth() entrypoint.reset_authorization()
elif mode == 'passwords': elif mode == 'passwords':
passwords_xml() passwords_xml()
@ -141,7 +141,7 @@ class Main():
plex_command('RUN_LIB_SCAN', 'textures') plex_command('RUN_LIB_SCAN', 'textures')
elif mode == 'chooseServer': elif mode == 'chooseServer':
entrypoint.chooseServer() entrypoint.choose_pms_server()
elif mode == 'refreshplaylist': elif mode == 'refreshplaylist':
log.info('Requesting playlist/nodes refresh') 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 Lets user choose from list of PMS
""" """
@ -73,7 +73,11 @@ def chooseServer():
sound=False) 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'): if settings('plexToken'):
LOG.info('Reseting plex.tv credentials in settings') LOG.info('Reseting plex.tv credentials in settings')
settings('plexLogin', value="") settings('plexLogin', value="")
@ -98,9 +102,10 @@ def togglePlexTV():
sound=False) sound=False)
##### DO RESET AUTH ##### def reset_authorization():
def resetAuth(): """
# User tried login and failed too many times User tried login and failed too many times. Reset # of logins
"""
resp = dialog('yesno', heading="{plex}", line1=lang(39206)) resp = dialog('yesno', heading="{plex}", line1=lang(39206))
if resp == 1: if resp == 1:
LOG.info("Reset login attempts.") LOG.info("Reset login attempts.")