def getChapterNumberFrmDB( self, con: sqlite3.Connection | None, cur: sqlite3.Cursor | None, table_name: str, novel_name: str, ) -> int: if (con, cur) == (None, None): return if con is not None: con.row_factory = sqlite3.Row cur = con.cursor() cur.execute(f"SELECT * from {table_name}") r = cur.fetchone() return r[novel_name]