mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-06 07:09:09 +08:00
feat(community): serve community medals from the Wiki registry behind remote switches
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
committed by
InfinityPacer
parent
8249450014
commit
9181ad2b65
@@ -3,7 +3,7 @@
|
||||
from fastapi import Depends, HTTPException
|
||||
|
||||
from app.api.context import get_host_runtime
|
||||
from app.application.community.contributions import CommunityContributionService
|
||||
from app.application.community.medals import CommunityMedalService
|
||||
from app.application.github_auth import GithubAuthService
|
||||
from app.startup.composition.context import HostRuntime
|
||||
|
||||
@@ -17,10 +17,10 @@ def get_github_auth_service(
|
||||
return runtime.system.github_auth
|
||||
|
||||
|
||||
def get_community_contribution_service(
|
||||
def get_community_medal_service(
|
||||
runtime: HostRuntime = Depends(get_host_runtime),
|
||||
) -> CommunityContributionService:
|
||||
"""复用实例启动装配的贡献服务,不在请求中构造网络客户端或缓存。"""
|
||||
) -> CommunityMedalService:
|
||||
"""复用实例启动装配的社区勋章服务,不在请求中构造网络客户端或缓存。"""
|
||||
if runtime.system.github_community is None:
|
||||
raise HTTPException(status_code=503, detail="社区贡献服务尚未初始化")
|
||||
raise HTTPException(status_code=503, detail="社区勋章服务尚未初始化")
|
||||
return runtime.system.github_community
|
||||
|
||||
Reference in New Issue
Block a user