mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 05:15:49 +03:00
[GH-ISSUE #97] panic: invalid uri: when prefetching a track #67
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#67
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aykevl on GitHub (Sep 19, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/97
In some circumstances (not yet sure when this happens but it seems to have something to do with playing whole albums),
next.Uriis an empty string here:github.com/devgianlu/go-librespot@b95e6acdcc/cmd/daemon/controls.go (L25)This leads to a crash:
github.com/devgianlu/go-librespot@b95e6acdcc/ids.go (L110-L114)The
nextobject in this case looks like this:If you look into it, there's an album ID (
"entity_uri":"spotify:album:0tiOfqFu4d3UJ2r1LsoG3Z"), and something that looks like a track ID (Uid:"a1e0611f0a14df708f14"). So it looks like there's enough information to prefetch this track, but I'm not entirely sure how to implement it.(Interestingly this only happens while prefetching, perhaps the code that pulls the track ID when actually playing a track takes care of this case? In which case it would make sense to generalize that code and use it in both places).
@gregnebu commented on GitHub (Sep 20, 2024):
+1 I faced the same yesterday, and came to the same ccl. Unfortunately I'm not familiar enough with the code base to indeed suggest a good fix
@aykevl commented on GitHub (Sep 20, 2024):
I have a fix at #98, but have a hard time verifying whether it works as expected (since it happens so rarely). If you know how to reproduce the issue, you can put some logging in the
elsecase here to see whether it is triggered and whether it works correctly:@aykevl commented on GitHub (Oct 3, 2024):
#110 avoids the panic. It still won't prefetch, but that only means the next track will have a slight delay before it starts. That's much better than panicking.
I think it works well enough for now.