Playcount Sync not working with Gonic

Issue description:

The playcounts work fine when the device is offline but as soon as it connects to WiFi and syncs, the playcounts vanish.

I managed to get a log, I hope its helpful.

Logs:

Upload description: prone-to-drift playcount

Additional information:

 This was the request made by Symfonium.:

2024/01/19 00:49:10 response  200  GET /scrobble?id=tr-793&submission=false&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json

The log since connecting to Wifi and then pressing the sync button as well:

2024/01/19 00:49:04 response  200  GET /deleteBookmark?id=tr-801&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json                                                                 
2024/01/19 00:49:04 response  200  GET /search3?query=%22%22&songOffset=1069&songCount=10&albumOffset=0&albumCount=0&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=
Symfonium&f=json                                                                                                                                                                                                                            
2024/01/19 00:49:10 response  200  GET /scrobble?id=tr-793&submission=false&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json                                                      
2024/01/19 00:49:12 response  200  GET /ping?u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json                                                                                     
2024/01/19 00:49:16 response  200  GET /getStarred2?u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json                                                                              
2024/01/19 00:49:16 response  200  GET /getBookmarks?u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json                                                                             
2024/01/19 00:49:16 response  200  GET /getGenres?u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json                                                                                
2024/01/19 00:49:16 response  200  GET /getMusicFolders?u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json                                                                          
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=0&songOffset=0&songCount=0&albumOffset=0&albumCount=0&artistOffset=0&artistCount=500&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json                                                                                                                                                                                                              
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=0&songOffset=0&songCount=0&albumOffset=0&albumCount=0&artistOffset=5&artistCount=500&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json                                                                                                                                                                                                              
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=1&songOffset=0&songCount=0&albumOffset=0&albumCount=0&artistOffset=0&artistCount=500&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json                                                                                                                                                                                                              
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=1&songOffset=0&songCount=0&albumOffset=0&albumCount=0&artistOffset=5&artistCount=500&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json                                                                                                                                                                                                              
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=2&songOffset=0&songCount=0&albumOffset=0&albumCount=0&artistOffset=0&artistCount=500&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json                                                                                                                                                                                                              
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=2&songOffset=0&songCount=0&albumOffset=0&albumCount=0&artistOffset=5&artistCount=500&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json                                                                                                                                                                                                              
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=0&songOffset=0&songCount=0&albumOffset=0&albumCount=500&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=0&songOffset=0&songCount=0&albumOffset=23&albumCount=500&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=1&songOffset=0&songCount=0&albumOffset=0&albumCount=500&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=1&songOffset=0&songCount=0&albumOffset=41&albumCount=500&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=2&songOffset=0&songCount=0&albumOffset=0&albumCount=500&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=2&songOffset=0&songCount=0&albumOffset=51&albumCount=500&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5
075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=0&songOffset=0&songCount=500&albumOffset=0&albumCount=0&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:16 response  200  GET /search3?query=%22%22&musicFolderId=0&songOffset=223&songCount=500&albumOffset=0&albumCount=0&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C
5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:17 response  200  GET /search3?query=%22%22&musicFolderId=1&songOffset=0&songCount=500&albumOffset=0&albumCount=0&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:17 response  200  GET /search3?query=%22%22&musicFolderId=1&songOffset=465&songCount=500&albumOffset=0&albumCount=0&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C
5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:17 response  200  GET /search3?query=%22%22&musicFolderId=2&songOffset=0&songCount=500&albumOffset=0&albumCount=0&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C50
75&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:17 response  200  GET /search3?query=%22%22&musicFolderId=2&songOffset=382&songCount=500&albumOffset=0&albumCount=0&artistOffset=0&artistCount=0&u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C
5075&v=1.13.0&c=Symfonium&f=json
2024/01/19 00:49:17 response  200  GET /getPlaylists?u=rohitt&t=4df16dc096b5469c38a70a780e9b26f2&s=93F301E96CB683E18E8C8059564C5075&v=1.13.0&c=Symfonium&f=json
``` 

## Reproduction steps:
 Not provided 

## Media provider:

Subsonic

## Screenshots:
     

The sync is about submission=true not false.

Sorry, I don’t know what that means. That was the first and only /scrobble request the app made immediately after I connected to wifi.

I see what you mean about submission=false. I searched for more and found one submission=true entry at 12:49:04 local time for id=tr-801. Could that be it?

The logs shows

00:49:03.708 P:Verbose T:SubsonicLogger 
--> [573] GET http://gonic.fedora.home/rest/scrobble.view?id=tr-801&submission=true&u=REDACTED&t=REDACTED&s=REDACTED&v=1.13.0&c=Symfonium&f=json
00:49:03.719 P:Verbose T:SubsonicLogger 
<-- [573] {"subsonic-response":{"status":"ok","version":"1.15.0","type":"gonic","serverVersion":"0.16.2","openSubsonic":true}}

So Symfonium send the playcount Gonic says OK

Then the sync start and there’s no playcount returned by Gonic

{
          "id": "tr-801",
          "album": "Codes and Keys",
          "albumId": "al-122",
          "artist": "Death Cab for Cutie",
          "artistId": "ar-71",
          "artists": [
            {
              "id": "ar-71",
              "name": "Death Cab for Cutie"
            }
          ],
          "displayArtist": "Death Cab for Cutie",
          "albumArtists": [
            {
              "id": "ar-71",
              "name": "Death Cab for Cutie"
            }
          ],
          "displayAlbumArtist": "Death Cab for Cutie",
          "bitRate": 670,
          "contentType": "audio/flac",
          "coverArt": "al-122",
          "created": "2024-01-18T21:53:54.896180204+05:30",
          "duration": 369,
          "genre": "Indie",
          "genres": [
            {
              "name": "Indie"
            }
          ],
          "isDir": false,
          "isVideo": false,
          "parent": "al-122",
          "path": "Death Cab for Cutie/Codes and Keys/Death Cab for Cutie - 06 Unobstructed Views.flac",
          "size": 31209408,
          "suffix": "flac",
          "title": "Unobstructed Views",
          "track": 6,
          "discNumber": 1,
          "type": "music",
          "year": 2011
        },

So this is to report to Gonic.

Ah damnit! There’s literally no playcount in the returned data. I’ll file a bug report and move back to Navidrome? Or… I mean, I’m confused. Thanks for debugging though. :confused:

I bet you’re rethinking recommending Gonic to me yesterday haha.

Well Gonic is for the moment the best for multiple source folders, but yes it have some design “issues/choices” around artists / transcoding.

@sentriz usually fix bugs when they are reported, we just diverge on some specific stuff :wink:

That’s good to know! did file this as Gonic doesn't handle playcounts properly · Issue #458 · sentriz/gonic · GitHub. Can we keep this thread open for testing when this is fixed in gomic?

FWIW @sentriz I’m happy to test out any dev branch etc if you don’t want to install your own Symfonium for testing. :slight_smile:

ah i didn’t know there was an album.playCount. added it to the response. re transcoding, we need a way for clients to ask servers what the available formats are. then i think gonic could be more in line with other servers. i may propose that later

Thanks a ton for the fix <3

1 Like

Hum this is songs here from search3.

For transcoding the issue is more about ignoring the params than anything else.

You can keep your way to force server side until a proper transcoding API. But you really really should not ignore the max bitrate and return an error. The impact on users who pay for BW is way too high.

It’s better to deal with a user angry that there’s an error than an user that receive a 300$ bill.

1 Like

Amen. Explicit failure over implicit silent failure, always. Personally, I didn’t realize that I needed to set this option serverside, per client. I only realized something was wrong when I saw the downloads’ size cause the system just failed me silently.

If the failure was explicit, I;d have searched and found the setting earlier and wouldn’t have to redownload everything.

That would be a great stopgap IMO till the protocol catches up?

1 Like

oh! i didn’t know it was songs! that’s unfortunate. gonic only stores album level plays.
that was the minimum schema required for the album ?type=frequent, and ?type=recent

is song.playCount a recent thing? maybe it’s enough to copy the album playconut to the song playcount?


re transcoding: yes I agree, ill see about throwing an error, or maybe configuring a default format that works with most players

Songs playcount is old and all servers I know store them.

It’s better to not expose wrong values, I can add a special case for Gonic until you eventually support them correctly.

thanks. what does symfonium do with song level playcounts?

Many things, like optimized mixes taking in account song playcounts, smart filters and playlists., …

And I know you only like albums but many people are different.

Lastplayed per song is also important but new to OS.

1 Like

Ok so next release will keep local data during sync if the Subsonic provider does not return the playcount field.

1 Like