🎨 Update the outdated project name

This commit is contained in:
洛水居室 2023-03-31 14:01:03 +08:00
parent efa7775ddb
commit 6e9c42c4dd
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
4 changed files with 6 additions and 6 deletions

View File

@ -18,6 +18,7 @@ from httpx import AsyncClient, HTTPError, HTTPStatusError, TransportError, URL
from typing_extensions import Self from typing_extensions import Self
from core.base_service import BaseService from core.base_service import BaseService
from core.config import config
from metadata.genshin import AVATAR_DATA, HONEY_DATA, MATERIAL_DATA, NAMECARD_DATA, WEAPON_DATA from metadata.genshin import AVATAR_DATA, HONEY_DATA, MATERIAL_DATA, NAMECARD_DATA, WEAPON_DATA
from metadata.scripts.honey import update_honey_metadata from metadata.scripts.honey import update_honey_metadata
from metadata.scripts.metadatas import update_metadata_from_ambr, update_metadata_from_github from metadata.scripts.metadatas import update_metadata_from_ambr, update_metadata_from_github
@ -130,7 +131,9 @@ class _AssetsService(ABC):
async def _download(self, url: StrOrURL, path: Path, retry: int = 5) -> Path | None: async def _download(self, url: StrOrURL, path: Path, retry: int = 5) -> Path | None:
"""从 url 下载图标至 path""" """从 url 下载图标至 path"""
logger.debug("正在从 %s 下载图标至 %s", url, path) logger.debug("正在从 %s 下载图标至 %s", url, path)
headers = {"user-agent": "TGPaimonBot/3.0"} if URL(url).host == "enka.network" else None headers = None
if config.enka_network_api_agent is not None and URL(url).host == "enka.network":
headers = {"user-agent": config.enka_network_api_agent}
for time in range(retry): for time in range(retry):
try: try:
response = await self.client.get(url, follow_redirects=False, headers=headers) response = await self.client.get(url, follow_redirects=False, headers=headers)

View File

@ -22,7 +22,6 @@ class RedisDB(BaseService.Dependence):
): ):
self.client = aioredis.Redis(host=host, port=port, db=database, password=password) self.client = aioredis.Redis(host=host, port=port, db=database, password=password)
self.ttl = 600 self.ttl = 600
self.key_prefix = "paimon_bot"
async def ping(self): async def ping(self):
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences

View File

@ -128,9 +128,7 @@ class GachaLog:
if not state: if not state:
raise GachaLogNotFound raise GachaLogNotFound
save_path = self.gacha_log_path / f"{user_id}-{uid}-uigf.json" save_path = self.gacha_log_path / f"{user_id}-{uid}-uigf.json"
info = UIGFModel( info = UIGFModel(info=UIGFInfo(uid=uid, export_app=ImportType.PaiGram.value, export_app_version="v3"), list=[])
info=UIGFInfo(uid=uid, export_app=ImportType.TGPaimonBot.value, export_app_version="v3"), list=[]
)
for items in data.item_list.values(): for items in data.item_list.values():
for item in items: for item in items:
info.list.append( info.list.append(

View File

@ -9,7 +9,7 @@ from modules.gacha_log.const import UIGF_VERSION
class ImportType(Enum): class ImportType(Enum):
TGPaimonBot = "TGPaimonBot" PaiGram = "PaiGram"
PAIMONMOE = "PAIMONMOE" PAIMONMOE = "PAIMONMOE"
FXQ = "FXQ" FXQ = "FXQ"
UIGF = "UIGF" UIGF = "UIGF"