This commit is contained in:
jxxghp 2023-08-08 06:59:17 +08:00
parent 38dd65bece
commit 3c3b8ff0e4
6 changed files with 8 additions and 10 deletions

View File

@ -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

View File

@ -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站点信息

View File

@ -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)

View File

@ -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",

View File

@ -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" \

View File

@ -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}")