|
@ -40,6 +40,9 @@ const Config = () => { |
|
|
}, []); |
|
|
}, []); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
// skip scan status if server type is funkwhale
|
|
|
|
|
|
if (config.serverType === 'funkwhale') return setScanProgress(0); |
|
|
|
|
|
|
|
|
// Check scan status on render
|
|
|
// Check scan status on render
|
|
|
apiController({ serverType: config.serverType, endpoint: 'getScanStatus' }) |
|
|
apiController({ serverType: config.serverType, endpoint: 'getScanStatus' }) |
|
|
.then((status) => { |
|
|
.then((status) => { |
|
@ -53,6 +56,9 @@ const Config = () => { |
|
|
}, [config.serverType]); |
|
|
}, [config.serverType]); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
// skip scan status if server type is funkwhale
|
|
|
|
|
|
if (config.serverType === 'funkwhale') return setScanProgress(0); |
|
|
|
|
|
|
|
|
// Reload scan status on interval during scan
|
|
|
// Reload scan status on interval during scan
|
|
|
if (isScanning) { |
|
|
if (isScanning) { |
|
|
const interval = setInterval(() => { |
|
|
const interval = setInterval(() => { |
|
@ -125,20 +131,24 @@ const Config = () => { |
|
|
sidetitle={<DisconnectButton />} |
|
|
sidetitle={<DisconnectButton />} |
|
|
subsidetitle={ |
|
|
subsidetitle={ |
|
|
<ButtonToolbar> |
|
|
<ButtonToolbar> |
|
|
<StyledButton |
|
|
{useAppSelector((state) => state.config).serverType !== 'funkwhale' && ( |
|
|
size="sm" |
|
|
<> |
|
|
onClick={async () => { |
|
|
<StyledButton |
|
|
apiController({ |
|
|
size="sm" |
|
|
serverType: config.serverType, |
|
|
onClick={async () => { |
|
|
endpoint: 'startScan', |
|
|
apiController({ |
|
|
args: { musicFolderId: folder.musicFolder }, |
|
|
serverType: config.serverType, |
|
|
}); |
|
|
endpoint: 'startScan', |
|
|
setIsScanning(true); |
|
|
args: { musicFolderId: folder.musicFolder }, |
|
|
}} |
|
|
}); |
|
|
disabled={isScanning} |
|
|
setIsScanning(true); |
|
|
> |
|
|
}} |
|
|
{isScanning ? `${scanProgress}` : 'Scan'} |
|
|
disabled={isScanning} |
|
|
</StyledButton> |
|
|
> |
|
|
|
|
|
{isScanning ? `${scanProgress}` : 'Scan'} |
|
|
|
|
|
</StyledButton> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
<Whisper |
|
|
<Whisper |
|
|
trigger="click" |
|
|
trigger="click" |
|
|
placement="auto" |
|
|
placement="auto" |
|
|