CI: Make mypy happy

cleanmedia:133: error: Value of type "tuple[Any, ...] | None" is not indexable  [index]
So we do sanity check that row is not None now before doing something with row[0].
This commit is contained in:
Sebastian Spaeth 2023-09-18 13:39:13 +02:00
parent 7d6dc981e3
commit 9eea97f1e1

View File

@ -130,7 +130,7 @@ class MediaRepository:
with self.conn.cursor() as cur:
cur.execute("SELECT COUNT(media_id) from mediaapi_thumbnail WHERE media_id NOT IN (SELECT media_id FROM mediaapi_media_repository);")
row = cur.fetchone()
if row[0]:
if row is not None and row[0]:
logging.error("You have {} thumbnails in your db that do not refer to media. This needs fixing (we don't do that)!".format(row[0]))