mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-21 22:15:40 +00:00
Merge pull request #850 from Psychotoxical/fix/library-index-exclude-busy-ui
fix(settings): library index exclude/include busy feedback
This commit is contained in:
@@ -156,6 +156,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Settings — local library index exclude/include feedback
|
||||||
|
|
||||||
|
**By [@cucadmuh](https://github.com/cucadmuh), PR [#850](https://github.com/Psychotoxical/psysonic/pull/850)**
|
||||||
|
|
||||||
|
* **Settings → Library:** **Exclude from sync** and **Include again** show immediate busy labels and block repeat clicks while bind/unbind runs; exclude cancels an in-flight sync first.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [1.46.0] - 2026-05-18
|
## [1.46.0] - 2026-05-18
|
||||||
|
|
||||||
> **🙏 Special thanks to [@zz5zz](https://github.com/zz5zz)** for his tireless quirk-spotting and bug reports on the [Psysonic Discord](https://discord.gg/AMnDRErm4u) — several of the polish fixes in this release landed directly off the back of his messages.
|
> **🙏 Special thanks to [@zz5zz](https://github.com/zz5zz)** for his tireless quirk-spotting and bug reports on the [Psysonic Discord](https://discord.gg/AMnDRErm4u) — several of the polish fixes in this release landed directly off the back of his messages.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
import { flushSync } from 'react-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { DatabaseZap } from 'lucide-react';
|
import { DatabaseZap } from 'lucide-react';
|
||||||
import { useAuthStore } from '../../store/authStore';
|
import { useAuthStore } from '../../store/authStore';
|
||||||
@@ -18,7 +19,7 @@ import {
|
|||||||
bootstrapIndexedServer,
|
bootstrapIndexedServer,
|
||||||
type BindServerResult,
|
type BindServerResult,
|
||||||
} from '../../utils/library/librarySession';
|
} from '../../utils/library/librarySession';
|
||||||
import { enqueueLibrarySync } from '../../utils/library/librarySyncQueue';
|
import { enqueueLibrarySync, waitForLibrarySyncIdle } from '../../utils/library/librarySyncQueue';
|
||||||
import { syncIngestDisplayCount } from '../../utils/library/libraryReady';
|
import { syncIngestDisplayCount } from '../../utils/library/libraryReady';
|
||||||
import { serverListDisplayLabel } from '../../utils/server/serverDisplayName';
|
import { serverListDisplayLabel } from '../../utils/server/serverDisplayName';
|
||||||
import LibraryIndexServerRow, { type LibraryServerConnection } from './LibraryIndexServerRow';
|
import LibraryIndexServerRow, { type LibraryServerConnection } from './LibraryIndexServerRow';
|
||||||
@@ -58,6 +59,8 @@ export default function LibraryIndexSection() {
|
|||||||
const [connectionByServer, setConnectionByServer] = useState<Record<string, LibraryServerConnection>>({});
|
const [connectionByServer, setConnectionByServer] = useState<Record<string, LibraryServerConnection>>({});
|
||||||
const [progressByServer, setProgressByServer] = useState<Record<string, string | null>>({});
|
const [progressByServer, setProgressByServer] = useState<Record<string, string | null>>({});
|
||||||
const [busyServerId, setBusyServerId] = useState<string | null>(null);
|
const [busyServerId, setBusyServerId] = useState<string | null>(null);
|
||||||
|
const [excludingServerId, setExcludingServerId] = useState<string | null>(null);
|
||||||
|
const [includingServerId, setIncludingServerId] = useState<string | null>(null);
|
||||||
const [bootstrapping, setBootstrapping] = useState(false);
|
const [bootstrapping, setBootstrapping] = useState(false);
|
||||||
|
|
||||||
const pollTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
const pollTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
@@ -130,6 +133,8 @@ export default function LibraryIndexSection() {
|
|||||||
setConnectionByServer({});
|
setConnectionByServer({});
|
||||||
setProgressByServer({});
|
setProgressByServer({});
|
||||||
setBusyServerId(null);
|
setBusyServerId(null);
|
||||||
|
setExcludingServerId(null);
|
||||||
|
setIncludingServerId(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void runBootstrap();
|
void runBootstrap();
|
||||||
@@ -248,23 +253,52 @@ export default function LibraryIndexSection() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleIncludeServer = async (serverId: string) => {
|
const handleIncludeServer = async (serverId: string) => {
|
||||||
setServerSyncExcluded(serverId, false);
|
if (includingServerId || excludingServerId) return;
|
||||||
const srv = servers.find(s => s.id === serverId);
|
const srv = servers.find(s => s.id === serverId);
|
||||||
if (srv) {
|
if (!srv) return;
|
||||||
setBootstrapping(true);
|
flushSync(() => {
|
||||||
|
setIncludingServerId(serverId);
|
||||||
|
setServerSyncExcluded(serverId, false);
|
||||||
|
});
|
||||||
try {
|
try {
|
||||||
const result = await bootstrapIndexedServer(srv);
|
const result = await bootstrapIndexedServer(srv);
|
||||||
applyConnectionResults({ [serverId]: result });
|
applyConnectionResults({ [serverId]: result });
|
||||||
await refreshAllStatuses();
|
if (result === 'error') {
|
||||||
} finally {
|
setServerSyncExcluded(serverId, true);
|
||||||
setBootstrapping(false);
|
showToast(t('settings.libraryIndexBindError', { error: t('settings.libraryIndexStatusError') }), 5000, 'error');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
const fresh = await libraryGetStatus(serverId);
|
||||||
|
syncPhaseRef.current[serverId] = fresh.syncPhase;
|
||||||
|
setStatusByServer(prev => ({ ...prev, [serverId]: fresh }));
|
||||||
|
} catch {
|
||||||
|
/* status poll is best-effort */
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setServerSyncExcluded(serverId, true);
|
||||||
|
showToast(t('settings.libraryIndexBindError', { error: String(e) }), 5000, 'error');
|
||||||
|
} finally {
|
||||||
|
setIncludingServerId(null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleExcludeServer = async (serverId: string) => {
|
const handleExcludeServer = async (serverId: string) => {
|
||||||
setBootstrapping(true);
|
if (excludingServerId || includingServerId) return;
|
||||||
|
flushSync(() => setExcludingServerId(serverId));
|
||||||
try {
|
try {
|
||||||
|
const syncing =
|
||||||
|
busyServerId === serverId ||
|
||||||
|
statusByServer[serverId]?.syncPhase === 'initial_sync' ||
|
||||||
|
statusByServer[serverId]?.syncPhase === 'probing';
|
||||||
|
if (syncing) {
|
||||||
|
try {
|
||||||
|
await librarySyncCancel();
|
||||||
|
await waitForLibrarySyncIdle(serverId);
|
||||||
|
} catch {
|
||||||
|
/* best-effort — proceed with unbind */
|
||||||
|
}
|
||||||
|
}
|
||||||
await librarySyncClearSession(serverId);
|
await librarySyncClearSession(serverId);
|
||||||
setServerSyncExcluded(serverId, true);
|
setServerSyncExcluded(serverId, true);
|
||||||
setStatusByServer(prev => {
|
setStatusByServer(prev => {
|
||||||
@@ -277,10 +311,18 @@ export default function LibraryIndexSection() {
|
|||||||
delete next[serverId];
|
delete next[serverId];
|
||||||
return next;
|
return next;
|
||||||
});
|
});
|
||||||
|
setProgressByServer(prev => {
|
||||||
|
const next = { ...prev };
|
||||||
|
delete next[serverId];
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
if (busyServerId === serverId) {
|
||||||
|
setBusyServerId(null);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showToast(t('settings.libraryIndexBindError', { error: String(e) }), 5000, 'error');
|
showToast(t('settings.libraryIndexBindError', { error: String(e) }), 5000, 'error');
|
||||||
} finally {
|
} finally {
|
||||||
setBootstrapping(false);
|
setExcludingServerId(null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -292,7 +334,8 @@ export default function LibraryIndexSection() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const globalBusy = bootstrapping || busyServerId != null;
|
const globalBusy =
|
||||||
|
bootstrapping || busyServerId != null || excludingServerId != null || includingServerId != null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsSubSection
|
<SettingsSubSection
|
||||||
@@ -320,7 +363,7 @@ export default function LibraryIndexSection() {
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={masterEnabled}
|
checked={masterEnabled}
|
||||||
disabled={servers.length === 0 || bootstrapping}
|
disabled={servers.length === 0 || bootstrapping || includingServerId != null || excludingServerId != null}
|
||||||
onChange={e => void handleMasterToggle(e.target.checked)}
|
onChange={e => void handleMasterToggle(e.target.checked)}
|
||||||
/>
|
/>
|
||||||
<span className="toggle-track" />
|
<span className="toggle-track" />
|
||||||
@@ -349,7 +392,13 @@ export default function LibraryIndexSection() {
|
|||||||
connection={connectionByServer[srv.id] ?? 'unknown'}
|
connection={connectionByServer[srv.id] ?? 'unknown'}
|
||||||
progressLabel={progressByServer[srv.id] ?? null}
|
progressLabel={progressByServer[srv.id] ?? null}
|
||||||
busy={busyServerId === srv.id}
|
busy={busyServerId === srv.id}
|
||||||
actionsDisabled={globalBusy && busyServerId !== srv.id}
|
including={includingServerId === srv.id}
|
||||||
|
excluding={excludingServerId === srv.id}
|
||||||
|
actionsDisabled={
|
||||||
|
(globalBusy && busyServerId !== srv.id)
|
||||||
|
|| excludingServerId != null
|
||||||
|
|| includingServerId != null
|
||||||
|
}
|
||||||
onFullSync={() => void runServerAction(srv.id, 'full')}
|
onFullSync={() => void runServerAction(srv.id, 'full')}
|
||||||
onDeltaSync={() => void runServerAction(srv.id, 'delta')}
|
onDeltaSync={() => void runServerAction(srv.id, 'delta')}
|
||||||
onVerify={() => void runServerAction(srv.id, 'verify')}
|
onVerify={() => void runServerAction(srv.id, 'verify')}
|
||||||
@@ -376,10 +425,15 @@ export default function LibraryIndexSection() {
|
|||||||
type="button"
|
type="button"
|
||||||
className="btn btn-surface"
|
className="btn btn-surface"
|
||||||
style={{ fontSize: 12, padding: '4px 10px' }}
|
style={{ fontSize: 12, padding: '4px 10px' }}
|
||||||
disabled={bootstrapping}
|
disabled={
|
||||||
|
includingServerId != null || excludingServerId != null
|
||||||
|
}
|
||||||
|
aria-busy={includingServerId === srv.id}
|
||||||
onClick={() => void handleIncludeServer(srv.id)}
|
onClick={() => void handleIncludeServer(srv.id)}
|
||||||
>
|
>
|
||||||
{t('settings.libraryIndexIncludeServer')}
|
{includingServerId === srv.id
|
||||||
|
? t('settings.libraryIndexIncludingServer')
|
||||||
|
: t('settings.libraryIndexIncludeServer')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ interface LibraryIndexServerRowProps {
|
|||||||
connection: LibraryServerConnection;
|
connection: LibraryServerConnection;
|
||||||
progressLabel: string | null;
|
progressLabel: string | null;
|
||||||
busy: boolean;
|
busy: boolean;
|
||||||
|
including: boolean;
|
||||||
|
excluding: boolean;
|
||||||
actionsDisabled: boolean;
|
actionsDisabled: boolean;
|
||||||
onFullSync: () => void;
|
onFullSync: () => void;
|
||||||
onDeltaSync: () => void;
|
onDeltaSync: () => void;
|
||||||
@@ -33,6 +35,8 @@ export default function LibraryIndexServerRow({
|
|||||||
connection,
|
connection,
|
||||||
progressLabel,
|
progressLabel,
|
||||||
busy,
|
busy,
|
||||||
|
including,
|
||||||
|
excluding,
|
||||||
actionsDisabled,
|
actionsDisabled,
|
||||||
onFullSync,
|
onFullSync,
|
||||||
onDeltaSync,
|
onDeltaSync,
|
||||||
@@ -91,6 +95,9 @@ export default function LibraryIndexServerRow({
|
|||||||
{busy && (
|
{busy && (
|
||||||
<span style={{ fontSize: 11, color: 'var(--accent)' }}>{t('settings.libraryIndexServerSyncing')}</span>
|
<span style={{ fontSize: 11, color: 'var(--accent)' }}>{t('settings.libraryIndexServerSyncing')}</span>
|
||||||
)}
|
)}
|
||||||
|
{including && !busy && (
|
||||||
|
<span style={{ fontSize: 11, color: 'var(--accent)' }}>{t('settings.libraryIndexIncludingServer')}</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ fontSize: 12, color: 'var(--text-muted)', marginTop: 4, lineHeight: 1.45 }}>
|
<div style={{ fontSize: 12, color: 'var(--text-muted)', marginTop: 4, lineHeight: 1.45 }}>
|
||||||
{phaseLabel}
|
{phaseLabel}
|
||||||
@@ -133,11 +140,14 @@ export default function LibraryIndexServerRow({
|
|||||||
type="button"
|
type="button"
|
||||||
className="btn btn-ghost"
|
className="btn btn-ghost"
|
||||||
style={{ fontSize: 12, padding: '4px 10px', color: 'var(--text-muted)' }}
|
style={{ fontSize: 12, padding: '4px 10px', color: 'var(--text-muted)' }}
|
||||||
disabled={actionsDisabled}
|
disabled={actionsDisabled || excluding}
|
||||||
|
aria-busy={excluding}
|
||||||
onClick={onExclude}
|
onClick={onExclude}
|
||||||
>
|
>
|
||||||
<Ban size={13} />
|
<Ban size={13} />
|
||||||
{t('settings.libraryIndexExcludeServer')}
|
{excluding
|
||||||
|
? t('settings.libraryIndexExcludingServer')
|
||||||
|
: t('settings.libraryIndexExcludeServer')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ const CONTRIBUTOR_ENTRIES = [
|
|||||||
'Local library index: multi-server settings UI, serial sync queue, music-library-scoped local search, parallel initial ingest, i18n across 9 locales (PR #846)',
|
'Local library index: multi-server settings UI, serial sync queue, music-library-scoped local search, parallel initial ingest, i18n across 9 locales (PR #846)',
|
||||||
'Library browse: local-vs-network text search race, All Albums/Artists catalog from index, DevTools browse-race logging (PR #847)',
|
'Library browse: local-vs-network text search race, All Albums/Artists catalog from index, DevTools browse-race logging (PR #847)',
|
||||||
'Player stats: local listening history tab with heatmap, year summary, recent days, and day drill-down (PR #849)',
|
'Player stats: local listening history tab with heatmap, year summary, recent days, and day drill-down (PR #849)',
|
||||||
|
'Settings → Library: exclude/include index buttons show busy state and block repeat clicks (PR #850)',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -261,8 +261,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Vollständige Neusynchronisation',
|
libraryIndexFullResync: 'Vollständige Neusynchronisation',
|
||||||
libraryIndexDeltaSync: 'Delta-Synchronisation',
|
libraryIndexDeltaSync: 'Delta-Synchronisation',
|
||||||
libraryIndexExcludeServer: 'Von Synchronisation ausschließen',
|
libraryIndexExcludeServer: 'Von Synchronisation ausschließen',
|
||||||
|
libraryIndexExcludingServer: 'Wird ausgeschlossen…',
|
||||||
libraryIndexExcludedTitle: 'Von Synchronisation ausgeschlossen',
|
libraryIndexExcludedTitle: 'Von Synchronisation ausgeschlossen',
|
||||||
libraryIndexIncludeServer: 'Wieder einschließen',
|
libraryIndexIncludeServer: 'Wieder einschließen',
|
||||||
|
libraryIndexIncludingServer: 'Wird eingeschlossen…',
|
||||||
libraryIndexStatus: 'Status',
|
libraryIndexStatus: 'Status',
|
||||||
libraryIndexStatusIdle: 'Bereit',
|
libraryIndexStatusIdle: 'Bereit',
|
||||||
libraryIndexStatusProbing: 'Server wird geprüft…',
|
libraryIndexStatusProbing: 'Server wird geprüft…',
|
||||||
|
|||||||
@@ -264,8 +264,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Full resync',
|
libraryIndexFullResync: 'Full resync',
|
||||||
libraryIndexDeltaSync: 'Delta sync',
|
libraryIndexDeltaSync: 'Delta sync',
|
||||||
libraryIndexExcludeServer: 'Exclude from sync',
|
libraryIndexExcludeServer: 'Exclude from sync',
|
||||||
|
libraryIndexExcludingServer: 'Excluding…',
|
||||||
libraryIndexExcludedTitle: 'Excluded from sync',
|
libraryIndexExcludedTitle: 'Excluded from sync',
|
||||||
libraryIndexIncludeServer: 'Include again',
|
libraryIndexIncludeServer: 'Include again',
|
||||||
|
libraryIndexIncludingServer: 'Including…',
|
||||||
libraryIndexStatus: 'Status',
|
libraryIndexStatus: 'Status',
|
||||||
libraryIndexStatusIdle: 'Idle',
|
libraryIndexStatusIdle: 'Idle',
|
||||||
libraryIndexStatusProbing: 'Checking server…',
|
libraryIndexStatusProbing: 'Checking server…',
|
||||||
|
|||||||
@@ -259,8 +259,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Resincronización completa',
|
libraryIndexFullResync: 'Resincronización completa',
|
||||||
libraryIndexDeltaSync: 'Sincronización delta',
|
libraryIndexDeltaSync: 'Sincronización delta',
|
||||||
libraryIndexExcludeServer: 'Excluir de la sincronización',
|
libraryIndexExcludeServer: 'Excluir de la sincronización',
|
||||||
|
libraryIndexExcludingServer: 'Excluyendo…',
|
||||||
libraryIndexExcludedTitle: 'Excluidos de la sincronización',
|
libraryIndexExcludedTitle: 'Excluidos de la sincronización',
|
||||||
libraryIndexIncludeServer: 'Incluir de nuevo',
|
libraryIndexIncludeServer: 'Incluir de nuevo',
|
||||||
|
libraryIndexIncludingServer: 'Incluyendo…',
|
||||||
libraryIndexStatus: 'Estado',
|
libraryIndexStatus: 'Estado',
|
||||||
libraryIndexStatusIdle: 'Inactivo',
|
libraryIndexStatusIdle: 'Inactivo',
|
||||||
libraryIndexStatusProbing: 'Comprobando servidor…',
|
libraryIndexStatusProbing: 'Comprobando servidor…',
|
||||||
|
|||||||
@@ -257,8 +257,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Resynchronisation complète',
|
libraryIndexFullResync: 'Resynchronisation complète',
|
||||||
libraryIndexDeltaSync: 'Synchronisation delta',
|
libraryIndexDeltaSync: 'Synchronisation delta',
|
||||||
libraryIndexExcludeServer: 'Exclure de la synchronisation',
|
libraryIndexExcludeServer: 'Exclure de la synchronisation',
|
||||||
|
libraryIndexExcludingServer: 'Exclusion…',
|
||||||
libraryIndexExcludedTitle: 'Exclus de la synchronisation',
|
libraryIndexExcludedTitle: 'Exclus de la synchronisation',
|
||||||
libraryIndexIncludeServer: 'Réinclure',
|
libraryIndexIncludeServer: 'Réinclure',
|
||||||
|
libraryIndexIncludingServer: 'Réinclusion…',
|
||||||
libraryIndexStatus: 'État',
|
libraryIndexStatus: 'État',
|
||||||
libraryIndexStatusIdle: 'Inactif',
|
libraryIndexStatusIdle: 'Inactif',
|
||||||
libraryIndexStatusProbing: 'Vérification du serveur…',
|
libraryIndexStatusProbing: 'Vérification du serveur…',
|
||||||
|
|||||||
@@ -256,8 +256,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Full resynkronisering',
|
libraryIndexFullResync: 'Full resynkronisering',
|
||||||
libraryIndexDeltaSync: 'Delta-synkronisering',
|
libraryIndexDeltaSync: 'Delta-synkronisering',
|
||||||
libraryIndexExcludeServer: 'Ekskluder fra synkronisering',
|
libraryIndexExcludeServer: 'Ekskluder fra synkronisering',
|
||||||
|
libraryIndexExcludingServer: 'Ekskluderer…',
|
||||||
libraryIndexExcludedTitle: 'Ekskludert fra synkronisering',
|
libraryIndexExcludedTitle: 'Ekskludert fra synkronisering',
|
||||||
libraryIndexIncludeServer: 'Inkluder igjen',
|
libraryIndexIncludeServer: 'Inkluder igjen',
|
||||||
|
libraryIndexIncludingServer: 'Inkluderer…',
|
||||||
libraryIndexStatus: 'Status',
|
libraryIndexStatus: 'Status',
|
||||||
libraryIndexStatusIdle: 'Inaktiv',
|
libraryIndexStatusIdle: 'Inaktiv',
|
||||||
libraryIndexStatusProbing: 'Sjekker server…',
|
libraryIndexStatusProbing: 'Sjekker server…',
|
||||||
|
|||||||
@@ -257,8 +257,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Volledige resync',
|
libraryIndexFullResync: 'Volledige resync',
|
||||||
libraryIndexDeltaSync: 'Delta-sync',
|
libraryIndexDeltaSync: 'Delta-sync',
|
||||||
libraryIndexExcludeServer: 'Uitsluiten van synchronisatie',
|
libraryIndexExcludeServer: 'Uitsluiten van synchronisatie',
|
||||||
|
libraryIndexExcludingServer: 'Uitsluiten…',
|
||||||
libraryIndexExcludedTitle: 'Uitgesloten van synchronisatie',
|
libraryIndexExcludedTitle: 'Uitgesloten van synchronisatie',
|
||||||
libraryIndexIncludeServer: 'Weer opnemen',
|
libraryIndexIncludeServer: 'Weer opnemen',
|
||||||
|
libraryIndexIncludingServer: 'Opnemen…',
|
||||||
libraryIndexStatus: 'Status',
|
libraryIndexStatus: 'Status',
|
||||||
libraryIndexStatusIdle: 'Inactief',
|
libraryIndexStatusIdle: 'Inactief',
|
||||||
libraryIndexStatusProbing: 'Server controleren…',
|
libraryIndexStatusProbing: 'Server controleren…',
|
||||||
|
|||||||
@@ -263,8 +263,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Resincronizare completă',
|
libraryIndexFullResync: 'Resincronizare completă',
|
||||||
libraryIndexDeltaSync: 'Sincronizare delta',
|
libraryIndexDeltaSync: 'Sincronizare delta',
|
||||||
libraryIndexExcludeServer: 'Exclude din sincronizare',
|
libraryIndexExcludeServer: 'Exclude din sincronizare',
|
||||||
|
libraryIndexExcludingServer: 'Se exclude…',
|
||||||
libraryIndexExcludedTitle: 'Excluse din sincronizare',
|
libraryIndexExcludedTitle: 'Excluse din sincronizare',
|
||||||
libraryIndexIncludeServer: 'Include din nou',
|
libraryIndexIncludeServer: 'Include din nou',
|
||||||
|
libraryIndexIncludingServer: 'Se include…',
|
||||||
libraryIndexStatus: 'Stare',
|
libraryIndexStatus: 'Stare',
|
||||||
libraryIndexStatusIdle: 'Inactiv',
|
libraryIndexStatusIdle: 'Inactiv',
|
||||||
libraryIndexStatusProbing: 'Se verifică serverul…',
|
libraryIndexStatusProbing: 'Se verifică serverul…',
|
||||||
|
|||||||
@@ -269,8 +269,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: 'Полная пересинхронизация',
|
libraryIndexFullResync: 'Полная пересинхронизация',
|
||||||
libraryIndexDeltaSync: 'Быстрая дельта',
|
libraryIndexDeltaSync: 'Быстрая дельта',
|
||||||
libraryIndexExcludeServer: 'Исключить из синхронизации',
|
libraryIndexExcludeServer: 'Исключить из синхронизации',
|
||||||
|
libraryIndexExcludingServer: 'Отключается…',
|
||||||
libraryIndexExcludedTitle: 'Исключены из синхронизации',
|
libraryIndexExcludedTitle: 'Исключены из синхронизации',
|
||||||
libraryIndexIncludeServer: 'Включить снова',
|
libraryIndexIncludeServer: 'Включить снова',
|
||||||
|
libraryIndexIncludingServer: 'Подключается…',
|
||||||
libraryIndexStatus: 'Статус',
|
libraryIndexStatus: 'Статус',
|
||||||
libraryIndexStatusIdle: 'Ожидание',
|
libraryIndexStatusIdle: 'Ожидание',
|
||||||
libraryIndexStatusProbing: 'Проверка сервера…',
|
libraryIndexStatusProbing: 'Проверка сервера…',
|
||||||
|
|||||||
@@ -256,8 +256,10 @@ export const settings = {
|
|||||||
libraryIndexFullResync: '完全重新同步',
|
libraryIndexFullResync: '完全重新同步',
|
||||||
libraryIndexDeltaSync: '增量同步',
|
libraryIndexDeltaSync: '增量同步',
|
||||||
libraryIndexExcludeServer: '排除同步',
|
libraryIndexExcludeServer: '排除同步',
|
||||||
|
libraryIndexExcludingServer: '正在排除…',
|
||||||
libraryIndexExcludedTitle: '已排除同步',
|
libraryIndexExcludedTitle: '已排除同步',
|
||||||
libraryIndexIncludeServer: '重新纳入',
|
libraryIndexIncludeServer: '重新纳入',
|
||||||
|
libraryIndexIncludingServer: '正在纳入…',
|
||||||
libraryIndexStatus: '状态',
|
libraryIndexStatus: '状态',
|
||||||
libraryIndexStatusIdle: '空闲',
|
libraryIndexStatusIdle: '空闲',
|
||||||
libraryIndexStatusProbing: '正在检查服务器…',
|
libraryIndexStatusProbing: '正在检查服务器…',
|
||||||
|
|||||||
@@ -62,6 +62,25 @@ function waitForServerIdle(serverId: string): Promise<void> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Wait until a server emits `library:sync-idle`, or time out (best-effort). */
|
||||||
|
export function waitForLibrarySyncIdle(serverId: string, timeoutMs = 15_000): Promise<void> {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
let unlisten: (() => void) | undefined;
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
unlisten?.();
|
||||||
|
resolve();
|
||||||
|
}, timeoutMs);
|
||||||
|
void subscribeLibrarySyncIdle(p => {
|
||||||
|
if (p.serverId !== serverId) return;
|
||||||
|
clearTimeout(timer);
|
||||||
|
unlisten?.();
|
||||||
|
resolve();
|
||||||
|
}).then(fn => {
|
||||||
|
unlisten = fn;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function invokeSync(serverId: string, kind: LibrarySyncQueueKind): Promise<void> {
|
async function invokeSync(serverId: string, kind: LibrarySyncQueueKind): Promise<void> {
|
||||||
if (kind === 'verify') {
|
if (kind === 'verify') {
|
||||||
await librarySyncVerifyIntegrity({ serverId });
|
await librarySyncVerifyIntegrity({ serverId });
|
||||||
|
|||||||
Reference in New Issue
Block a user