mirror of
https://github.com/RhenCloud/Cloud-Index.git
synced 2025-12-06 15:26:10 +08:00
feat: 更新文件预览功能,并优化不支持文件的提示信息
This commit is contained in:
@@ -3,4 +3,4 @@ from .factory import StorageFactory
|
||||
from .github import GitHubStorage
|
||||
from .r2 import R2Storage
|
||||
|
||||
__all__ = ["BaseStorage", "R2Storage", "CnbCoolStorage", "StorageFactory"]
|
||||
__all__ = ["BaseStorage", "R2Storage", "GitHubStorage", "StorageFactory"]
|
||||
|
||||
@@ -4,8 +4,6 @@ from typing import Optional
|
||||
import dotenv
|
||||
|
||||
from .base import BaseStorage
|
||||
|
||||
# from .cnbcool import CnbCoolStorage
|
||||
from .github import GitHubStorage
|
||||
from .r2 import R2Storage
|
||||
|
||||
@@ -39,12 +37,9 @@ class StorageFactory:
|
||||
cls._instance = R2Storage()
|
||||
elif storage_type == "github":
|
||||
cls._instance = GitHubStorage()
|
||||
# elif storage_type == "cnbcool":
|
||||
# cls._instance = CnbCoolStorage()
|
||||
else:
|
||||
raise RuntimeError(
|
||||
f"Unsupported storage type: {storage_type}. "
|
||||
f"Supported types: r2, github, cnbcool"
|
||||
f"Unsupported storage type: {storage_type}. Supported types: r2, github"
|
||||
)
|
||||
|
||||
return cls._instance
|
||||
|
||||
Reference in New Issue
Block a user