From 671bdad77cbb748790b0507ba8a6a6f2d5990ffc Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 23 May 2024 19:43:08 +0800 Subject: [PATCH] v1.9.1-beta MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化了订阅匹配逻辑 - 目录设置全新改版,多目录支持更加灵活,存量目录配置会自动升级为新格式 - 手动整理时支持下拉选择已配置目录 - 元数据刮削取消了全局开关,按媒体库目录设置,目录监控等插件新增了刮削开关并需要手动打开 - 站点管理支持拖动排序 - 修复了仪表板不可见组件仍会刷新的问题 注意:涉及前端变化升级后需要清理浏览器缓存(仅清理缓存文件,无需清理cookie) --- app/api/endpoints/site.py | 51 +++++++++++++++++++++++++-------------- version.py | 2 +- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/app/api/endpoints/site.py b/app/api/endpoints/site.py index b1a94ffa..0b4e6b21 100644 --- a/app/api/endpoints/site.py +++ b/app/api/endpoints/site.py @@ -94,24 +94,6 @@ def update_site( return schemas.Response(success=True) -@router.delete("/{site_id}", summary="删除站点", response_model=schemas.Response) -def delete_site( - site_id: int, - db: Session = Depends(get_db), - _: User = Depends(get_current_active_superuser) -) -> Any: - """ - 删除站点 - """ - Site.delete(db, site_id) - # 插件站点删除 - EventManager().send_event(EventType.SiteDeleted, - { - "site_id": site_id - }) - return schemas.Response(success=True) - - @router.get("/cookiecloud", summary="CookieCloud同步", response_model=schemas.Response) def cookie_cloud_sync(background_tasks: BackgroundTasks, _: schemas.TokenPayload = Depends(verify_token)) -> Any: @@ -141,6 +123,21 @@ def reset(db: Session = Depends(get_db), return schemas.Response(success=True, message="站点已重置!") +@router.post("/priorities", summary="批量更新站点优先级", response_model=schemas.Response) +def update_sites_priority( + priorities: List[dict], + db: Session = Depends(get_db), + _: schemas.TokenPayload = Depends(verify_token)) -> Any: + """ + 批量更新站点优先级 + """ + for priority in priorities: + site = Site.get(db, priority.get("id")) + if site: + site.update(db, {"pri": priority.get("pri")}) + return schemas.Response(success=True) + + @router.get("/cookie/{site_id}", summary="更新站点Cookie&UA", response_model=schemas.Response) def update_cookie( site_id: int, @@ -293,3 +290,21 @@ def read_site( detail=f"站点 {site_id} 不存在", ) return site + + +@router.delete("/{site_id}", summary="删除站点", response_model=schemas.Response) +def delete_site( + site_id: int, + db: Session = Depends(get_db), + _: User = Depends(get_current_active_superuser) +) -> Any: + """ + 删除站点 + """ + Site.delete(db, site_id) + # 插件站点删除 + EventManager().send_event(EventType.SiteDeleted, + { + "site_id": site_id + }) + return schemas.Response(success=True) diff --git a/version.py b/version.py index bf7520b7..03541879 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -APP_VERSION = 'v1.9.0' +APP_VERSION = 'v1.9.1-beta'