added support for admin account

This commit is contained in:
Blacktwin 2018-04-12 15:39:19 -04:00
parent 59add7f167
commit 90738fc076

View File

@ -68,8 +68,13 @@ plex = PlexServer(PLEX_URL, PLEX_TOKEN, session=sess)
sections_lst = [x.title for x in plex.library.sections()]
user_lst = [x.title for x in plex.myPlexAccount().users()]
# Adding admin account name to list
user_lst.append(plex.myPlexAccount().title)
def get_account(user):
if user == plex.myPlexAccount().title:
server = plex
else:
# Access Plex User's Account
userAccount = plex.myPlexAccount().user(user)
token = userAccount.get_token(plex.machineIdentifier)