Fix soundcloud and podcast grouping in playqueue
This commit is contained in:
18
mpd/song.cpp
18
mpd/song.cpp
@@ -29,6 +29,9 @@
|
||||
#include "song.h"
|
||||
#include "models/musiclibraryitemalbum.h"
|
||||
#include "support/localize.h"
|
||||
#if !defined CANTATA_NO_UI_FUNCTIONS && defined ENABLE_ONLINE_SERVICES
|
||||
#include "online/onlineservice.h"
|
||||
#endif
|
||||
#include <QStringList>
|
||||
#include <QSet>
|
||||
#include <QChar>
|
||||
@@ -473,6 +476,11 @@ 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)) {
|
||||
return artistSong();
|
||||
}
|
||||
#endif
|
||||
// if (isFromOnlineService()) {
|
||||
// return (disc>0 && disc!=constOnlineDiscId ? (QString::number(disc)+QLatin1Char('.')) : QString())+
|
||||
// (track>0 ? (track>9 ? QString::number(track) : (QLatin1Char('0')+QString::number(track))) : QString())+
|
||||
@@ -615,6 +623,16 @@ bool Song::capitalise()
|
||||
return artist!=origArtist || albumartist!=origAlbumArtist || album!=origAlbum || title!=origTitle;
|
||||
}
|
||||
|
||||
QString Song::albumKey() const
|
||||
{
|
||||
#if !defined CANTATA_NO_UI_FUNCTIONS && defined ENABLE_ONLINE_SERVICES
|
||||
if (OnlineSvrTrack==type && OnlineService::showLogoAsCover(*this)) {
|
||||
return onlineService();
|
||||
}
|
||||
#endif
|
||||
return albumArtist()+QLatin1Char(':')+albumId()+QLatin1Char(':')+QString::number(disc);
|
||||
}
|
||||
|
||||
QString Song::basicArtist() const
|
||||
{
|
||||
if (!albumartist.isEmpty() && (artist.isEmpty() || albumartist==artist || (albumartist.length()<artist.length() && artist.startsWith(albumartist)))) {
|
||||
|
||||
@@ -159,7 +159,7 @@ struct Song
|
||||
bool isNonMPD() const { return isStream() || OnlineSvrTrack==type || Cdda==type || (!file.isEmpty() && file.startsWith(Utils::constDirSep)); }
|
||||
bool isCantataStream() const { return CantataStream==type; }
|
||||
bool isCdda() const { return Cdda==type; }
|
||||
QString albumKey() const { return albumArtist()+QLatin1Char(':')+albumId()+QLatin1Char(':')+QString::number(disc); }
|
||||
QString albumKey() const;
|
||||
bool isCueFile() const { return Playlist==type && file.endsWith(QLatin1String(".cue"), Qt::CaseInsensitive); }
|
||||
QString basicArtist() const;
|
||||
QString filePath() const { return decodePath(file); }
|
||||
|
||||
@@ -105,6 +105,7 @@ Song PodcastService::fixPath(const Song &orig, bool) const
|
||||
Song song=orig;
|
||||
song.setPodcastLocalPath(QString());
|
||||
song.setIsFromOnlineService(constName);
|
||||
song.album=constName;
|
||||
if (!orig.podcastLocalPath().isEmpty() && QFile::exists(orig.podcastLocalPath())) {
|
||||
if (!HttpServer::self()->forceUsage() && MPDConnection::self()->getDetails().isLocal()) {
|
||||
song.file=QLatin1String("file://")+orig.podcastLocalPath();
|
||||
|
||||
@@ -53,6 +53,7 @@ Song SoundCloudService::fixPath(const Song &orig, bool) const
|
||||
{
|
||||
Song s(orig);
|
||||
s.setIsFromOnlineService(constName);
|
||||
s.album=constName;
|
||||
return encode(s);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user