Re-enable the love button after going to a different song in a radio stream. Fixes issue 1086

This commit is contained in:
David Sansome 2011-04-16 15:27:34 +00:00
parent 12b6bbd166
commit 343b6d6c3a
4 changed files with 13 additions and 3 deletions

View File

@ -483,6 +483,8 @@ void LastFMService::NowPlaying(const Song &song) {
qDebug() << "Scrobbling stream track" << mtrack.title() << "length" << duration_secs;
scrobbler_->cache(mtrack);
scrobbler_->submit();
emit ScrobbledRadioStream();
}
}

View File

@ -122,6 +122,7 @@ class LastFMService : public RadioService {
void ScrobbleButtonVisibilityChanged(bool value);
void ScrobblerStatus(int value);
void UpdatedSubscriberStatus(bool is_subscriber);
void ScrobbledRadioStream();
protected:
QModelIndex GetCurrentIndex();

View File

@ -515,9 +515,11 @@ MainWindow::MainWindow(
connect(radio_model_, SIGNAL(OpenSettingsAtPage(SettingsDialog::Page)), SLOT(OpenSettingsDialogAtPage(SettingsDialog::Page)));
connect(radio_model_, SIGNAL(AddToPlaylist(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
#ifdef HAVE_LIBLASTFM
connect(RadioModel::Service<LastFMService>(), SIGNAL(ButtonVisibilityChanged(bool)), SLOT(LastFMButtonVisibilityChanged(bool)));
connect(RadioModel::Service<LastFMService>(), SIGNAL(ScrobbleButtonVisibilityChanged(bool)), SLOT(ScrobbleButtonVisibilityChanged(bool)));
connect(RadioModel::Service<LastFMService>(), SIGNAL(ScrobblingEnabledChanged(bool)), SLOT(ScrobblingEnabledChanged(bool)));
LastFMService* lastfm_service = RadioModel::Service<LastFMService>();
connect(lastfm_service, SIGNAL(ButtonVisibilityChanged(bool)), SLOT(LastFMButtonVisibilityChanged(bool)));
connect(lastfm_service, SIGNAL(ScrobbleButtonVisibilityChanged(bool)), SLOT(ScrobbleButtonVisibilityChanged(bool)));
connect(lastfm_service, SIGNAL(ScrobblingEnabledChanged(bool)), SLOT(ScrobblingEnabledChanged(bool)));
connect(lastfm_service, SIGNAL(ScrobbledRadioStream()), SLOT(ScrobbledRadioStream()));
#endif
connect(radio_model_->Service<MagnatuneService>(), SIGNAL(DownloadFinished(QStringList)), osd_, SLOT(MagnatuneDownloadFinished(QStringList)));
connect(radio_view_->tree(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
@ -1075,6 +1077,10 @@ void MainWindow::UpdateTrackPosition() {
}
#ifdef HAVE_LIBLASTFM
void MainWindow::ScrobbledRadioStream() {
ui_->action_love->setEnabled(true);
}
void MainWindow::Love() {
RadioModel::Service<LastFMService>()->Love();
ui_->action_love->setEnabled(false);

View File

@ -198,6 +198,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
#ifdef HAVE_LIBLASTFM
void ScrobblingEnabledChanged(bool value);
void Love();
void ScrobbledRadioStream();
#endif
void TaskCountChanged(int count);