Add network folder detection backfill and folder path editing
- Fix offline settings database migrations to run individually - Add network detection refresh when loading folder list - Add network detection during folder scan - Show folder alias with path tooltip in folder list - Add folder path change capability in FolderSettingsModal - Add network content visibility toggle in offline settings - Add i18n strings for new features (en/es)
This commit is contained in:
1 parent
c0ea039476
commit
6cabded79a
10 files changed
+343
-26
No files matched your search
@@ -37,6 +37,7 @@
|
||||
setAllowCastWhileOffline,
|
||||
setAllowImmediateScrobbling,
|
||||
setAllowAccumulatedScrobbling,
|
||||
setShowNetworkFoldersInManualOffline,
|
||||
checkNetwork,
|
||||
type OfflineStatus,
|
||||
type OfflineSettings
|
||||
@@ -722,6 +723,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function handleShowNetworkFoldersChange(enabled: boolean) {
|
||||
try {
|
||||
await setShowNetworkFoldersInManualOffline(enabled);
|
||||
} catch (error) {
|
||||
console.error('Failed to set show network folders in manual offline:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleLanguageChange(lang: string) {
|
||||
language = lang;
|
||||
const localeCode = languageToLocale[lang];
|
||||
@@ -890,13 +899,13 @@
|
||||
async function handleChangeDownloadFolder() {
|
||||
try {
|
||||
const { open } = await import('@tauri-apps/plugin-dialog');
|
||||
|
||||
|
||||
const result = await open({
|
||||
title: 'Select Downloads Folder',
|
||||
directory: true,
|
||||
defaultPath: downloadRoot || undefined
|
||||
});
|
||||
|
||||
|
||||
if (result) {
|
||||
// Validate the path
|
||||
const valid = await invoke<boolean>('validate_download_path', { path: result });
|
||||
@@ -905,6 +914,23 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if this is a network folder and warn user
|
||||
interface NetworkPathInfo {
|
||||
isNetwork: boolean;
|
||||
mountInfo: { fsType: string; kind: string } | null;
|
||||
path: string;
|
||||
}
|
||||
const networkInfo = await invoke<NetworkPathInfo>('check_network_path', { path: result });
|
||||
if (networkInfo.isNetwork) {
|
||||
const proceed = confirm(
|
||||
$t('settings.networkDownloadWarning') + '\n\n' +
|
||||
$t('settings.networkDownloadWarningDetail')
|
||||
);
|
||||
if (!proceed) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Ask if user wants to move existing downloads
|
||||
const hasDownloads = downloadStats && downloadStats.readyTracks > 0;
|
||||
let moveFiles = false;
|
||||
@@ -1187,7 +1213,7 @@
|
||||
</div>
|
||||
<Toggle enabled={offlineSettings.allowImmediateScrobbling} onchange={handleAllowImmediateScrobblingChange} />
|
||||
</div>
|
||||
<div class="setting-row last">
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<span class="setting-label">{$t('offline.allowAccumulatedScrobbling')}</span>
|
||||
<span class="setting-desc">{$t('offline.allowAccumulatedScrobblingDesc')}</span>
|
||||
@@ -1195,6 +1221,13 @@
|
||||
</div>
|
||||
<Toggle enabled={offlineSettings.allowAccumulatedScrobbling} onchange={handleAllowAccumulatedScrobblingChange} />
|
||||
</div>
|
||||
<div class="setting-row last">
|
||||
<div class="setting-info">
|
||||
<span class="setting-label">{$t('offline.showNetworkFolders')}</span>
|
||||
<span class="setting-desc">{$t('offline.showNetworkFoldersDesc')}</span>
|
||||
</div>
|
||||
<Toggle enabled={offlineSettings.showNetworkFoldersInManualOffline} onchange={handleShowNetworkFoldersChange} />
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
|
||||
Reference in new issue
Block a user