diff --git a/app/api/endpoints/search.py b/app/api/endpoints/search.py index 9c072a23..da7081e7 100644 --- a/app/api/endpoints/search.py +++ b/app/api/endpoints/search.py @@ -5,7 +5,6 @@ from fastapi import APIRouter, Depends, HTTPException from app import schemas from app.chain.douban import DoubanChain from app.chain.search import SearchChain -from app.core.context import Context from app.core.security import verify_token from app.schemas.types import MediaType diff --git a/app/api/endpoints/site.py b/app/api/endpoints/site.py index e7fc2b48..cc5b5eea 100644 --- a/app/api/endpoints/site.py +++ b/app/api/endpoints/site.py @@ -75,8 +75,7 @@ def cookie_cloud_sync(background_tasks: BackgroundTasks, @router.get("/reset", summary="重置站点", response_model=schemas.Response) -def cookie_cloud_sync(background_tasks: BackgroundTasks, - db: Session = Depends(get_db), +def cookie_cloud_sync(db: Session = Depends(get_db), _: schemas.TokenPayload = Depends(verify_token)) -> Any: """ 清空所有站点数据并重新同步CookieCloud站点信息 diff --git a/app/api/endpoints/user.py b/app/api/endpoints/user.py index 8957c4e0..0abff149 100644 --- a/app/api/endpoints/user.py +++ b/app/api/endpoints/user.py @@ -43,7 +43,7 @@ def create_user( user_info["hashed_password"] = get_password_hash(user_info["password"]) user_info.pop("password") user = User(**user_info) - user = user.create(db) + user.create(db) return schemas.Response(success=True) diff --git a/app/modules/plex/plex.py b/app/modules/plex/plex.py index 5c3e5c26..380247a9 100644 --- a/app/modules/plex/plex.py +++ b/app/modules/plex/plex.py @@ -1,6 +1,6 @@ import json from pathlib import Path -from typing import List, Optional, Dict, Tuple, Generator +from typing import List, Optional, Dict, Tuple, Generator, Any from urllib.parse import quote_plus from plexapi import media @@ -220,7 +220,7 @@ class Plex(metaclass=Singleton): self._plex.query(f'/library/sections/{lib_key}/refresh?path={quote_plus(path)}') @staticmethod - def __find_librarie(path: Path, libraries: List[dict]) -> Tuple[str, str]: + def __find_librarie(path: Path, libraries: List[Any]) -> Tuple[str, str]: """ 判断这个path属于哪个媒体库 多个媒体库配置的目录不应有重复和嵌套, @@ -262,7 +262,7 @@ class Plex(metaclass=Singleton): return {} @staticmethod - def __get_ids(guids: List[dict]) -> dict: + def __get_ids(guids: List[Any]) -> dict: guid_mapping = { "imdb://": "imdb_id", "tmdb://": "tmdb_id", diff --git a/app/plugins/bestfilmversion/__init__.py b/app/plugins/bestfilmversion/__init__.py index 69e63b91..94828deb 100644 --- a/app/plugins/bestfilmversion/__init__.py +++ b/app/plugins/bestfilmversion/__init__.py @@ -415,7 +415,7 @@ class BestFilmVersion(_PluginBase): resp = self.get_items(Emby().get_data(url)) all_item.extend(resp) else: - resp = self.plex_get_watchlist(self) + resp = self.plex_get_watchlist() all_item.extend(resp) for data in all_item: @@ -502,7 +502,7 @@ class BestFilmVersion(_PluginBase): return [] @staticmethod - def plex_get_watchlist(self): + def plex_get_watchlist(): # 根据加入日期 降序排序 url = f"https://metadata.provider.plex.tv/library/sections/watchlist/all?type=1&sort=addedAt%3Adesc" \ f"&X-Plex-Container-Start=0&X-Plex-Container-Size=50" \ diff --git a/app/plugins/torrenttransfer/__init__.py b/app/plugins/torrenttransfer/__init__.py index ec8cc56e..0b525243 100644 --- a/app/plugins/torrenttransfer/__init__.py +++ b/app/plugins/torrenttransfer/__init__.py @@ -306,7 +306,7 @@ class TorrentTransfer(_PluginBase): continue # TODO 读取trackers try: - torrent_main = None + torrent_main = {} main_announce = None except Exception as err: logger.error(f"解析种子文件 {torrent_file} 失败:{err}")