diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-06-29 06:34:20 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-06-29 06:34:20 +0000 |
commit | 10f8a1ec3378c3540a35f73e986cc284f2e66f1d (patch) | |
tree | 8eaa95bd8a07b745152c5b7de09c89092a02613c /admin/catalog.php | |
parent | 52423ea7ff2ac0eaad39162b2c911e61d9f9ec4f (diff) | |
download | ampache-10f8a1ec3378c3540a35f73e986cc284f2e66f1d.tar.gz ampache-10f8a1ec3378c3540a35f73e986cc284f2e66f1d.tar.bz2 ampache-10f8a1ec3378c3540a35f73e986cc284f2e66f1d.zip |
added a db refresh of MPD on catalog add if its enabled and your using the file method also fixed a problem with having a single album art method when doing album art searches
Diffstat (limited to 'admin/catalog.php')
-rw-r--r-- | admin/catalog.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/admin/catalog.php b/admin/catalog.php index bc2787c1..e820a6dd 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -64,7 +64,20 @@ switch ($_REQUEST['action']) { break; case _("Add to all Catalogs"): - if (conf('demo_mode')) { break; } + if (conf('demo_mode')) { break; } + + /* If they are using the file MPD type, and it's currently enabled lets do a DBRefresh for em */ + if (conf('mpd_method') == 'file' AND conf('allow_mpd_playback')) { + // Connect to the MPD + if (!class_exists('mpd')) { require_once(conf('prefix') . "/modules/mpd/mpd.class.php"); } + if (!is_object($myMpd)) { $myMpd = new mpd(conf('mpd_host'),conf('mpd_port')); } + if (!$myMpd->connected) { + echo "<font class=\"error\">" . _("Error Connecting") . ": " . $myMpd->errStr . "</font>\n"; + log_event($_SESSION['userdata']['username'],' connection_failed ',"Error: Unable able to connect to MPD, " . $myMpd->errStr); + } // MPD connect failed + + $myMpd->DBRefresh(); + } // if MPD enabled $catalogs = $catalog->get_catalogs(); foreach ($catalogs as $data) { |