Enable 'refresh db' command for mopidy. Update will not reall yhappen, but Cantata will delete its caches, and reload these

This commit is contained in:
craig.p.drummond
2014-02-05 19:22:59 +00:00
committed by craig.p.drummond
parent 7cda7b29d5
commit 3f1bcf5f74
2 changed files with 9 additions and 1 deletions

View File

@@ -1067,7 +1067,7 @@ void MainWindow::messageWidgetVisibility(bool v)
void MainWindow::mpdConnectionStateChanged(bool connected)
{
serverInfoAction->setEnabled(connected && !MPDConnection::self()->isMopdidy());
refreshDbAction->setEnabled(connected && !MPDConnection::self()->isMopdidy());
refreshDbAction->setEnabled(connected);
addStreamToPlayQueueAction->setEnabled(connected);
if (connected) {
messageWidget->hide();

View File

@@ -1220,6 +1220,14 @@ void MPDConnection::update()
{
if (sendCommand("update").ok) {
emit updatingDatabase();
if (isMopdidy()) {
// Mopidy does not support MPD's update command. So, when user presses update DB, what we
// do instead is clear library/dir caches, then when response to getStats is received,
// library/dir should get refreshed...
emit updatedDatabase(); // Emit thi to stop any spinners...
getStats();
}
}
}