def getTop(cls, by: str = 'user', limit: int = 10) -> list: if limit == 'max': top = cls.execute( Executor.select("*", f"{by}", order="rating desc")) return top top = cls.execute( Executor.select("*", f"{by}", order="rating desc", limit=limit)) return top
def exists(cls, user: str) -> bool: try: if cls.execute(Executor.select("*", "user", f"name='{user}'")): return True except: return False return False
def exists(self) -> None: try: if self.execute( Executor.select("name", "lang", f"name='{self.name}'")): return True except: return False return False
def getStat(cls, user: str) -> list: if not (cls.exists(user)): cls.addStat(user) stat = cls.execute(Executor.select("*", "user", f"name='{user}'")) stat = stat[0] return stat
def exist(cls, beatmap: int) -> bool: try: if cls.execute( Executor.select("beatmap", "user", f"beatmap={beatmap}")): return True except: return False return False
def getPushedMaps(cls, user: str) -> list: pushed = cls.execute( Executor.select("pushed", "user", f"name='{user}'"))[0][0] if pushed: pushed = eval(pushed) else: pushed = list() return pushed
def get_language(self) -> str: lang = self.execute( Executor.select("lang", "lang", f"name='{self.name}'"))[0] return lang[0]
def getLastNP(cls) -> list: last = cls.execute(Executor.select('*', 'np'))[0] return last