mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2025-01-29 17:18:27 +00:00
Made settings more readable
This commit is contained in:
parent
4a7c0962e5
commit
b855d8d3a0
|
@ -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(){
|
||||
|
|
|
@ -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){
|
||||
|
|
Loading…
Reference in a new issue