remote capability check
This commit is contained in:
+4
-139
@@ -28,142 +28,7 @@ export const RCLONE_RELEASES_SHOWN = 20
|
||||
|
||||
export const SERVE_TYPES = ['dlna', 'ftp', 'sftp', 'http', 'nfs', 'restic', 's3', 'webdav'] as const
|
||||
|
||||
export const SUPPORTS_CLEANUP = [
|
||||
's3',
|
||||
'b2',
|
||||
'box',
|
||||
'filefabric',
|
||||
'filen',
|
||||
'drive',
|
||||
'internetarchive',
|
||||
'jottacloud',
|
||||
'mailru',
|
||||
'mega',
|
||||
'onedrive',
|
||||
'oos',
|
||||
'pcloud',
|
||||
'pikpak',
|
||||
'putio',
|
||||
'protondrive',
|
||||
'qingstor',
|
||||
'seafile',
|
||||
'yandex',
|
||||
] as const
|
||||
|
||||
export const SUPPORTS_PURGE = [
|
||||
'netstorage',
|
||||
'box',
|
||||
'sharefile',
|
||||
'dropbox',
|
||||
'filefabric',
|
||||
'filescom',
|
||||
'filen',
|
||||
'gofile',
|
||||
'gcs',
|
||||
'drive',
|
||||
'hdfs',
|
||||
'hifile',
|
||||
'iclouddrive',
|
||||
'imagekit',
|
||||
'jottacloud',
|
||||
'koofr',
|
||||
'mailru',
|
||||
'mega',
|
||||
'azureblob',
|
||||
'onedrive',
|
||||
'opendrive',
|
||||
'swift',
|
||||
'pikpak',
|
||||
'pcloud',
|
||||
'pixeldrain',
|
||||
'premiumizeme',
|
||||
'putio',
|
||||
'protondrive',
|
||||
'quatrix',
|
||||
'seafile',
|
||||
'sugarsync',
|
||||
'storj',
|
||||
'webdav',
|
||||
'yandex',
|
||||
'zoho',
|
||||
] as const
|
||||
|
||||
export const SUPPORTS_ABOUT = [
|
||||
'box',
|
||||
'dropbox',
|
||||
'gofile',
|
||||
'drive',
|
||||
'filen',
|
||||
'hdfs',
|
||||
'internetarchive',
|
||||
'jottacloud',
|
||||
'koofr',
|
||||
'mailru',
|
||||
'mega',
|
||||
'azurefiles',
|
||||
'onedrive',
|
||||
'opendrive',
|
||||
'swift',
|
||||
'pcloud',
|
||||
'pikpak',
|
||||
'pixeldrain',
|
||||
'premiumizeme',
|
||||
'putio',
|
||||
'protondrive',
|
||||
'quatrix',
|
||||
'seafile',
|
||||
'sftp',
|
||||
'webdav',
|
||||
'yandex',
|
||||
'zoho',
|
||||
'local',
|
||||
] as const
|
||||
|
||||
export const SUPPORTS_LINK = [
|
||||
'b2',
|
||||
'box',
|
||||
'drive',
|
||||
'dropbox',
|
||||
'fichier',
|
||||
'filescom',
|
||||
'gofile',
|
||||
'imagekit',
|
||||
'internetarchive',
|
||||
'jottacloud',
|
||||
'koofr',
|
||||
'mailru',
|
||||
'mega',
|
||||
'onedrive',
|
||||
'pikpak',
|
||||
'pixeldrain',
|
||||
'premiumizeme',
|
||||
'pcloud',
|
||||
's3',
|
||||
'seafile',
|
||||
'storj',
|
||||
'sugarsync',
|
||||
'yandex',
|
||||
] as const
|
||||
|
||||
export function supportsPublicLink(backendType?: string | null): boolean {
|
||||
if (!backendType) return false
|
||||
return SUPPORTS_LINK.includes(backendType.toLowerCase() as any)
|
||||
}
|
||||
|
||||
export const CANNOT_PERSIST_EMPTY_FOLDERS = [
|
||||
's3',
|
||||
'gcs',
|
||||
'azureblob',
|
||||
'b2',
|
||||
'swift',
|
||||
'oracleobjectstorage',
|
||||
'oos',
|
||||
'qingstor',
|
||||
'storj',
|
||||
'memory',
|
||||
]
|
||||
|
||||
export function supportsPersistentEmptyFolders(backendType?: string | null) {
|
||||
if (!backendType) return true
|
||||
return !CANNOT_PERSIST_EMPTY_FOLDERS.includes(backendType.toLowerCase())
|
||||
}
|
||||
// Backend capabilities are no longer hardcoded here. They are read per-remote from the rclone RC
|
||||
// `operations/fsinfo` endpoint (see `fsInfoQueryOptions` / `hasFeature` in lib/hooks.ts), which is
|
||||
// authoritative and correct for wrapping backends (crypt/alias/union) that static type lists could
|
||||
// not express.
|
||||
|
||||
Reference in New Issue
Block a user