nuclear
nuclear copied to clipboard
Resume last played music on queue when reopening the app
Currently, if you play music on a queue, reopening the app will lead to the loss of the queue history. It would be great if the app could resume last played music on the queue and keep queue history, unless the user change to another queue or playlist. So basically the app can emulate default Sportify player does.
Thanks for the suggestion, this is a good idea.
Hi I would like to work on this issue.
Hi @sith-on-mars, I would like to contribute on this issue if it is still opened.
Hi is this issue still open I can start working for it
No, someone is working on it.
@nukeop i checked all accounts, no one seems to be actively working on this issue for over a month, i don't want to be rude to anyone but if no one's working on it, i would love to take it.
thank you.
There's an open pull request on this.
thanks for update. i see it.
Can I be assigned this.
Hi @nukeop, since I do not think someone is working on this issue currently. I would like to work on it. I wanted to know where should the queue's state be stored, so that it can be retrieved once the app closes and reopens?
This would be the 5th time I'm assigning someone to this issue.
hi @nukeop , there is no need to assign the issue to me. I am not sure yet if ill be able to provide a fix, I am just trying to grasp the issue and trying to find a fix. If I am able to come up with a fix, I'll make a PR.
All I wanted to know is that where should I store the queue's state so that it can be retreieved once the app closes and then reopens?
I'm going to paste what I said on Discord:
- it should probably be contained in the app package
- last time someone tried this I suggested implementing a redux subscriber that listens to anything related to adding/removing/swapping tracks in the queue, and saves it in a json file. If you search by
subscribe
you should find existing subscribers to get an idea how to use them. - this can either be a separate file (using
electron-store
) or in the regular config file, just make sure that the write is non-blocking - if possible, use atomic writes* to ensure the queue is never corrupted
- the program should read the queue when starting, and if it fails it should simply start with a blank one
- ideally, there should be a setting that controls whether this feature is enabled
- This is obviously a lot of work, so it's fine (and encouraged) to do this stage by stage, and not a problem if you don't do all of this.
* explanation:
Atomic saving is a method used in programming to safely update files. Instead of directly modifying the original file, atomic saving writes changes to a new temporary file. Once the changes are successfully written, the original file is replaced with the new file in a single operation. This ensures that if anything goes wrong during the process, the original file remains unchanged, preventing data corruption.
This is going to be a moderately-sized piece of code that's going to take probably at least 2-3 hours to implement.
okay, I'll get started on it. thank you!