Support auto import patch

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
omg-xtao 2023-11-07 15:37:40 +08:00 committed by xtaodada
parent 5865504b7e
commit 0addbe33d8
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
4 changed files with 8 additions and 5 deletions

@ -1 +1 @@
Subproject commit 94a4aca6ff3b02f897f96f7a7629a3c72eda4513 Subproject commit 30cc0cf8f700f50ad3063b2f3bca4f325f121bd3

View File

@ -3,7 +3,6 @@ import os
import re import re
from typing import List from typing import List
from core.config import config
from ..base.hyperionrequest import HyperionRequest from ..base.hyperionrequest import HyperionRequest
from ...models.genshin.hyperion import PostInfo, ArtworkImage from ...models.genshin.hyperion import PostInfo, ArtworkImage
from ...typedefs import JSON_DATA from ...typedefs import JSON_DATA
@ -124,7 +123,6 @@ class Hyperion:
filename = os.path.basename(url) filename = os.path.basename(url)
_, file_extension = os.path.splitext(filename) _, file_extension = os.path.splitext(filename)
is_image = bool(file_extension in ".jpg" or file_extension in ".png") is_image = bool(file_extension in ".jpg" or file_extension in ".png")
url = url.replace("https://upload-bbs.miyoushe.com", config.upload_bbs_host)
response = await self.client.get( response = await self.client.get(
url, params=self.get_images_params(resize=2000) if is_image else None, de_json=False url, params=self.get_images_params(resize=2000) if is_image else None, de_json=False
) )

View File

@ -0,0 +1,3 @@
import utils.patch
__all__ = (utils.patch,)

View File

@ -1,3 +1,5 @@
from utils.patch import simnet import pkgutil
from pathlib import Path
__all__ = ["simnet"] for _, file, _ in pkgutil.iter_modules([str(Path(__file__).parent.absolute())]):
__import__(file, globals(), level=1)