mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-07 18:24:14 -04:00
Fix json post of series & movies
This commit is contained in:
parent
505427f0ff
commit
9b68110cf6
@ -61,7 +61,7 @@ class KyooClient(metaclass=Singleton):
|
|||||||
logger.debug("sending movie %s", movie.model_dump_json(by_alias=True))
|
logger.debug("sending movie %s", movie.model_dump_json(by_alias=True))
|
||||||
async with self._client.post(
|
async with self._client.post(
|
||||||
"movies",
|
"movies",
|
||||||
json=movie.model_dump_json(by_alias=True),
|
data=movie.model_dump_json(by_alias=True),
|
||||||
) as r:
|
) as r:
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return Resource(**await r.json())
|
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))
|
logger.debug("sending serie %s", serie.model_dump_json(by_alias=True))
|
||||||
async with self._client.post(
|
async with self._client.post(
|
||||||
"series",
|
"series",
|
||||||
json=serie.model_dump_json(by_alias=True),
|
data=serie.model_dump_json(by_alias=True),
|
||||||
) as r:
|
) as r:
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return Resource(**await r.json())
|
return Resource(**await r.json())
|
||||||
|
@ -104,7 +104,7 @@ class FsScanner:
|
|||||||
async def _register(self, videos: list[str] | set[str]):
|
async def _register(self, videos: list[str] | set[str]):
|
||||||
# TODO: we should probably chunk those
|
# TODO: we should probably chunk those
|
||||||
vids: list[Video] = []
|
vids: list[Video] = []
|
||||||
for path in list(videos)[:1]:
|
for path in list(videos):
|
||||||
try:
|
try:
|
||||||
vid = await identify(path)
|
vid = await identify(path)
|
||||||
vid = self._match(vid)
|
vid = self._match(vid)
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from asyncio import CancelledError, Event, Future, TaskGroup, sleep
|
from asyncio import CancelledError, Event, TaskGroup
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from types import TracebackType
|
|
||||||
from typing import Literal, cast
|
from typing import Literal, cast
|
||||||
|
|
||||||
from asyncpg import Connection, Pool
|
from asyncpg import Connection, Pool
|
||||||
@ -91,7 +90,7 @@ class RequestProcessor:
|
|||||||
logger.info("Listening for requestes")
|
logger.info("Listening for requestes")
|
||||||
_ = await closed.wait()
|
_ = await closed.wait()
|
||||||
logger.info("stopping...")
|
logger.info("stopping...")
|
||||||
except CancelledError as e:
|
except CancelledError:
|
||||||
logger.info("Stopped listening for requsets")
|
logger.info("Stopped listening for requsets")
|
||||||
await self._database.remove_listener("scanner_requests", process)
|
await self._database.remove_listener("scanner_requests", process)
|
||||||
self._database.remove_termination_listener(terminated)
|
self._database.remove_termination_listener(terminated)
|
||||||
@ -130,7 +129,6 @@ class RequestProcessor:
|
|||||||
*
|
*
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
logger.warning("toto %s", cur)
|
|
||||||
if cur is None:
|
if cur is None:
|
||||||
return False
|
return False
|
||||||
request = Request.model_validate(cur)
|
request = Request.model_validate(cur)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user