Refactor backend and frontend cleanup paths
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""Factory for user-scoped cloud storage backends."""
|
||||
|
||||
|
||||
def build_cloud_backend(provider: str, credentials: dict):
|
||||
if provider == "google_drive":
|
||||
from storage.google_drive_backend import GoogleDriveBackend # lazy import
|
||||
|
||||
return GoogleDriveBackend(credentials)
|
||||
|
||||
if provider == "onedrive":
|
||||
from storage.onedrive_backend import OneDriveBackend # lazy import
|
||||
|
||||
return OneDriveBackend(credentials)
|
||||
|
||||
if provider == "nextcloud":
|
||||
from storage.nextcloud_backend import NextcloudBackend # lazy import
|
||||
|
||||
return NextcloudBackend(
|
||||
credentials["server_url"],
|
||||
credentials["username"],
|
||||
credentials["password"],
|
||||
)
|
||||
|
||||
if provider == "webdav":
|
||||
from storage.webdav_backend import WebDAVBackend # lazy import
|
||||
|
||||
return WebDAVBackend(
|
||||
credentials["server_url"],
|
||||
credentials["username"],
|
||||
credentials["password"],
|
||||
)
|
||||
|
||||
raise ValueError(f"Unknown provider: {provider}")
|
||||
Reference in New Issue
Block a user