XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Support thumbnails in provider

59d01bca
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +3 -1
Modified g4f/tools/media.py +3 -1
@@ -11,7 +11,9 @@ from .files import get_bucket_dir, read_bucket
11 11
12 12 def render_media(bucket_id: str, name: str, url: str, as_path: bool = False, as_base64: bool = False) -> Union[str, Path]:
13 13 if (as_base64 or as_path or url.startswith("/")):
14 file = Path(get_bucket_dir(bucket_id, "media", name))
14 file = Path(get_bucket_dir(bucket_id, "thumbnail", name))
15 if not file.exists():
16 file = Path(get_bucket_dir(bucket_id, "media", name))
15 17 if as_path:
16 18 return file
17 19 data = file.read_bytes()