Browse Source

fix default cache path

master
jeffvli 3 years ago
parent
commit
426da42e75
  1. 7
      src/components/settings/Config.tsx
  2. 9
      src/components/shared/setDefaultSettings.ts

7
src/components/settings/Config.tsx

@ -145,6 +145,7 @@ const Config = () => {
>
Yes
</Button>
<strong>WARNING: This will reload the application</strong>
</div>
</Popover>
}
@ -300,7 +301,11 @@ const Config = () => {
<div style={{ overflow: 'auto' }}>
Location:{' '}
<code>
{path.join(String(settings.getSync('cachePath')), 'sonixdCache')}
{path.join(
String(settings.getSync('cachePath')),
'sonixdCache',
String(localStorage.getItem('serverBase64'))
)}
</code>
</div>
)}

9
src/components/shared/setDefaultSettings.ts

@ -5,14 +5,7 @@ import { getSongCachePath, getImageCachePath } from '../../shared/utils';
// Set setting defaults on first login
const setDefaultSettings = (force: boolean) => {
if (force || !settings.hasSync('cachePath')) {
settings.setSync(
'cachePath',
path.join(
path.dirname(settings.file()),
'sonixdCache',
`${localStorage.getItem('serverBase64')}`
)
);
settings.setSync('cachePath', path.join(path.dirname(settings.file())));
}
fs.mkdirSync(getSongCachePath(), { recursive: true });

Loading…
Cancel
Save