mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-07 10:14:13 -04:00
Fix json post of series & movies
This commit is contained in:
parent
291e61073a
commit
720e0e6975
@ -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())
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user