MarshallOfSound / Google-Play-Music-Desktop-Player-UNOFFICIAL-

A beautiful cross platform Desktop Player for Google Play Music
https://www.googleplaymusicdesktopplayer.com
MIT License
8.27k stars 767 forks source link

JSON API doesn't set stopped state #3108

Open hexadecatrienoic opened 6 years ago

hexadecatrienoic commented 6 years ago

OS: Arch 4.16.5-1

GPMDP Version: 4.5.0-2

Issue Descriptions: The only time the stopped state is produced is when the application is first opened. After playing anything, the stopped state won't return until the app is restarted.

Steps to Reproduce:

  1. Open gpmdp.
  2. Run jq '.' $HOME/.config/Google Play Music Desktop Player/json_store/playback.json.
    {
    "playing": false,
    "song": {
    "title": null,
    "artist": null,
    "album": null,
    "albumArt": null
    },
    "rating": {
    "liked": false,
    "disliked": false
    },
    "time": {
    "current": 0,
    "total": 0
    },
    "songLyrics": null,
    "shuffle": "NO_SHUFFLE",
    "repeat": "NO_REPEAT",
    "volume": 100
    }
  3. Play a song/album/whatever. Pause the music and clear the queue.
  4. Run jq '.' $HOME/.config/Google Play Music Desktop Player/json_store/playback.json.
    {
    "playing": false,
    "song": {
    "title": "Ladykiller",
    "artist": "Alice In Videoland",
    "album": "Outrageous",
    "albumArt": "https://lh6.ggpht.com/csl4CxdJCT26rDUBcKVvVOn_KBCBSqEKujiPhO6TVgz_7K0bI-8cz_AJc4s_P83_f1A2aqv_LA"
    },
    "rating": {
    "liked": false,
    "disliked": false
    },
    "time": {
    "current": 0,
    "total": 139000
    },
    "songLyrics": "Your brand new car don't do it for me\nIt don't turn me on\nI'm not impressed by your daddys gold card\nOr how fast you run\nI just can't stand the smell of your low price aftershave\n\nDon't you think you're overdoing it a bit\nWhen I can smell it a mile away\n\nHey hey\nHey man, right on\nYou make me so hot, not!\nHey man, you got it\nYou're really turning me
    on,\nDamn wrong!\nHey man, not over my\nNot over my dead body baby\nHey man, not over my\nNot over my dead body baby\n\n\nYour
    pick up lines isn't working on me\nI'm not in the mood\nI'm not amused by the story of your life\nOr your attitude\nYou white trash brat with back slicked hair\nIs not my cup of tea\n\nYou must be feeling really good about yourself\nBut you will never feel your way with me\n\nHey hey\nHey man, right on\nYou make me so hot, NOT!\nHey man, you got it\nYou're really turning me on,\nDamn wrong!\nHey man, not over my\nNot over my dead body baby\nHey man, not over my\nNot over my dead body baby",
    "shuffle": "NO_SHUFFLE",
    "repeat": "NO_REPEAT",
    "volume": 100
    }
jostrander commented 6 years ago

This needs to be fixed in the upstream library gmusic-js.

nanohard commented 5 years ago

I'm using it right now and it seems to be working.

hexadecatrienoic commented 5 years ago

Do you get the stopped state after the last song in the queue finishes? What platform are you on?

nanohard commented 5 years ago

Arch Linux. I have both of the API options checked, though I know they're for different things. I used it for a Twitch chat bot as recently as today to see if the player is either stopped or playing. I can't comment as to whether the state will change at the end of a queue, as I only use the Radio so it never stops when it's on. But when it is playing it does say so, and it says if it's stopped. Might be an issue with setting the state at the end of a queue, if that's the problem you're having.

I only look for playing though. If I recall correctly, the last played song info is still there.