startup remote parsing
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
unmountRemote,
|
||||
} from './rclone/api'
|
||||
import { compareVersions, getRcloneVersion } from './rclone/common'
|
||||
import { SUPPORTED_BACKENDS } from './rclone/constants'
|
||||
import { dialogGetMountPlugin, needsMountPlugin } from './rclone/mount'
|
||||
import { usePersistedStore, useStore } from './store'
|
||||
import { showDefaultTray, showLoadingTray } from './tray'
|
||||
@@ -51,6 +52,11 @@ async function parseRemotes(remotes: string[]) {
|
||||
const remoteInfo = await getRemote(remote).catch(null)
|
||||
console.log('[parseRemotes] remoteInfo', remoteInfo)
|
||||
|
||||
if (!remoteInfo || !SUPPORTED_BACKENDS.includes(remoteInfo?.type)) {
|
||||
console.log('[parseRemotes] skipping remote not supported', remoteInfo)
|
||||
continue
|
||||
}
|
||||
|
||||
const submenuItems: (MenuItem | Submenu | PredefinedMenuItem)[] = []
|
||||
|
||||
if (!remoteConfig?.disabledActions?.includes('tray-mount')) {
|
||||
|
||||
+1
-16
@@ -4,24 +4,9 @@ import { platform } from '@tauri-apps/plugin-os'
|
||||
import type { FlagValue } from '../../types/rclone'
|
||||
import { useStore } from '../store'
|
||||
import { parseRcloneOptions } from './common'
|
||||
import { SUPPORTED_BACKENDS } from './constants'
|
||||
|
||||
/* UTILS */
|
||||
const SUPPORTED_BACKENDS = [
|
||||
'sftp',
|
||||
's3',
|
||||
'b2',
|
||||
'drive',
|
||||
'dropbox',
|
||||
'ftp',
|
||||
'azurefiles',
|
||||
'azureblob',
|
||||
'gcs',
|
||||
'protondrive',
|
||||
'box',
|
||||
'webdav',
|
||||
'onedrive',
|
||||
'http',
|
||||
]
|
||||
|
||||
function getAuthHeader() {
|
||||
return
|
||||
|
||||
@@ -16,3 +16,20 @@ export const RCLONE_VFS_DEFAULTS = {
|
||||
|
||||
export const RCLONE_CONF_REGEX = /[\/\\]rclone\.conf$/
|
||||
export const DOUBLE_BACKSLASH_REGEX = /\\\\/g
|
||||
|
||||
export const SUPPORTED_BACKENDS = [
|
||||
'sftp',
|
||||
's3',
|
||||
'b2',
|
||||
'drive',
|
||||
'dropbox',
|
||||
'ftp',
|
||||
'azurefiles',
|
||||
'azureblob',
|
||||
'gcs',
|
||||
'protondrive',
|
||||
'box',
|
||||
'webdav',
|
||||
'onedrive',
|
||||
'http',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user