Skip to content

Commit 4ae97df

Browse files
author
noone
committed
Merge remote-tracking branch 'origin/v2' into v2
2 parents d87006b + 24f2993 commit 4ae97df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1155
-1585
lines changed

app/actions/invoke_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def execute(self, workflow_id: int, params: dict, context: ActionContext) -> Act
5656
logger.error(f"插件不存在: {params.plugin_id}")
5757
return context
5858
actions = plugin_actions[0].get("actions", [])
59-
action = next((action for action in actions if action.action_id == params.action_id), None)
59+
action = next((action for action in actions if action.get("action_id") == params.action_id), None)
6060
if not action or not action.get("func"):
6161
logger.error(f"插件动作不存在: {params.plugin_id} - {params.action_id}")
6262
return context

app/actions/scan_file.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,8 @@ def execute(self, workflow_id: int, params: dict, context: ActionContext) -> Act
6767
break
6868
if not file.extension or f".{file.extension.lower()}" not in settings.RMT_MEDIAEXT:
6969
continue
70-
# 检查缓存
71-
cache_key = f"{file.path}"
72-
if self.check_cache(workflow_id, cache_key):
73-
logger.info(f"{file.path} 已处理过,跳过")
74-
continue
75-
self._fileitems.append(fileitem)
76-
# 保存缓存
77-
self.save_cache(workflow_id, cache_key)
70+
# 添加文件到队列,而不是目录
71+
self._fileitems.append(file)
7872

7973
if self._fileitems:
8074
context.fileitems.extend(self._fileitems)

app/api/apiv1.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from app.api.endpoints import login, user, webhook, message, site, subscribe, \
44
media, douban, search, plugin, tmdb, history, system, download, dashboard, \
5-
transfer, mediaserver, bangumi, storage, discover, recommend, workflow, torrent, monitoring
5+
transfer, mediaserver, bangumi, storage, discover, recommend, workflow, torrent
66

77
api_router = APIRouter()
88
api_router.include_router(login.router, prefix="/login", tags=["login"])
@@ -28,4 +28,3 @@
2828
api_router.include_router(recommend.router, prefix="/recommend", tags=["recommend"])
2929
api_router.include_router(workflow.router, prefix="/workflow", tags=["workflow"])
3030
api_router.include_router(torrent.router, prefix="/torrent", tags=["torrent"])
31-
api_router.include_router(monitoring.router, prefix="/monitoring", tags=["monitoring"])

app/api/endpoints/dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async def schedule2(_: Annotated[str, Depends(verify_apitoken)]) -> Any:
123123
"""
124124
查询下载器信息 API_TOKEN认证(?token=xxx)
125125
"""
126-
return schedule()
126+
return await schedule()
127127

128128

129129
@router.get("/transfer", summary="文件整理统计", response_model=List[int])

app/api/endpoints/login.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
from app.chain.user import UserChain
99
from app.core import security
1010
from app.core.config import settings
11+
from app.db.systemconfig_oper import SystemConfigOper
1112
from app.helper.sites import SitesHelper # noqa
1213
from app.helper.wallpaper import WallpaperHelper
14+
from app.schemas.types import SystemConfigKey
1315

1416
router = APIRouter()
1517

@@ -29,7 +31,10 @@ def login_access_token(
2931
if not success:
3032
raise HTTPException(status_code=401, detail=user_or_message)
3133

34+
# 用户等级
3235
level = SitesHelper().auth_level
36+
# 是否显示配置向导
37+
show_wizard = not SystemConfigOper().get(SystemConfigKey.SetupWizardState) and not settings.ADVANCED_MODE
3338
return schemas.Token(
3439
access_token=security.create_access_token(
3540
userid=user_or_message.id,
@@ -45,6 +50,7 @@ def login_access_token(
4550
avatar=user_or_message.avatar,
4651
level=level,
4752
permissions=user_or_message.permissions or {},
53+
widzard=show_wizard
4854
)
4955

5056

0 commit comments

Comments
 (0)