mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix pydantic
This commit is contained in:
@@ -44,7 +44,7 @@ class AddDownloadAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return AddDownloadParams().dict()
|
||||
return AddDownloadParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -37,7 +37,7 @@ class AddSubscribeAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return AddSubscribeParams().dict()
|
||||
return AddSubscribeParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
@@ -57,7 +57,7 @@ class AddSubscribeAction(BaseAction):
|
||||
logger.info(f"{media.title} {media.year} 已添加过订阅,跳过")
|
||||
continue
|
||||
mediainfo = MediaInfo()
|
||||
mediainfo.from_dict(media.dict())
|
||||
mediainfo.from_dict(media.model_dump())
|
||||
subscribechain = SubscribeChain()
|
||||
if subscribechain.exists(mediainfo):
|
||||
logger.info(f"{media.title} 已存在订阅")
|
||||
|
||||
@@ -33,7 +33,7 @@ class FetchDownloadsAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return FetchDownloadsParams().dict()
|
||||
return FetchDownloadsParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -107,7 +107,7 @@ class FetchMediasAction(BaseAction):
|
||||
if event and event.event_data:
|
||||
event_data: RecommendSourceEventData = event.event_data
|
||||
if event_data.extra_sources:
|
||||
self.__inner_sources.extend([s.dict() for s in event_data.extra_sources])
|
||||
self.__inner_sources.extend([s.model_dump() for s in event_data.extra_sources])
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@@ -122,7 +122,7 @@ class FetchMediasAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return FetchMediasParams().dict()
|
||||
return FetchMediasParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -47,7 +47,7 @@ class FetchRssAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return FetchRssParams().dict()
|
||||
return FetchRssParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -46,7 +46,7 @@ class FetchTorrentsAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return FetchTorrentsParams().dict()
|
||||
return FetchTorrentsParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -39,7 +39,7 @@ class FilterMediasAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return FilterMediasParams().dict()
|
||||
return FilterMediasParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -44,7 +44,7 @@ class FilterTorrentsAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return FilterTorrentsParams().dict()
|
||||
return FilterTorrentsParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -37,7 +37,7 @@ class InvokePluginAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return InvokePluginParams().dict()
|
||||
return InvokePluginParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -42,7 +42,7 @@ class ScanFileAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return ScanFileParams().dict()
|
||||
return ScanFileParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -39,7 +39,7 @@ class ScrapeFileAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return ScrapeFileParams().dict()
|
||||
return ScrapeFileParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -29,7 +29,7 @@ class SendEventAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return SendEventParams().dict()
|
||||
return SendEventParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -36,7 +36,7 @@ class SendMessageAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return SendMessageParams().dict()
|
||||
return SendMessageParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
@@ -44,7 +44,7 @@ class TransferFileAction(BaseAction):
|
||||
@classmethod
|
||||
@property
|
||||
def data(cls) -> dict: # noqa
|
||||
return TransferFileParams().dict()
|
||||
return TransferFileParams().model_dump()
|
||||
|
||||
@property
|
||||
def success(self) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user