mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-10-31 20:34:48 +08:00
fix(config): disable default wallpaper
This commit is contained in:
@@ -270,7 +270,7 @@ class ChainRuntimeConfig:
|
||||
television_rename_format: str = ""
|
||||
music_rename_format: str = ""
|
||||
tmdb_image_domain: str = "image.tmdb.org"
|
||||
wallpaper: str = "bing"
|
||||
wallpaper: str = ""
|
||||
wallpaper_image_url: Optional[str] = None
|
||||
customize_wallpaper_api_url: Optional[str] = None
|
||||
security_image_suffixes: tuple[str, ...] = ()
|
||||
|
||||
@@ -668,8 +668,8 @@ class ConfigModel(BaseModel):
|
||||
MEDIA_RECOGNIZE_SHARE_API: Optional[str] = None
|
||||
|
||||
# ==================== 个性化 ====================
|
||||
# 登录页面壁纸来源:tmdb/bing/mediaserver/customize/static
|
||||
WALLPAPER: str = "tmdb"
|
||||
# 登录页面壁纸来源:空字符串表示无壁纸,另支持 tmdb/bing/mediaserver/customize/static
|
||||
WALLPAPER: str = ""
|
||||
# 壁纸轮换间隔(秒),0 表示不轮换
|
||||
WALLPAPER_ROTATION_INTERVAL: int = 15
|
||||
# 静态壁纸地址,可使用前端可访问的本地路径或 URL
|
||||
|
||||
@@ -5,6 +5,7 @@ from typing import Any, Optional
|
||||
|
||||
import app.application.image as image_service
|
||||
from app.api.endpoints import system as system_endpoint
|
||||
from app.application.configuration import ChainRuntimeConfig
|
||||
from app.application.image import (
|
||||
ImageHelper,
|
||||
ImageResponsePort,
|
||||
@@ -133,7 +134,9 @@ def test_static_wallpaper_returns_local_or_remote_address_directly(monkeypatch):
|
||||
|
||||
|
||||
def test_wallpaper_settings_define_backward_compatible_defaults():
|
||||
"""未配置新字段时维持 15 秒轮换,静态地址保持为空。"""
|
||||
"""未配置壁纸时保持无壁纸,轮换间隔和静态地址沿用兼容默认值。"""
|
||||
assert ConfigModel.model_fields["WALLPAPER"].default == ""
|
||||
assert ChainRuntimeConfig(media_extensions=()).wallpaper == ""
|
||||
assert ConfigModel.model_fields["WALLPAPER_ROTATION_INTERVAL"].default == 15
|
||||
assert ConfigModel.model_fields["WALLPAPER_IMAGE_URL"].default is None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user