Use DbPlaylistItem base class for Jamendo and Magnatune
Moving these from LibraryPlaylistItem removes local file specific implementations of IsLocalLibraryItem and Reload. Returning true for IsLocalLibraryItem caused ratings to be set on unrelated library songs.
This commit is contained in:
parent
f563b7da40
commit
76a24a0a28
|
@ -20,12 +20,10 @@
|
|||
#include "jamendoplaylistitem.h"
|
||||
|
||||
JamendoPlaylistItem::JamendoPlaylistItem(const QString& type)
|
||||
: LibraryPlaylistItem(type) {}
|
||||
: DbPlaylistItem(type) {}
|
||||
|
||||
JamendoPlaylistItem::JamendoPlaylistItem(const Song& song)
|
||||
: LibraryPlaylistItem("Jamendo") {
|
||||
song_ = song;
|
||||
}
|
||||
: DbPlaylistItem("Jamendo", song) {}
|
||||
|
||||
bool JamendoPlaylistItem::InitFromQuery(const SqlRow& query) {
|
||||
// Rows from the songs tables come first
|
||||
|
@ -33,5 +31,3 @@ bool JamendoPlaylistItem::InitFromQuery(const SqlRow& query) {
|
|||
|
||||
return song_.is_valid();
|
||||
}
|
||||
|
||||
QUrl JamendoPlaylistItem::Url() const { return song_.url(); }
|
||||
|
|
|
@ -20,16 +20,14 @@
|
|||
#ifndef INTERNET_JAMENDO_JAMENDOPLAYLISTITEM_H_
|
||||
#define INTERNET_JAMENDO_JAMENDOPLAYLISTITEM_H_
|
||||
|
||||
#include "library/libraryplaylistitem.h"
|
||||
#include "playlist/dbplaylistitem.h"
|
||||
|
||||
class JamendoPlaylistItem : public LibraryPlaylistItem {
|
||||
class JamendoPlaylistItem : public DbPlaylistItem {
|
||||
public:
|
||||
explicit JamendoPlaylistItem(const QString& type);
|
||||
explicit JamendoPlaylistItem(const Song& song);
|
||||
|
||||
bool InitFromQuery(const SqlRow& query);
|
||||
|
||||
QUrl Url() const;
|
||||
};
|
||||
|
||||
#endif // INTERNET_JAMENDO_JAMENDOPLAYLISTITEM_H_
|
||||
|
|
|
@ -21,12 +21,10 @@
|
|||
#include "internet/core/internetmodel.h"
|
||||
|
||||
MagnatunePlaylistItem::MagnatunePlaylistItem(const QString& type)
|
||||
: LibraryPlaylistItem(type) {}
|
||||
: DbPlaylistItem(type) {}
|
||||
|
||||
MagnatunePlaylistItem::MagnatunePlaylistItem(const Song& song)
|
||||
: LibraryPlaylistItem("Magnatune") {
|
||||
song_ = song;
|
||||
}
|
||||
: DbPlaylistItem("Magnatune", song) {}
|
||||
|
||||
bool MagnatunePlaylistItem::InitFromQuery(const SqlRow& query) {
|
||||
// Rows from the songs tables come first
|
||||
|
@ -34,5 +32,3 @@ bool MagnatunePlaylistItem::InitFromQuery(const SqlRow& query) {
|
|||
|
||||
return song_.is_valid();
|
||||
}
|
||||
|
||||
QUrl MagnatunePlaylistItem::Url() const { return song_.url(); }
|
||||
|
|
|
@ -20,16 +20,14 @@
|
|||
#ifndef INTERNET_MAGNATUNE_MAGNATUNEPLAYLISTITEM_H_
|
||||
#define INTERNET_MAGNATUNE_MAGNATUNEPLAYLISTITEM_H_
|
||||
|
||||
#include "library/libraryplaylistitem.h"
|
||||
#include "playlist/dbplaylistitem.h"
|
||||
|
||||
class MagnatunePlaylistItem : public LibraryPlaylistItem {
|
||||
class MagnatunePlaylistItem : public DbPlaylistItem {
|
||||
public:
|
||||
explicit MagnatunePlaylistItem(const QString& type);
|
||||
explicit MagnatunePlaylistItem(const Song& song);
|
||||
|
||||
bool InitFromQuery(const SqlRow& query);
|
||||
|
||||
QUrl Url() const;
|
||||
};
|
||||
|
||||
#endif // INTERNET_MAGNATUNE_MAGNATUNEPLAYLISTITEM_H_
|
||||
|
|
Loading…
Reference in New Issue