Strip misc from song title when sending now playing

This commit is contained in:
Jonas Kvinge
2021-05-01 18:19:08 +02:00
parent 2625d72818
commit 2b15dae806
2 changed files with 8 additions and 2 deletions

View File

@@ -469,13 +469,16 @@ void ScrobblingAPI20::UpdateNowPlaying(const Song &song) {
if (!IsAuthenticated() || !song.is_metadata_good() || app_->scrobbler()->IsOffline()) return;
QString album = song.album();
QString title = song.title();
album = album.remove(Song::kAlbumRemoveDisc);
album = album.remove(Song::kAlbumRemoveMisc);
title = title.remove(Song::kTitleRemoveMisc);
ParamList params = ParamList()
<< Param("method", "track.updateNowPlaying")
<< Param("artist", prefer_albumartist_ && song.effective_albumartist() != Song::kVariousArtists ? song.effective_albumartist() : song.artist())
<< Param("track", song.title());
<< Param("track", title);
if (!album.isEmpty())
params << Param("album", album);