- fix lastfm scrobbling on disabled apps
This commit is contained in:
parent
fa29020cea
commit
7d4bc6dd89
16
src/main.cpp
16
src/main.cpp
|
@ -93,14 +93,6 @@ void handleMediaTasks() {
|
||||||
if (shouldContinue)
|
if (shouldContinue)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (lastPlayingSong.find(mediaInformation->songTitle + mediaInformation->songArtist +
|
|
||||||
mediaInformation->songAlbum) == std::string::npos &&
|
|
||||||
lastfm)
|
|
||||||
lastfm->scrobble(mediaInformation->songArtist, mediaInformation->songTitle);
|
|
||||||
|
|
||||||
lastPlayingSong = currentlyPlayingSong;
|
|
||||||
currentSongTitle = mediaInformation->songArtist + " - " + mediaInformation->songTitle;
|
|
||||||
|
|
||||||
std::string currentMediaSource = mediaInformation->playbackSource;
|
std::string currentMediaSource = mediaInformation->playbackSource;
|
||||||
|
|
||||||
if (currentMediaSource != lastMediaSource) {
|
if (currentMediaSource != lastMediaSource) {
|
||||||
|
@ -110,6 +102,14 @@ void handleMediaTasks() {
|
||||||
|
|
||||||
auto app = utils::getApp(lastMediaSource);
|
auto app = utils::getApp(lastMediaSource);
|
||||||
|
|
||||||
|
if (lastPlayingSong.find(mediaInformation->songTitle + mediaInformation->songArtist +
|
||||||
|
mediaInformation->songAlbum) == std::string::npos &&
|
||||||
|
lastfm && app.enabled)
|
||||||
|
lastfm->scrobble(mediaInformation->songArtist, mediaInformation->songTitle);
|
||||||
|
|
||||||
|
lastPlayingSong = currentlyPlayingSong;
|
||||||
|
currentSongTitle = mediaInformation->songArtist + " - " + mediaInformation->songTitle;
|
||||||
|
|
||||||
if (!app.enabled) {
|
if (!app.enabled) {
|
||||||
Discord_ClearPresence();
|
Discord_ClearPresence();
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue