fix async handling in SerieScanner and add image_downloader cleanup

- SerieScanner.scan() now detects running event loop and uses create_task()
  when already in async context, avoids RuntimeError
- NFOService.close() now also closes image_downloader to prevent resource leaks
- Add integration tests for TMDBClient lifecycle management

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-27 20:47:29 +02:00
parent b9c55f9e7a
commit d358a07290
3 changed files with 86 additions and 2 deletions

View File

@@ -784,6 +784,7 @@ class NFOService:
async def close(self):
"""Clean up resources."""
await self.tmdb_client.close()
await self.image_downloader.close()
async def create_minimal_nfo(
self,