fix TmdbWallpaper

This commit is contained in:
jxxghp
2025-06-06 07:14:44 +08:00
parent 637cf9e83a
commit 5cf7be9e9a
2 changed files with 8 additions and 14 deletions

View File

@@ -826,12 +826,13 @@
"name": "登录壁纸本地化",
"description": "将MoviePilot的登录壁纸下载到本地。",
"labels": "工具",
"version": "1.2",
"version": "1.3",
"icon": "Macos_Sierra.png",
"author": "jxxghp",
"level": 1,
"v2": true,
"history": {
"v1.3": "适配MoviePilot v2.5.3+版本",
"v1.2": "一次性下载多张壁纸",
"v1.1": "修复下载Bing每日壁纸时文件名错乱的问题"
}

View File

@@ -5,12 +5,11 @@ from typing import Any, List, Dict, Tuple
import pytz
from apscheduler.schedulers.background import BackgroundScheduler
from app.chain.tmdb import TmdbChain
from app.core.config import settings
from app.helper.wallpaper import WallpaperHelper
from app.log import logger
from app.plugins import _PluginBase
from app.utils.http import RequestUtils
from app.utils.web import WebUtils
class TmdbWallpaper(_PluginBase):
@@ -21,7 +20,7 @@ class TmdbWallpaper(_PluginBase):
# 插件图标
plugin_icon = "Macos_Sierra.png"
# 插件版本
plugin_version = "1.2"
plugin_version = "1.3"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
@@ -237,13 +236,7 @@ class TmdbWallpaper(_PluginBase):
if not self._savepath:
return
if settings.WALLPAPER == "tmdb":
urls = TmdbChain().get_trending_wallpapers() or []
for url in urls:
filename = url.split("/")[-1]
__save_file(url, filename)
else:
url = WebUtils.get_bing_wallpaper()
if url:
filename = f"{datetime.now().strftime('%Y%m%d')}.jpg"
__save_file(url, filename)
urls = WallpaperHelper().get_wallpapers(10) or []
for url in urls:
filename = url.split("/")[-1]
__save_file(url, filename)