mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 07:56:52 +08:00
refactor: complete runtime configuration migration
This commit is contained in:
@@ -20,7 +20,7 @@ from app.api.response import ResponseAPIRouter
|
||||
from app.chain.media import MediaChain
|
||||
from app.chain.scraping import ScrapingChain
|
||||
from app.chain.tmdb import TmdbChain
|
||||
from app.runtime.config import settings
|
||||
from app.application.configuration import get_api_runtime_config_snapshot
|
||||
from app.domain.context import Context, MusicInfo
|
||||
from app.domain.meta.metabase import MetaBase
|
||||
from app.domain.meta.metamusic import MetaMusic
|
||||
@@ -150,7 +150,8 @@ def _build_recognize_metainfo(
|
||||
if (
|
||||
("/" in title or "\\" in title)
|
||||
and "://" not in title
|
||||
and title_path.suffix.lower() in settings.RMT_MEDIAEXT
|
||||
and title_path.suffix.lower()
|
||||
in get_api_runtime_config_snapshot().media_extensions
|
||||
):
|
||||
metainfo = MetaInfoPath(
|
||||
title_path,
|
||||
@@ -369,7 +370,8 @@ async def search(
|
||||
return []
|
||||
|
||||
# 排序和分页
|
||||
setting_order = settings.SEARCH_SOURCE.split(",") if settings.SEARCH_SOURCE else []
|
||||
search_source = get_api_runtime_config_snapshot().search_source
|
||||
setting_order = search_source.split(",") if search_source else []
|
||||
sort_order = {source: index for index, source in enumerate(setting_order)}
|
||||
|
||||
sorted_result = sorted(result, key=lambda x: sort_order.get(__get_source(x), 4))
|
||||
|
||||
Reference in New Issue
Block a user