-
-
Notifications
You must be signed in to change notification settings - Fork 480
Allow for separate library refreshes #1356
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
Allow for separate library refreshes #1356
Conversation
electron/main.ts
Outdated
ipcMain.handle('checkGameUpdates', async () => { | ||
const legendaryUpdates = await LegendaryLibrary.get().listUpdateableGames() | ||
const gogUpdates = await GOGLibrary.get().listUpdateableGames() | ||
ipcMain.handle('checkGameUpdates', async (event, libraries) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you should receive a Runner
here and then depending on the Runner you call the right one.
Use a switch
to make it more scalable. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also have a full parameter to refresh all libraries
I believe for libraries instead of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. Thanks for that! ⚔️
tested and is everything working fine.
…Launcher#1356)" This reverts commit 37cdf7e.
This patch, addressing #1320, adds an additional string[] parameter to GlobalState.refresh and checkGameUpdates, allowing you to update just one library at a time.
Launching still refreshes both libraries, but logging in or clicking the refresh button in a library only refreshes the corresponding library.
The way I did it, there's some repeated code. There's probably a better way of doing it, especially as more libraries are added, but for now this was the best I could do. Let me know if you have a better idea and I'll happily rewrite it.
Use the following Checklist if you have changed something on the Backend or Frontend: