From 9dd45dbe82b2f57f8f7c4a1201b79b2c19e513a2 Mon Sep 17 00:00:00 2001 From: Andrea Decorte Date: Thu, 28 Apr 2011 10:32:56 +0000 Subject: [PATCH] Improved Last.fm scrobbling when connection is down --- src/playlist/playlist.h | 1 + src/radio/lastfmconfig.cpp | 15 ++++++++++----- src/radio/lastfmservice.cpp | 17 ++++++++++++++++- src/radio/lastfmservice.h | 4 ++++ src/scripting/python/playlist.sip | 1 + src/translations/ar.po | 8 ++++++++ src/translations/be.po | 8 ++++++++ src/translations/bg.po | 8 ++++++++ src/translations/br.po | 8 ++++++++ src/translations/bs.po | 8 ++++++++ src/translations/ca.po | 8 ++++++++ src/translations/cs.po | 8 ++++++++ src/translations/cy.po | 8 ++++++++ src/translations/da.po | 8 ++++++++ src/translations/de.po | 8 ++++++++ src/translations/el.po | 8 ++++++++ src/translations/en.po | 8 ++++++++ src/translations/en_CA.po | 8 ++++++++ src/translations/en_GB.po | 8 ++++++++ src/translations/eo.po | 8 ++++++++ src/translations/es.po | 8 ++++++++ src/translations/et.po | 8 ++++++++ src/translations/eu.po | 8 ++++++++ src/translations/fi.po | 8 ++++++++ src/translations/fr.po | 8 ++++++++ src/translations/gl.po | 8 ++++++++ src/translations/he.po | 8 ++++++++ src/translations/hi.po | 8 ++++++++ src/translations/hr.po | 8 ++++++++ src/translations/hu.po | 8 ++++++++ src/translations/hy.po | 8 ++++++++ src/translations/is.po | 8 ++++++++ src/translations/it.po | 8 ++++++++ src/translations/ja.po | 8 ++++++++ src/translations/kk.po | 8 ++++++++ src/translations/lt.po | 8 ++++++++ src/translations/lv.po | 8 ++++++++ src/translations/ms.po | 8 ++++++++ src/translations/nb.po | 8 ++++++++ src/translations/nl.po | 8 ++++++++ src/translations/oc.po | 8 ++++++++ src/translations/pa.po | 8 ++++++++ src/translations/pl.po | 8 ++++++++ src/translations/pt.po | 8 ++++++++ src/translations/pt_BR.po | 8 ++++++++ src/translations/ro.po | 8 ++++++++ src/translations/ru.po | 8 ++++++++ src/translations/sk.po | 8 ++++++++ src/translations/sl.po | 8 ++++++++ src/translations/sr.po | 8 ++++++++ src/translations/sv.po | 8 ++++++++ src/translations/tr.po | 8 ++++++++ src/translations/translations.pot | 8 ++++++++ src/translations/uk.po | 8 ++++++++ src/translations/vi.po | 8 ++++++++ src/translations/zh_CN.po | 8 ++++++++ src/translations/zh_TW.po | 8 ++++++++ src/ui/mainwindow.cpp | 13 ++++++++++--- 58 files changed, 458 insertions(+), 9 deletions(-) diff --git a/src/playlist/playlist.h b/src/playlist/playlist.h index 69bbb6723..b9f645aa8 100644 --- a/src/playlist/playlist.h +++ b/src/playlist/playlist.h @@ -124,6 +124,7 @@ class Playlist : public QAbstractListModel { LastFM_Seeked, // The user seeked so don't scrobble LastFM_Error, // Tried to scrobble but got an error LastFM_Invalid, // The song isn't suitable for scrobbling + LastFM_Queued, // Track added to the queue for scrobbling }; static const char* kRowsMimetype; diff --git a/src/radio/lastfmconfig.cpp b/src/radio/lastfmconfig.cpp index 88c69e064..8893a3e66 100644 --- a/src/radio/lastfmconfig.cpp +++ b/src/radio/lastfmconfig.cpp @@ -112,10 +112,16 @@ void LastFMConfig::UpdatedSubscriberStatus(bool is_subscriber) { ui_->subscriber_warning->hide(); ui_->warn_icon->hide(); } else { - ui_->subscriber_warning->setText( - tr("You will not be able to play Last.fm radio stations " - "as you are not a Last.fm subscriber.")); ui_->warn_icon->show(); + if (service_->HasConnectionProblems()) { + ui_->subscriber_warning->setText( + tr("Clementine couldn't fetch your subscription status since there are problems " + "with your connection. Played tracks will be cached and sent later to Last.fm.")); + } else { + ui_->subscriber_warning->setText( + tr("You will not be able to play Last.fm radio stations " + "as you are not a Last.fm subscriber.")); + } } } @@ -143,8 +149,7 @@ void LastFMConfig::RefreshControls(bool authenticated) { ui_->sign_out->setVisible(authenticated); if (authenticated) { ui_->status->setText(QString(tr("You're logged in as %1")).arg(lastfm::ws::Username)); - } - else { + } else { ui_->icon->setPixmap(IconLoader::Load("dialog-question").pixmap(16)); ui_->status->setText(tr("Please fill in the blanks to login into Last.fm")); diff --git a/src/radio/lastfmservice.cpp b/src/radio/lastfmservice.cpp index d597e350d..29ac2ef49 100644 --- a/src/radio/lastfmservice.cpp +++ b/src/radio/lastfmservice.cpp @@ -75,7 +75,8 @@ LastFMService::LastFMService(RadioModel* parent) tag_list_(NULL), custom_list_(NULL), friends_list_(NULL), - neighbours_list_(NULL) + neighbours_list_(NULL), + connection_problems_(false) { ReloadSettings(); //we emit the signal the first time to be sure the buttons are in the right state @@ -253,6 +254,7 @@ void LastFMService::Authenticate(const QString& username, const QString& passwor QNetworkReply* reply = lastfm::ws::post(params); connect(reply, SIGNAL(finished()), SLOT(AuthenticateReplyFinished())); + // If we need more detailed error reporting, handle error(NetworkError) signal } void LastFMService::SignOut() { @@ -326,15 +328,24 @@ void LastFMService::UpdateSubscriberStatusFinished() { throw std::runtime_error(""); #endif + connection_problems_ = false; QString subscriber = lfm["user"]["subscriber"].text(); const bool is_subscriber = (subscriber.toInt() == 1); + QSettings settings; settings.beginGroup(kSettingsGroup); settings.setValue("Subscriber", is_subscriber); qLog(Info) << lastfm::ws::Username << "Subscriber status:" << is_subscriber; emit UpdatedSubscriberStatus(is_subscriber); + } catch (lastfm::ws::ParseError e) { + // The connection to the server is unavailable + connection_problems_ = true; + qLog(Error) << "Last.fm parse error: " << e.enumValue(); + emit UpdatedSubscriberStatus(false); } catch (std::runtime_error& e) { + connection_problems_ = true; qLog(Error) << e.what(); + emit UpdatedSubscriberStatus(false); } } @@ -516,7 +527,11 @@ void LastFMService::Scrobble() { return; scrobbler_->cache(last_track_); + + // Let's mark a track as cached, useful when the connection is down + emit ScrobblerStatus(30); scrobbler_->submit(); + already_scrobbled_ = true; } diff --git a/src/radio/lastfmservice.h b/src/radio/lastfmservice.h index 1525ab40a..d5a4b373e 100644 --- a/src/radio/lastfmservice.h +++ b/src/radio/lastfmservice.h @@ -98,6 +98,7 @@ class LastFMService : public RadioService { bool IsScrobblingEnabled() const { return scrobbling_enabled_; } bool AreButtonsVisible() const { return buttons_visible_; } bool IsScrobbleButtonVisible() const { return scrobble_button_visible_; } + bool HasConnectionProblems() const { return connection_problems_; } void Authenticate(const QString& username, const QString& password); void SignOut(); @@ -203,6 +204,9 @@ class LastFMService : public RadioService { QStandardItem* neighbours_list_; QHash art_urls_; + + // Useful to inform the user that we can't scrobble right now + bool connection_problems_; }; #endif // LASTFMSERVICE_H diff --git a/src/scripting/python/playlist.sip b/src/scripting/python/playlist.sip index 9716389bc..1809da0a0 100644 --- a/src/scripting/python/playlist.sip +++ b/src/scripting/python/playlist.sip @@ -53,6 +53,7 @@ public: LastFM_Seeked, // The user seeked so don't scrobble LastFM_Error, // Tried to scrobble but got an error LastFM_Invalid, // The song isn't suitable for scrobbling + LastFM_Queued, // Track added to the queue for scrobbling }; static const char* kRowsMimetype; diff --git a/src/translations/ar.po b/src/translations/ar.po index 2a8f991df..9a3f43812 100644 --- a/src/translations/ar.po +++ b/src/translations/ar.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/be.po b/src/translations/be.po index c49a2b7e7..75033200b 100644 --- a/src/translations/be.po +++ b/src/translations/be.po @@ -576,6 +576,11 @@ msgstr "" "Clementine не можа загрузіць якою-небудзь візуалізацыю projectM. Калі ласка, " "праверце, што ўстанавілі Clementine правільна." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Прагляд малюнкаў у Clementine" @@ -2459,6 +2464,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/bg.po b/src/translations/bg.po index f467fde76..52cb62208 100644 --- a/src/translations/bg.po +++ b/src/translations/bg.po @@ -584,6 +584,11 @@ msgstr "" "Клементин не можа да зареди никаква проекМ визуализация.Проверете дали сте " "инсталирали Клементин правилно." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Клементин мениджър на изображения" @@ -2488,6 +2493,9 @@ msgstr "Сортиране" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/br.po b/src/translations/br.po index 1d3de935e..4afd1e536 100644 --- a/src/translations/br.po +++ b/src/translations/br.po @@ -581,6 +581,11 @@ msgstr "" "N'eo ket bet gouest Clementine da gargañ diskwel porjectM. Gwiriekait ez eo " "staliet mat Clementine." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Gweler skeudennoù Clementine" @@ -2476,6 +2481,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/bs.po b/src/translations/bs.po index 694736325..da7e4317f 100644 --- a/src/translations/bs.po +++ b/src/translations/bs.po @@ -581,6 +581,11 @@ msgstr "" "Clementin nije mogao učitati projectM vizualizacije. Provjerite da li ste " "instalirali Clementine kako treba." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine preglednik slika" @@ -2462,6 +2467,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/ca.po b/src/translations/ca.po index d4adb5d9f..353cecd32 100644 --- a/src/translations/ca.po +++ b/src/translations/ca.po @@ -588,6 +588,11 @@ msgstr "" "Clementine no pot carregar cap visualització de projectM. Asseguri's que té " "instal·lat Clementine correctament." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Visor d'imatges Clementine" @@ -2482,6 +2487,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/cs.po b/src/translations/cs.po index e09e3ae6a..798278659 100644 --- a/src/translations/cs.po +++ b/src/translations/cs.po @@ -586,6 +586,11 @@ msgstr "" "Clementine se nepodařilo nahrát žádné vizualizace z projectM. Ověřte, že " "jste Clementine nainstalovali správně." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Prohlížeč obrázků pro Clementine" @@ -2485,6 +2490,9 @@ msgstr "Třídění" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/cy.po b/src/translations/cy.po index e17e5203a..438d76de2 100644 --- a/src/translations/cy.po +++ b/src/translations/cy.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/da.po b/src/translations/da.po index 71818cde1..b1f940661 100644 --- a/src/translations/da.po +++ b/src/translations/da.po @@ -569,6 +569,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2450,6 +2455,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/de.po b/src/translations/de.po index d7df5e7fc..284cec9c1 100644 --- a/src/translations/de.po +++ b/src/translations/de.po @@ -591,6 +591,11 @@ msgstr "" "Clementine konnte keine projectM-Visualisierungen laden. Überprüfen Sie Ihre " "Installation." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine Bildbetrachter" @@ -2494,6 +2499,9 @@ msgstr "Sortierung" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/el.po b/src/translations/el.po index 53e5ba2fc..8a5c9a4fa 100644 --- a/src/translations/el.po +++ b/src/translations/el.po @@ -595,6 +595,11 @@ msgstr "" "Ο Clementine δεν μπορεί να φορτώσει κάποιο projectM οπτικό εφέ. Βεβαιωθείτε " "πως έχετε εγκαταστήσει τον Clementine σωστά." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Προβολή εικόνων του Clementine" @@ -2505,6 +2510,9 @@ msgstr "Ταξινόμηση" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/en.po b/src/translations/en.po index 7eb278c56..55f7c9fbe 100644 --- a/src/translations/en.po +++ b/src/translations/en.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/en_CA.po b/src/translations/en_CA.po index e3cfb557f..cd75c067e 100644 --- a/src/translations/en_CA.po +++ b/src/translations/en_CA.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2449,6 +2454,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/en_GB.po b/src/translations/en_GB.po index 29871120b..41d1ecbd2 100644 --- a/src/translations/en_GB.po +++ b/src/translations/en_GB.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2446,6 +2451,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/eo.po b/src/translations/eo.po index 47d9377a7..2e74fc8ac 100644 --- a/src/translations/eo.po +++ b/src/translations/eo.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/es.po b/src/translations/es.po index 03fa5dc13..40f5c936c 100644 --- a/src/translations/es.po +++ b/src/translations/es.po @@ -595,6 +595,11 @@ msgstr "" "Clementine no puede cargar ninguna visualización de projectM. Asegúrese que " "tiene instalado Clementine adecuadamente." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Visor de imágenes de Clementine" @@ -2503,6 +2508,9 @@ msgstr "Ordenando" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/et.po b/src/translations/et.po index 6357349f0..094b21233 100644 --- a/src/translations/et.po +++ b/src/translations/et.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2446,6 +2451,9 @@ msgstr "Sorteerimine" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/eu.po b/src/translations/eu.po index 6eeb56764..2a6e4333d 100644 --- a/src/translations/eu.po +++ b/src/translations/eu.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/fi.po b/src/translations/fi.po index 559196101..78d100457 100644 --- a/src/translations/fi.po +++ b/src/translations/fi.po @@ -579,6 +579,11 @@ msgstr "" "Clementine epäonnistui projectM-visualisoinnin esittämisessä. Varmista " "Clementine-asennuksen toimivuus." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2468,6 +2473,9 @@ msgstr "Järjestys" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/fr.po b/src/translations/fr.po index 83add55f0..1cafb7446 100644 --- a/src/translations/fr.po +++ b/src/translations/fr.po @@ -596,6 +596,11 @@ msgstr "" "Clementine n'a pu charger les visualisations projectM. Vérifiez que " "Clementine est installé correctement." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Visionneur d'images de Clementine" @@ -2507,6 +2512,9 @@ msgstr "Tri" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/gl.po b/src/translations/gl.po index 71ecc317c..07e87e516 100644 --- a/src/translations/gl.po +++ b/src/translations/gl.po @@ -576,6 +576,11 @@ msgstr "" "Clementine non pode carregar ningunha visualización de projectM. Asegúrese " "que ten instalado Clementine adecuadamente." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2454,6 +2459,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/he.po b/src/translations/he.po index 606ee1071..be82587ff 100644 --- a/src/translations/he.po +++ b/src/translations/he.po @@ -578,6 +578,11 @@ msgstr "" "Clementine לא יכל לטעון אפקטים חזותיים של projectM. וודא שהתקנת את " "Clementine כמו שצריך." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "מציג התמונות של Clementine" @@ -2465,6 +2470,9 @@ msgstr "מיון" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/hi.po b/src/translations/hi.po index ad17979e7..bfe5eb664 100644 --- a/src/translations/hi.po +++ b/src/translations/hi.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/hr.po b/src/translations/hr.po index 943670db4..f86e8a898 100644 --- a/src/translations/hr.po +++ b/src/translations/hr.po @@ -587,6 +587,11 @@ msgstr "" "Clementine ne može učitati nijednu projektM vizualizaciju. Provjerite da li " "je Clementine instaliran ispravno." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine preglednik slika" @@ -2484,6 +2489,9 @@ msgstr "Sortiranje" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/hu.po b/src/translations/hu.po index 52caf274a..81c8ffbe9 100644 --- a/src/translations/hu.po +++ b/src/translations/hu.po @@ -586,6 +586,11 @@ msgstr "" "A Clementine egy projectM megjelenítést sem tud betölteni. Ellenőrizze, hogy " "megfelelően telepítette a Clementinet." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine képmegjelenítő" @@ -2490,6 +2495,9 @@ msgstr "Rendezés" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/hy.po b/src/translations/hy.po index 07440dac8..6d3fa15b4 100644 --- a/src/translations/hy.po +++ b/src/translations/hy.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/is.po b/src/translations/is.po index 2c4228135..dea472a37 100644 --- a/src/translations/is.po +++ b/src/translations/is.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/it.po b/src/translations/it.po index 71536b58a..75ec42583 100644 --- a/src/translations/it.po +++ b/src/translations/it.po @@ -591,6 +591,11 @@ msgstr "" "Clementine non può caricare alcuna visualizzazione projectM. Controlla che " "Clementine sia installato correttamente." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Visualizzatore immagini di Clementine" @@ -2498,6 +2503,9 @@ msgstr "Ordinamento" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/ja.po b/src/translations/ja.po index 1651d4716..337fbe1ca 100644 --- a/src/translations/ja.po +++ b/src/translations/ja.po @@ -578,6 +578,11 @@ msgstr "" "Clementine はいかなる projectM の視覚化も読み込むことができませんでした。" "Clementine が適切にインストールされているかチェックしてください。" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine イメージ ビューアー" @@ -2474,6 +2479,9 @@ msgstr "並べ替え" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/kk.po b/src/translations/kk.po index a91d9d8e7..e8a44e008 100644 --- a/src/translations/kk.po +++ b/src/translations/kk.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/lt.po b/src/translations/lt.po index 9469337e9..0b46c79aa 100644 --- a/src/translations/lt.po +++ b/src/translations/lt.po @@ -586,6 +586,11 @@ msgstr "" "Clementine negalėjo įkelti jokio projectM vaizdinio. Patikrinkite ar " "tinkamai įdiegėte Clementine." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine nuotraukų peržiūros programa" @@ -2484,6 +2489,9 @@ msgstr "Rikiavimas" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/lv.po b/src/translations/lv.po index e81f4030d..ddd033908 100644 --- a/src/translations/lv.po +++ b/src/translations/lv.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/ms.po b/src/translations/ms.po index d57441034..416ba26dc 100644 --- a/src/translations/ms.po +++ b/src/translations/ms.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/nb.po b/src/translations/nb.po index c7a035fd6..c18ba7c61 100644 --- a/src/translations/nb.po +++ b/src/translations/nb.po @@ -575,6 +575,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2457,6 +2462,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/nl.po b/src/translations/nl.po index 1d119c6c0..2eece80d9 100644 --- a/src/translations/nl.po +++ b/src/translations/nl.po @@ -590,6 +590,11 @@ msgstr "" "Clementine kon geen projectM visualisaties laden. Controleer of u " "Clementine correct hebt geïnstalleerd." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine image viewer" @@ -2495,6 +2500,9 @@ msgstr "Sorteren" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/oc.po b/src/translations/oc.po index 67f50bf20..978f5a17c 100644 --- a/src/translations/oc.po +++ b/src/translations/oc.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/pa.po b/src/translations/pa.po index 98553a3d6..320cf338c 100644 --- a/src/translations/pa.po +++ b/src/translations/pa.po @@ -568,6 +568,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2445,6 +2450,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/pl.po b/src/translations/pl.po index d256cd46f..7e550103f 100644 --- a/src/translations/pl.po +++ b/src/translations/pl.po @@ -586,6 +586,11 @@ msgstr "" "Clementine nie może wczytać wizualizacji. Sprawdź czy Clementine został " "zainstalowany prawidłowo." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Przeglądarka obrazów Clementine" @@ -2489,6 +2494,9 @@ msgstr "Sortowanie" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/pt.po b/src/translations/pt.po index 5fbb1764d..da729b8e7 100644 --- a/src/translations/pt.po +++ b/src/translations/pt.po @@ -590,6 +590,11 @@ msgstr "" "O Clementine não conseguiu carregar as visualizações projectM. Verifique se " "o Clementine foi bem instalado." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Visualizador de imagens do Clementine" @@ -2493,6 +2498,9 @@ msgstr "Organização" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/pt_BR.po b/src/translations/pt_BR.po index 3cc6e7f8b..2c7e86f3f 100644 --- a/src/translations/pt_BR.po +++ b/src/translations/pt_BR.po @@ -585,6 +585,11 @@ msgstr "" "O Clementine não conseguiu carregar nenhuma visualização do projectM. " "Verifique se você instalou o Clementine corretamente." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Visualizador de imagens do Clementine" @@ -2491,6 +2496,9 @@ msgstr "Organizando" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/ro.po b/src/translations/ro.po index a99feb1bc..d1c7b9e3e 100644 --- a/src/translations/ro.po +++ b/src/translations/ro.po @@ -586,6 +586,11 @@ msgstr "" "Clementine nu a putut încărca nici un projectM vizualizări. Verificaţi dacă " "aţi instalat corect Clementine." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Vizualizator de imagini Clementine" @@ -2484,6 +2489,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/ru.po b/src/translations/ru.po index 718914422..79468bbfd 100644 --- a/src/translations/ru.po +++ b/src/translations/ru.po @@ -584,6 +584,11 @@ msgstr "" "Clementine не может загрузить какою-либо визуализацию projectM. Проверьте, " "что установили Clementine правильно." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Просмотр изображений в Clementine" @@ -2484,6 +2489,9 @@ msgstr "Сортировать" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/sk.po b/src/translations/sk.po index d20a2bb26..80a9ee9ae 100644 --- a/src/translations/sk.po +++ b/src/translations/sk.po @@ -583,6 +583,11 @@ msgstr "" "Clementine nemôže načítať žiadnu projectM vizualizáciu. Skontrolujte, či " "máte Clementine nainštalovaný správne." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine prehliadač obrázkov" @@ -2480,6 +2485,9 @@ msgstr "Triedenie" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/sl.po b/src/translations/sl.po index 5890e11fa..d9d6d3aea 100644 --- a/src/translations/sl.po +++ b/src/translations/sl.po @@ -585,6 +585,11 @@ msgstr "" "Clementine ni mogel naložiti predočenj projectM. Preverite, če je Clementine " "pravilno nameščen." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Pregledovalnik datotek Clementine" @@ -2485,6 +2490,9 @@ msgstr "Razvrščanje" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/sr.po b/src/translations/sr.po index 1d569ef38..dff5f9216 100644 --- a/src/translations/sr.po +++ b/src/translations/sr.po @@ -570,6 +570,11 @@ msgstr "" "Клементина не може учитати пројекатМ визуализацију. Проверите да ли сте " "правилно инсталирали Клементину." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2453,6 +2458,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/sv.po b/src/translations/sv.po index 5c7a67033..569899d74 100644 --- a/src/translations/sv.po +++ b/src/translations/sv.po @@ -587,6 +587,11 @@ msgstr "" "Clementine kunde inte läsa in några projectM-visualiseringar. Kontrollera " "att du har installerat Clementine ordentligt." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine-bildvisare" @@ -2483,6 +2488,9 @@ msgstr "Sortering" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/tr.po b/src/translations/tr.po index 242539e40..f5f190074 100644 --- a/src/translations/tr.po +++ b/src/translations/tr.po @@ -582,6 +582,11 @@ msgstr "" "Clementine projectM görsellerini yükleyemedi. Clementine programını düzgün " "yüklediğinizi kontrol edin." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine resim görüntüleyici" @@ -2482,6 +2487,9 @@ msgstr "Dizim" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/translations.pot b/src/translations/translations.pot index 5e060a2d0..16fffc62b 100644 --- a/src/translations/translations.pot +++ b/src/translations/translations.pot @@ -558,6 +558,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2435,6 +2440,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/uk.po b/src/translations/uk.po index cbe91042f..e680813d0 100644 --- a/src/translations/uk.po +++ b/src/translations/uk.po @@ -585,6 +585,11 @@ msgstr "" "Clementine не вдалось завантажити візуалізації projectM. Перевірте чи ви " "правильно встановили Clementine." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Переглядач зображень Clementine" @@ -2481,6 +2486,9 @@ msgstr "Сортування" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/vi.po b/src/translations/vi.po index fb68ffc85..b339640f1 100644 --- a/src/translations/vi.po +++ b/src/translations/vi.po @@ -583,6 +583,11 @@ msgstr "" "Clementine không thể nạp hiệu ứng hình ảnh ảo projectM. XIn chắc rằng bạn đã " "cài đặt Clementine đúng cách." +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Bộ xem ảnh Clementine" @@ -2485,6 +2490,9 @@ msgstr "Sắp xếp" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/zh_CN.po b/src/translations/zh_CN.po index a900438c1..2e2266e99 100644 --- a/src/translations/zh_CN.po +++ b/src/translations/zh_CN.po @@ -570,6 +570,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "Clementine 图像查看器" @@ -2447,6 +2452,9 @@ msgstr "正在排序" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/translations/zh_TW.po b/src/translations/zh_TW.po index 3db5553c5..f32b8384d 100644 --- a/src/translations/zh_TW.po +++ b/src/translations/zh_TW.po @@ -572,6 +572,11 @@ msgid "" "installed Clementine properly." msgstr "" +msgid "" +"Clementine couldn't fetch your subscription status since there are problems " +"with your connection. Played tracks will be cached and sent later to Last.fm." +msgstr "" + msgid "Clementine image viewer" msgstr "" @@ -2449,6 +2454,9 @@ msgstr "" msgid "Speex" msgstr "" +msgid "Spotify" +msgstr "" + msgid "Standard" msgstr "" diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 4c5d3d2fc..eb4894a65 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -898,8 +898,9 @@ void MainWindow::SongChanged(const Song& song) { void MainWindow::TrackSkipped(PlaylistItemPtr item) { // If it was a library item then we have to increment its skipped count in // the database. - if (item && item->IsLocalLibraryItem() && - item->Metadata().id() != -1 && playlists_->active()->get_lastfm_status() != Playlist::LastFM_Scrobbled) { + if (item && item->IsLocalLibraryItem() && item->Metadata().id() != -1 && + playlists_->active()->get_lastfm_status() != Playlist::LastFM_Scrobbled && + playlists_->active()->get_lastfm_status() != Playlist::LastFM_Queued) { Song song = item->Metadata(); const qint64 position = player_->engine()->position_nanosec(); const qint64 length = player_->engine()->length_nanosec(); @@ -1083,7 +1084,7 @@ void MainWindow::UpdateTrackPosition() { if (position >= scrobble_point) { if (playlist->get_lastfm_status() == Playlist::LastFM_New) { #ifdef HAVE_LIBLASTFM - if (lastfm_service->IsScrobblingEnabled()) { + if (lastfm_service->IsScrobblingEnabled() && lastfm_service->IsAuthenticated()) { qLog(Info) << "Scrobbling at" << scrobble_point; lastfm_service->Scrobble(); } @@ -2186,6 +2187,12 @@ void MainWindow::ScrobblerStatus(int value) { ui_->action_toggle_scrobbling->setIcon(QIcon(":/last.fm/as.png")); break; + case 30: + // Hack: when offline, liblastfm doesn't inform us, so set the status + // as queued; in this way we won't try to scrobble again, it will be done automatically + playlists_->active()->set_lastfm_status(Playlist::LastFM_Queued); + break; + default: if (value > 3) { // we're for sure in an error state