From bf74e4a78f01814361cb2b296944bce8666aecb6 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Thu, 17 Jul 2014 16:13:20 +0000 Subject: [PATCH] Fix grouping of local and non-local podcasts in playqueue --- http/httpserver.cpp | 10 ++++++++++ mpd/song.cpp | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/http/httpserver.cpp b/http/httpserver.cpp index 4a58b5efd..e75f9835a 100644 --- a/http/httpserver.cpp +++ b/http/httpserver.cpp @@ -187,6 +187,11 @@ QByteArray HttpServer::encodeUrl(const Song &s) if (s.track) { query.addQueryItem("track", QString::number(s.track)); } + #ifdef ENABLE_ONLINE_SERVICES + if (s.isFromOnlineService()) { + query.addQueryItem("onlineservice", s.onlineService()); + } + #endif query.addQueryItem("id", QString::number(s.id)); query.addQueryItem("cantata", "song"); #if QT_VERSION >= 0x050000 @@ -278,6 +283,11 @@ Song HttpServer::decodeUrl(const QUrl &url) const if (q.hasQueryItem("id")) { s.id=q.queryItemValue("id").toInt(); } + #ifdef ENABLE_ONLINE_SERVICES + if (q.hasQueryItem("onlineservice")) { + s.setIsFromOnlineService(q.queryItemValue("onlineservice")); + } + #endif s.file=url.path(); s.type=Song::CantataStream; #ifdef Q_OS_WIN diff --git a/mpd/song.cpp b/mpd/song.cpp index aeafb0f96..12d7fc89b 100644 --- a/mpd/song.cpp +++ b/mpd/song.cpp @@ -477,7 +477,7 @@ QString Song::artistSong() const QString Song::trackAndTitleStr(bool showArtistIfDifferent) const { #if !defined CANTATA_NO_UI_FUNCTIONS && defined ENABLE_ONLINE_SERVICES - if (OnlineSvrTrack==type && OnlineService::showLogoAsCover(*this)) { + if ((OnlineSvrTrack==type || Song::CantataStream) && OnlineService::showLogoAsCover(*this)) { return artistSong(); } #endif @@ -626,7 +626,7 @@ bool Song::capitalise() QString Song::albumKey() const { #if !defined CANTATA_NO_UI_FUNCTIONS && defined ENABLE_ONLINE_SERVICES - if (OnlineSvrTrack==type && OnlineService::showLogoAsCover(*this)) { + if ((OnlineSvrTrack==type || Song::CantataStream) && OnlineService::showLogoAsCover(*this)) { return onlineService(); } #endif