fix pydantic

This commit is contained in:
jxxghp
2025-11-01 09:51:23 +08:00
parent 09a19e94d5
commit d523c7c916
47 changed files with 160 additions and 135 deletions
+1 -1
View File
@@ -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:
+2 -2
View File
@@ -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} 已存在订阅")
+1 -1
View File
@@ -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:
+2 -2
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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: