返回提交历史
Modified
g4f/tools/media.py
+3
-1
XFEstudio/gpt4free
Support thumbnails in provider
59d01bca
代码差异
1 个文件
+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()