Skip to content

Commit

Permalink
gdf
Browse files Browse the repository at this point in the history
  • Loading branch information
fatg3erman committed Feb 25, 2021
1 parent 753e4f7 commit f70d4fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@
$mpd_status = $player->get_status();
if (array_key_exists('error', $mpd_status)) {
logger::warn("INIT", "MPD Password Failed or other status failure");
connect_fail(language::gettext("setup_connecterror").$mpd_status['error']);
$player->clear_error();
if (strpos($mpd_status['error'], 'Failed to decode') !== false) {
logger::warn('INIT', 'Looks like the error is a stream decode error. Ignoring it');
} else {
connect_fail(language::gettext("setup_connecterror").$mpd_status['error']);
}
}
} else {
logger::error("INIT", "MPD Connection Failure");
Expand All @@ -106,7 +111,7 @@
// If we're connected by a local socket we can read the music directory
logger::log('INIT', 'Getting Player Config');
$arse = $player->get_config();
if (array_key_exists('music_directory', $arse)) {
if (is_array($arse) && array_key_exists('music_directory', $arse)) {
prefs::set_music_directory($arse['music_directory']);
}
$player->close_mpd_connection();
Expand Down

0 comments on commit f70d4fc

Please sign in to comment.