mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #247] Fake track repeat #129
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#129
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 @sewnie on GitHub (Sep 7, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/247
Is your feature request related to a problem? Please describe.
I want to play a song on loop.
Describe the solution you'd like
(when using the local device) to fake repeat the track by re-playing it after it finishes when the loop on single track is enabled.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Currently, Librespot does not support looping a single track once.
@sewnie commented on GitHub (Dec 29, 2023):
I believe to make this possible, it would require a custom new 'playback' mode that is not available to Spotify API, as 'repeated once track' behavior is going to be inferred from spotify_player AFAIK.
@Colonial-Dev commented on GitHub (Apr 6, 2024):
For what it's worth,
ncspot(another Rust/librespotbased Spotify TUI client) seems to have figured out a hack, although what distinguishes it from this project isn't immediately obvious. I'll try and dig deeper if I can find the time.@aome510 commented on GitHub (Apr 6, 2024):
The main difference is that
ncspotitself is an Spotify client (for streaming), whilespotify_playeruses an integrated client from librespot. In other words, it's easier forncspotto implement the hack as they own the client implementation.@sewnie commented on GitHub (Apr 6, 2024):
Is it that difficult to just check if the user has 'repeat once' and just replay the song after it ends? Or am I underestimating how difficult it is?
@aome510 commented on GitHub (Apr 7, 2024):
spotify_playeroperates on API boundary and streaming client is just an "add-on" compared toncspotwith streaming client as the main component. As a result, the app cannot have any assumption regarding the streaming client's behaviour.The problem is that you don't know when user has 'repeat once'. The integrated streaming client will automatically switch to
repeat contextmode asrepeat onceis not supported. As a result, when you queryget-repeat-modeAPI, the returned mode will berepeat context.There are different ways to implement the "hack". The easiest one is to start a new "one-track" playback if user wants to change the repeat mode to
repeat once. The drawback of this approach is that you will lose the previous context, or you cannot play the previous context when switching to different repeat mode.Another approach is to add a separate
fake track repeatmode and a command to enable/disable the mode. The integrated client can be updated to queue the current song when it is about to end. I would prefer this approach as a workaround for the integrated client's limitation. Can start working on this when I'm free.@sewnie commented on GitHub (Apr 16, 2024):
YAYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
@aome510 commented on GitHub (Apr 16, 2024):
Implemented with #410. @apprehensions can you try the latest
master? The command isToggleFakeTrackRepeatModewith default bindingM-r(alt + r). Should seerepeat: track (fake)if the fake track repeat mode is enabled.@sewnie commented on GitHub (Apr 16, 2024):
It plays the 'fake repeat' track twice, and then plays the next song in queue, then the 'fake repeat' track again.
@aome510 commented on GitHub (Apr 16, 2024):
The timing between
EndOfTrackevents seems too short. Did you seek to the end of the track to test the feature? Thequeue the current song when it is about to endlogic only applies once every 10s to avoid making duplicated requests. That might be the reason why it doesn't work well@sewnie commented on GitHub (Apr 16, 2024):
No.. The song I was listening to was 9 seconds (that's grindcore for you, see track I'd) I am unable to test right now but given this I suppose it males sense.
@aome510 commented on GitHub (Apr 16, 2024):
ahh, super short song won't work with fake repeat mode unfortunately xD.