Make scrobbler handle streams

This commit is contained in:
Jonas Kvinge
2020-04-25 00:07:42 +02:00
parent 5ba00b61be
commit 4abc650edf
12 changed files with 94 additions and 28 deletions

View File

@@ -611,7 +611,6 @@ void Playlist::set_current_row(int i, bool is_stopping) {
if (current_item_index_ == old_current_item_index) {
UpdateScrobblePoint();
nowplaying_ = false;
return;
}
@@ -649,7 +648,6 @@ void Playlist::set_current_row(int i, bool is_stopping) {
}
UpdateScrobblePoint();
nowplaying_ = false;
}
@@ -1503,7 +1501,7 @@ void Playlist::SetStreamMetadata(const QUrl &url, const Song &song, const bool m
//qLog(Debug) << "Setting temporary metadata for" << url;
bool length_changed = song.length_nanosec() != current_item_metadata().length_nanosec();
bool update_scrobble_point = song.length_nanosec() != current_item_metadata().length_nanosec();
current_item()->SetTemporaryMetadata(song);
@@ -1518,10 +1516,11 @@ void Playlist::SetStreamMetadata(const QUrl &url, const Song &song, const bool m
}
}
else {
update_scrobble_point = true;
InformOfCurrentSongChange();
}
if (length_changed) UpdateScrobblePoint();
if (update_scrobble_point) UpdateScrobblePoint();
}
@@ -2022,6 +2021,7 @@ void Playlist::UpdateScrobblePoint(const qint64 seek_point_nanosec) {
}
}
nowplaying_ = false;
scrobbled_ = false;
}