diff --git a/src/core/globalshortcuts.cpp b/src/core/globalshortcuts.cpp index 9ec7bff15..3a6ebc390 100644 --- a/src/core/globalshortcuts.cpp +++ b/src/core/globalshortcuts.cpp @@ -75,6 +75,10 @@ GlobalShortcuts::GlobalShortcuts(QWidget* parent) AddShortcut("toggle_last_fm_scrobbling", tr("Enable/disable Last.fm scrobbling"), SIGNAL(ToggleScrobbling())); + AddShortcut("love_last_fm_scrobbling", tr("Love (Last.fm scrobbling)"), + SIGNAL(Love())); + AddShortcut("ban_last_fm_scrobbling", tr("Ban (Last.fm scrobbling)"), + SIGNAL(Ban())); AddRatingShortcut("rate_zero_star", tr("Rate the current song 0 stars"), rating_signals_mapper_, 0); diff --git a/src/core/globalshortcuts.h b/src/core/globalshortcuts.h index 48af6987d..a80d89549 100644 --- a/src/core/globalshortcuts.h +++ b/src/core/globalshortcuts.h @@ -60,7 +60,7 @@ class GlobalShortcuts : public QWidget { void Unregister(); void Register(); - signals: +signals: void Play(); void Pause(); void PlayPause(); @@ -80,6 +80,8 @@ class GlobalShortcuts : public QWidget { void CycleShuffleMode(); void CycleRepeatMode(); void ToggleScrobbling(); + void Love(); + void Ban(); private: void AddShortcut(const QString& id, const QString& name, const char* signal, diff --git a/src/internet/lastfm/lastfmservice.cpp b/src/internet/lastfm/lastfmservice.cpp index 243e5858d..d8445fa60 100644 --- a/src/internet/lastfm/lastfmservice.cpp +++ b/src/internet/lastfm/lastfmservice.cpp @@ -345,7 +345,8 @@ void LastFMService::NowPlaying(const Song& song) { return; } #else -// TODO(John Maguire): validity was removed from liblastfm1 but might reappear, it should have +// TODO(John Maguire): validity was removed from liblastfm1 but might reappear, +// it should have // no impact as we get a different error when actually trying to scrobble. #endif @@ -382,6 +383,8 @@ void LastFMService::Love() { } void LastFMService::Ban() { + if (!IsAuthenticated()) ShowConfig(); + lastfm::MutableTrack mtrack(last_track_); mtrack.ban(); last_track_ = mtrack; diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 3ff22148a..bd5e53a08 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -774,6 +774,8 @@ MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd, #ifdef HAVE_LIBLASTFM connect(global_shortcuts_, SIGNAL(ToggleScrobbling()), app_->scrobbler(), SLOT(ToggleScrobbling())); + connect(global_shortcuts_, SIGNAL(Love()), app_->scrobbler(), SLOT(Love())); + connect(global_shortcuts_, SIGNAL(Ban()), app_->scrobbler(), SLOT(Ban())); #endif connect(global_shortcuts_, SIGNAL(RateCurrentSong(int)),