-
-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
- on before-quit, save the queue state (entries, sorting, current song/player) - state is compressed using brotli - when the window is ready, restore the queue
...I was hoping that a draft PR wouldn't trigger builds. Obviously, I'm incorrect .-. |
No worries about builds running. Public repos have unlimited build minutes :) Thanks for taking on this issue. In regards to your questions:
How long is the shutdown delay? Could possibly send an ipcMain event to the frontend and have it open a modal notice until the save is complete. |
When I was working on the dev version, I was seeing delays of a few seconds to close, but the reported time for decompression was ~180ms (brotli) versus ~450ms for gzip/deflate. With a production version, I can barely notice the difference now. Must've just been the delay of tearing down webpack dev server |
Applied the changes! Now I can see that, for large queues (~10k), it adds 2-3 seconds on window close. Unfortunately, because the renderer process freezes, I couldn't figure out a way to send a toast/other notice (the toast would fire, but never render). Tested on windows/linux/mac (sort of). Please test both the dev and prod version, because the production version gave me more headaches than I expected (among other things, why the |
Besides needing to remove the |
Addressed. We can add a notice that says 'now saving, please wait', but this would require deferring the actual saving slightly (in some simple testing, a delay of 100ms was enough for the toast to be shown). For queue = 10k songs, the time was somewhere around 500ms across OSX and Windows. With 100k songs (admittedly many, many repeats), it compressed down to ~32MB in 3-4 seconds. |
The changes look good, and is extremely fast! 3-4s for 100k songs is a good benchmark especially since I'd wager 99% of users will have less than 10k songs at any given time. One thing before I merge, I noticed the default setting value is not yet. Can you add a value in the |
This PR seeks to address #130.
To support saving/restoring the queue state, there are two new reducers. They store the following data (without pre-processing), compressed using brotli:
entry
, but alsoshuffledEntry
andsortedEntry
(useful if the user had shuffled/sorted)This is a draft PR because there were a few questions I had:
entry
, we could do a simple manual compression mapping album ids to their location(s) in the other lists.sortColumn
andshuffle
are set? When I have both, it seems like the sort takes precedence, but not before sometimes switching rapidly between shuffled and sorted versionif the app is closed due to a shutdown/restart of the system or a user logout
. I'm not sure if/how we could handle this edge caseFinally, as an aside, the reason why I ended up with brotli (out of brotli, gzip, and deflate), was that on a sample queue of ~10k songs (with sorted and shuffled entries), it had the best compression at between 3.1-3.5 MB (variance depending on OS), but was the fastest. Unfortunately this compression has to be synchronous, so there is a delay in shutdown.