fix(types): annotate CursorResult.rowcount for mypy in delete_orphans

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs
This commit is contained in:
Estrella Pan
2026-07-03 14:26:40 +02:00
parent 5c0b0b12a7
commit a0da83d8d3

View File

@@ -154,7 +154,8 @@ class TorrentDatabase:
delete(Torrent).where(Torrent.bangumi_id.is_(None)) # type: ignore[union-attr]
)
await self.session.commit()
count = result.rowcount
# execute(delete()) 返回 CursorResult,mypy 只能推断出基类 Result[Any]
count = result.rowcount # type: ignore[attr-defined]
if count > 0:
logger.debug("Deleted %s orphan torrents.", count)
return count