diff --git a/README.md b/README.md index e17ab5a..83b55a2 100644 --- a/README.md +++ b/README.md @@ -37,4 +37,4 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - Emby元数据刷新 1.1 - Emby媒体标签 1.1 - 热门媒体订阅 1.7 -- [HomePage 1.0](docs%2FHomePage.md) +- [HomePage 1.2](docs%2FHomePage.md) diff --git a/package.json b/package.json index 0fba02e..fb95db1 100644 --- a/package.json +++ b/package.json @@ -433,11 +433,12 @@ "name": "HomePage", "description": "HomePage自定义API。", "labels": "工具", - "version": "1.1", + "version": "1.2", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/homepage.png", "author": "thsrite", "level": 1, "history": { + "v1.2": "适配v1.9.1-beta(不生效就重启)", "v1.1": "支持更多返回值、插件展示数据", "v1.0": "HomePage自定义API" } diff --git a/plugins/homepage/__init__.py b/plugins/homepage/__init__.py index 41b6c29..8343abe 100644 --- a/plugins/homepage/__init__.py +++ b/plugins/homepage/__init__.py @@ -1,6 +1,9 @@ +from pathlib import Path + from app.chain.dashboard import DashboardChain from app.core.config import settings from app.db.subscribe_oper import SubscribeOper +from app.helper.directory import DirectoryHelper from app.plugins import _PluginBase from typing import Any, List, Dict, Tuple, Optional from app.schemas import NotificationType @@ -17,7 +20,7 @@ class HomePage(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/homepage.png" # 插件版本 - plugin_version = "1.1" + plugin_version = "1.2" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -61,7 +64,8 @@ class HomePage(_PluginBase): user_count += media_statistic.user_count # 磁盘统计 - total_storage, free_storage = SystemUtils.space_usage(settings.LIBRARY_PATHS) + library_dirs = DirectoryHelper().get_library_dirs() + total_storage, free_storage = SystemUtils.space_usage([Path(d.path) for d in library_dirs if d.path]) # 订阅统计 movie_subscribes = 0