1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 03:09:57 +01:00

Make temporary metadata work for SongPlaylistItems too. Fixes issue #487

This commit is contained in:
David Sansome 2010-07-10 19:40:16 +00:00
parent d8cc037446
commit d8cce6a343
2 changed files with 19 additions and 1 deletions

View File

@ -78,3 +78,18 @@ QUrl SongPlaylistItem::Url() const {
void SongPlaylistItem::Reload() {
song_.InitFromFile(song_.filename(), song_.directory_id());
}
Song SongPlaylistItem::Metadata() const {
if (temp_metadata_.is_valid())
return temp_metadata_;
return song_;
}
void SongPlaylistItem::SetTemporaryMetadata(const Song& metadata) {
temp_metadata_ = metadata;
temp_metadata_.set_filetype(Song::Type_Stream);
}
void SongPlaylistItem::ClearTemporaryMetadata() {
temp_metadata_ = Song();
}

View File

@ -28,7 +28,9 @@ class SongPlaylistItem : public PlaylistItem {
bool InitFromQuery(const QSqlQuery &query);
void Reload();
Song Metadata() const { return song_; }
Song Metadata() const;
void SetTemporaryMetadata(const Song &metadata);
void ClearTemporaryMetadata();
QUrl Url() const;
@ -37,6 +39,7 @@ class SongPlaylistItem : public PlaylistItem {
private:
Song song_;
Song temp_metadata_;
};
#endif // SONGPLAYLISTITEM_H