The issue is,
As soon as i change the code to the code you said. If i try to disable the state file and hit save it automatically changes back to enabled?
Thats the first issue.
Second issue was when i changed the if statement that you gave me from:
if (!isset($mpdcfg['state_file']) || $mpdcfg['state_file'] === 'no') {
$redis->hDel('mpdconf', 'state_file');
} else {
$output .= "state_file\t\"/var/lib/mpd/mpdstate\"\n";
$redis->hSet('mpdconf', 'state_file', '/var/lib/mpd/mpdstate');
}
To
if (!isset($mpdcfg['state_file']) || $mpdcfg['state_file'] === 'no') {
$output .= "state_file\t\"/var/lib/mpd/mpdstate\"\n";
$redis->hSet('mpdconf', 'state_file', '/var/lib/mpd/mpdstate');
} else {
$redis->hDel('mpdconf', 'state_file');
}
Basically meaning if its set then delete state file else if diabled then enable (Reason for this? Because like said above, i couldnt make disabled stay disabled? It would automatically switch to enabled once i press saved in the settings) But anyway, once i did this the system crashed and gave me weird swerls were track name should of been and the queue disappeared as in (Browse your library part when i have nothing in queue).
So basically, for some reason.. it seems like the system doesnt like having the state file switched off? Cause when it does switch off it crashes the entire system :/ Thats why if theres no solution in fixing this weird crash then i rather have state file completely turned off as its no use for my purpose of use!:)