From 86e8d2911709312e7ea96a7efde9226e9440b7ae Mon Sep 17 00:00:00 2001 From: Faiz Ahmed <32914211+Sleepingpirates@users.noreply.github.com> Date: Mon, 26 Jul 2021 14:07:02 -0400 Subject: [PATCH] Fixed Plex_LIBS bug --- app/bot/cogs/app.py | 6 +++--- app/bot/helper/plexhelper.py | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/bot/cogs/app.py b/app/bot/cogs/app.py index 9400f14..f8be037 100644 --- a/app/bot/cogs/app.py +++ b/app/bot/cogs/app.py @@ -99,7 +99,7 @@ class app(commands.Cog): async def addtoplex(self, email, channel): if(plexhelper.verifyemail(email)): - if plexhelper.plexadd(plex,email): + if plexhelper.plexadd(plex,email,Plex_LIBS): await self.embedinfo(channel, 'This email address has been added to plex') return True else: @@ -111,7 +111,7 @@ class app(commands.Cog): async def removefromplex(self, email, channel): if(plexhelper.verifyemail(email)): - if plexhelper.plexadd(plex,email): + if plexhelper.plexremove(plex,email): await self.embedinfo(channel, 'This email address has been removed from plex.') return True else: @@ -136,7 +136,7 @@ class app(commands.Cog): email = await self.getemail(after) if email is not None: await self.embedinfo(after, "Got it we will be adding your email to plex shortly!") - if plexhelper.plexadd(plex,email): + if plexhelper.plexadd(plex,email,Plex_LIBS): db.save_user(str(after.id), email) await asyncio.sleep(5) await self.embedinfo(after, 'You have Been Added To Plex! Login to plex and accept the invite!') diff --git a/app/bot/helper/plexhelper.py b/app/bot/helper/plexhelper.py index 51af569..0e99e83 100644 --- a/app/bot/helper/plexhelper.py +++ b/app/bot/helper/plexhelper.py @@ -1,9 +1,7 @@ from plexapi.myplex import MyPlexAccount import re -from app.bot.helper.confighelper import Plex_LIBS -def plexadd(plex, plexname): - global Plex_LIBS +def plexadd(plex, plexname, Plex_LIBS): try: if Plex_LIBS[0] == "all": Plex_LIBS = plex.library.sections()