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

Resume last played music on queue when reopening the app #1434

Open
sith-on-mars opened this issue Mar 24, 2023 · 14 comments
Open

Resume last played music on queue when reopening the app #1434

sith-on-mars opened this issue Mar 24, 2023 · 14 comments
Labels
enhancement This thread requests an enhancement to be implemented. good first issue This issue is a low hanging fruit perfect for new contributors and shouldn't take too much time.

Comments

@sith-on-mars
Copy link

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.

@sith-on-mars sith-on-mars added the enhancement This thread requests an enhancement to be implemented. label Mar 24, 2023
@nukeop nukeop added the good first issue This issue is a low hanging fruit perfect for new contributors and shouldn't take too much time. label Mar 29, 2023
@nukeop
Copy link
Owner

nukeop commented Mar 29, 2023

Thanks for the suggestion, this is a good idea.

@DxVxDOD
Copy link

DxVxDOD commented Mar 29, 2023

Hi I would like to work on this issue.

joewrightlaprugne added a commit to joewrightlaprugne/nuclear that referenced this issue Apr 9, 2023
@fastio19
Copy link

Hi @sith-on-mars, I would like to contribute on this issue if it is still opened.

@mjsf1234
Copy link

Hi is this issue still open I can start working for it

@nukeop
Copy link
Owner

nukeop commented May 18, 2023

No, someone is working on it.

@vinay94185
Copy link

@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.

@nukeop
Copy link
Owner

nukeop commented May 24, 2023

There's an open pull request on this.

@vinay94185
Copy link

thanks for update. i see it.

@sameer-haider
Copy link
Contributor

Can I be assigned this.

@SamarthBagga
Copy link
Contributor

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?

@nukeop
Copy link
Owner

nukeop commented Jul 21, 2023

This would be the 5th time I'm assigning someone to this issue.

@SamarthBagga
Copy link
Contributor

SamarthBagga commented Jul 21, 2023

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?

@nukeop
Copy link
Owner

nukeop commented Jul 21, 2023

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.

@SamarthBagga
Copy link
Contributor

okay, I'll get started on it. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This thread requests an enhancement to be implemented. good first issue This issue is a low hanging fruit perfect for new contributors and shouldn't take too much time.
Projects
None yet
Development

No branches or pull requests

8 participants