mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2024-12-28 18:36:26 +00:00
Fixed settings check issues
This commit is contained in:
parent
e93981fcf9
commit
229d3d764e
|
@ -49,7 +49,7 @@ const DEFAULTS = {
|
||||||
syncedLyrics: false,
|
syncedLyrics: false,
|
||||||
embeddedArtworkSize: 800,
|
embeddedArtworkSize: 800,
|
||||||
embeddedArtworkPNG: false,
|
embeddedArtworkPNG: false,
|
||||||
localArtworkSize: 1400,
|
localArtworkSize: 1200,
|
||||||
localArtworkFormat: "jpg",
|
localArtworkFormat: "jpg",
|
||||||
saveArtwork: true,
|
saveArtwork: true,
|
||||||
coverImageTemplate: "cover",
|
coverImageTemplate: "cover",
|
||||||
|
@ -121,13 +121,13 @@ function load(configFolder){
|
||||||
function check(settings){
|
function check(settings){
|
||||||
let changes = 0
|
let changes = 0
|
||||||
Object.keys(DEFAULTS).forEach( _iSet => {
|
Object.keys(DEFAULTS).forEach( _iSet => {
|
||||||
if (! settings[_iSet] || typeof settings[_iSet] != DEFAULTS[_iSet]){
|
if (settings[_iSet] === undefined || typeof settings[_iSet] != typeof DEFAULTS[_iSet]){
|
||||||
settings[_iSet] = DEFAULTS[_iSet]
|
settings[_iSet] = DEFAULTS[_iSet]
|
||||||
changes++
|
changes++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Object.keys(DEFAULTS.tags).forEach( _iSet => {
|
Object.keys(DEFAULTS.tags).forEach( _iSet => {
|
||||||
if (! settings.tags[_iSet] || typeof settings.tags[_iSet] != DEFAULTS.tags[_iSet]){
|
if (settings.tags[_iSet] === undefined || typeof settings.tags[_iSet] != typeof DEFAULTS.tags[_iSet]){
|
||||||
settings.tags[_iSet] = DEFAULTS.tags[_iSet]
|
settings.tags[_iSet] = DEFAULTS.tags[_iSet]
|
||||||
changes++
|
changes++
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue