def thread_exists(thread: Dict[str, str or int], db: sqlite3.Connection) \
-> bool:
"""
Checks if a reddit discussion thread with the given thread parameters
already exists
:param thread: The thread to check for
:param db: The database to check
:return: True if the thread exists, false otherwise
"""
result = db.execute(
"SELECT * FROM anime_reminder_threads "
"WHERE show_name=? AND episode=? AND thread=?",
(thread["show_name"], thread["episode"], thread["url"])
)
return len(result.fetchall()) > 0
# noinspection SqlNoDataSourceInspection,SqlDialectInspection,SqlResolve
评论列表
文章目录