librespot-org / librespot

Open Source Spotify client library
MIT License
4.48k stars 542 forks source link

Draft: RFC supporting single track repeat #1219

Open sarjann opened 8 months ago

sarjann commented 8 months ago

Thinking of tackling the issue of single-track repeat not being supported.

Note I'm not planning on merging this branch as is as it's broken / logic / ugly doesn't work and doesn't implement the changes I'm discussing. This is more just to describe what I want to do.

I'm thinking of doing it in a similar way to that shown here if we want backward compatibility. i.e creating a separate field for repeat_one and handling the logic for that separately.

Or what I'd prefer to do is to make repeat an enum with something like Repeat::Track, Repeat::All, Repeat::Off although I'm pretty sure this will break backwards compatibility. Although I guess I could store it this way in the state but the messages/interface the end user sends can treat it as two different events and what's returned is repeat=true,repeat_one=false seperately for example, preserving backwards compatibility.

I'm new to this project, so sorry if I'm missing something or saying something stupid. Just wanted some feedback before going deeper. Thanks.

Related Issue: https://github.com/librespot-org/librespot/issues/19

roderickvd commented 7 months ago

Converting to draft to emphasise what you're saying.

The cause of "repeat track" not working is described here: https://github.com/librespot-org/librespot/issues/19#issuecomment-1263968137. Best development time spent would be to implement the dealer. Although I realise it would take quite some more hours and lines of code than such an intermediate thing.