Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redesign: Can't start playback from Songs tab in offline mode #554

Closed
rom4nik opened this issue Dec 9, 2023 · 4 comments
Closed

redesign: Can't start playback from Songs tab in offline mode #554

rom4nik opened this issue Dec 9, 2023 · 4 comments
Labels
redesign-beta Issues related to the beta/redsigned version of Finamp

Comments

@rom4nik
Copy link
Contributor

rom4nik commented Dec 9, 2023

Steps to reproduce (as of 89fec62):

  1. Download an album
  2. Enable offline mode
  3. Go to songs tab
  4. Click on a song
  5. Playback doesn't start

Logs:

I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.142363: 
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.142759: --> GET https://example.com/Items/[song1itemid]/InstantMix?userId=[userid]&limit=200
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.142903: Content-Type: application/json
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.143022: X-Emby-Authorization: MediaBrowser UserId="[userid]", Client="Finamp", Device="Pixel 3", DeviceId="[deviceid]", Version="0.6.15"
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.143146: X-Emby-Token: [token]
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.143278: content-length: 0
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.143424: --> END GET
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.495575: 
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.495956: <-- 200 OK GET https://example.com/Items/[song1itemid]/InstantMix?userId=[userid]&limit=200
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496125: x-response-time-ms: 87
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496247: content-type: application/json; charset=utf-8
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496355: transfer-encoding: chunked
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496470: date: Sat, 09 Dec 2023 19:07:37 GMT
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496573: strict-transport-security: max-age=16000000; includeSubDomains; always
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496703: server: Kestrel
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496824: content-length: 297177
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.496942: 
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.497054: {"Items":[{"Name":"Dandelion (Pandapush Remix)","ServerId":"[serverid]","Id":"[song1itemid]","PremiereDate":"2021-03-19T00:00:00.0000000Z","ChannelId":null,"RunTimeTicks":1433719680,"ProductionYear":2021,"IndexNumber":2,"ParentIndexNumber":1,"IsFolder":false,"Type":"Audio","ParentLogoItemId":"[artist1itemid]","ParentBackdropItemId":"[artist1itemid]","ParentBackdropImageTags":["[someotherid]"],"UserData":{"PlaybackPositionTicks":0,"PlayCount":17,"IsFavorite":false,"LastPlayedDate":"2023-12-01T13:17:24.0042489Z","Played":true,"Key":"Galantis-Dandelion (Remixes)-0001-0002Dandelion (Pandapush Remix)"},"Artists":["Galantis","Jvke"],"ArtistItems":[{"Name":"Galantis","Id":"[artist1itemid]"},{"Name":"Jvke","Id":"[artist2itemid]"}],"Album":"Dandelion (Remixes)","AlbumId":"[albumitemid]","AlbumPrimaryImageTag":"[sometruncatedid]
I/flutter (26426): [Chopper/INFO] 2023-12-09 20:07:37.505857: <-- END HTTP
I/flutter (26426): [DownloadsHelper/INFO] 2023-12-09 20:07:37.519543: Song [song1itemid] exists offline, using local file, title: Dandelion (Pandapush Remix)
I/flutter (26426): [DownloadsHelper/INFO] 2023-12-09 20:07:37.546731: Song [song2itemid] exists offline, using local file, title: Dandelion (Carneyval Remix)
I/flutter (26426): [MusicPlayerBackgroundTask/INFO] 2023-12-09 20:07:37.561139: Stopping audio service
I/flutter (26426): [QueueService/SEVERE] 2023-12-09 20:07:37.564575: Offline mode enabled but downloaded song not found. title: Shimmer (Feat. Christian Burns)
I/flutter (26426): [AudioServiceHelper/SEVERE] 2023-12-09 20:07:37.564901: Offline mode enabled but downloaded song not found. title: Shimmer (Feat. Christian Burns)
E/flutter (26426): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Offline mode enabled but downloaded song not found. title: Shimmer (Feat. Christian Burns)
E/flutter (26426): 

I've redacted the logs a bit, and edited code to include song titles in the errors.

  • there are 3 songs downloaded, all from the same 1 album (Dandelion (Remixes))
  • song1 is Dandelion (Pandapush Remix), which I clicked on
  • song2 is another song from the album - Dandelion (Carneyval Remix)
  • Shimmer (Feat. Christian Burns) is a song from another album, which hasn't been downloaded, and its ID likely was received as part of the Instant Mix requested from server.

This issue is probably a regression from #484, see https://github.com/jmshrv/finamp/pull/484/files#diff-8ce322217fed731e5c785038127677c3268344f05cc74b0af807c8534c4b0b37R209 - instead of playing just one song, there's a request for Instant Mix (nice feature btw). From observing how this works in online mode, I guess that for a split second another song is put on top of queue, and then the order is corrected, and the originally clicked song plays?

@Chaphasilor
Copy link
Collaborator

Good catch. Yeah it's trying to play an instant mix, I didn't really test much with offline mode. The instant mix is a server-side feature that already has the source song as the first item, so there's no reordering going on, we're taking the order straight from the server.
I got a proof of concept for simply playing a single song (like before the regression), but because it's offline mode we could actually load up all songs and play the tracks in-order. What do you think?

@rom4nik
Copy link
Contributor Author

rom4nik commented Dec 11, 2023

It might be a little weird at first glance that playing in order is available only in offline mode, but I have no preference here, at least it would partially help with #502.

@Chaphasilor
Copy link
Collaborator

Yeah in the context of #502 I think we should just get full song list playback whereever possible...

@Chaphasilor Chaphasilor moved this to In Progress in Finamp Redesign Jan 25, 2024
@Chaphasilor Chaphasilor moved this from In Progress to Todo in Finamp Redesign Jan 25, 2024
@Chaphasilor Chaphasilor moved this from Todo to Done in Finamp Redesign Feb 12, 2024
@Chaphasilor Chaphasilor moved this from Done to In Progress in Finamp Redesign Feb 12, 2024
@Chaphasilor
Copy link
Collaborator

Okay, in offline mode all tracks will now be loaded into the queue in-order, with the selected track being sandwiched somewhere in-between and selected as the current track.
Hopefully I can emulate this in online mode soon.

@Chaphasilor Chaphasilor moved this from In Progress to Done in Finamp Redesign Apr 8, 2024
@Chaphasilor Chaphasilor added the redesign-beta Issues related to the beta/redsigned version of Finamp label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redesign-beta Issues related to the beta/redsigned version of Finamp
Projects
Status: Done
Development

No branches or pull requests

2 participants