Fix json post of series & movies

This commit is contained in:
Zoe Roux 2025-05-31 14:40:52 +02:00
parent 291e61073a
commit 720e0e6975
No known key found for this signature in database
3 changed files with 5 additions and 7 deletions

View File

@ -61,7 +61,7 @@ class KyooClient(metaclass=Singleton):
logger.debug("sending movie %s", movie.model_dump_json(by_alias=True))
async with self._client.post(
"movies",
json=movie.model_dump_json(by_alias=True),
data=movie.model_dump_json(by_alias=True),
) as r:
r.raise_for_status()
return Resource(**await r.json())
@ -70,7 +70,7 @@ class KyooClient(metaclass=Singleton):
logger.debug("sending serie %s", serie.model_dump_json(by_alias=True))
async with self._client.post(
"series",
json=serie.model_dump_json(by_alias=True),
data=serie.model_dump_json(by_alias=True),
) as r:
r.raise_for_status()
return Resource(**await r.json())

View File

@ -104,7 +104,7 @@ class FsScanner:
async def _register(self, videos: list[str] | set[str]):
# TODO: we should probably chunk those
vids: list[Video] = []
for path in list(videos)[:1]:
for path in list(videos):
try:
vid = await identify(path)
vid = self._match(vid)

View File

@ -1,8 +1,7 @@
from __future__ import annotations
from asyncio import CancelledError, Event, Future, TaskGroup, sleep
from asyncio import CancelledError, Event, TaskGroup
from logging import getLogger
from types import TracebackType
from typing import Literal, cast
from asyncpg import Connection, Pool
@ -91,7 +90,7 @@ class RequestProcessor:
logger.info("Listening for requestes")
_ = await closed.wait()
logger.info("stopping...")
except CancelledError as e:
except CancelledError:
logger.info("Stopped listening for requsets")
await self._database.remove_listener("scanner_requests", process)
self._database.remove_termination_listener(terminated)
@ -130,7 +129,6 @@ class RequestProcessor:
*
"""
)
logger.warning("toto %s", cur)
if cur is None:
return False
request = Request.model_validate(cur)