Made settings more readable

This commit is contained in:
RemixDev 2021-06-08 18:57:06 +02:00
parent 4a7c0962e5
commit b855d8d3a0
3 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
const Plugin = require('./plugin.js')
const Plugin = require('./index.js')
const { getConfigFolder } = require('../utils/localpaths.js')
const {
generateTrackItem,
@ -353,7 +353,7 @@ class Spotify extends Plugin {
fs.writeFileSync(this.configFolder+'settings.json', JSON.stringify({
...this.credentials,
...this.settings
}))
}, null, 2))
let settings = JSON.parse(fs.readFileSync(this.configFolder+'settings.json'))
this.setSettings(settings)
this.checkCredentials()
@ -365,7 +365,7 @@ class Spotify extends Plugin {
fs.writeFileSync(this.configFolder+'settings.json', JSON.stringify({
...this.credentials,
...this.settings
}))
}, null, 2))
}
getSettings(){

View file

@ -104,7 +104,7 @@ function save(settings, configFolder){
configFolder = configFolder || getConfigFolder()
if (!fs.existsSync(configFolder)) fs.mkdirSync(configFolder)
fs.writeFileSync(configFolder+'config.json', JSON.stringify(settings))
fs.writeFileSync(configFolder+'config.json', JSON.stringify(settings, null, 2))
}
function load(configFolder){