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

[Feature] Download Manager #1832

Merged
merged 59 commits into from Oct 26, 2022
Merged

[Feature] Download Manager #1832

merged 59 commits into from Oct 26, 2022

Conversation

Nocccer
Copy link
Collaborator

@Nocccer Nocccer commented Sep 22, 2022

  • Added queue system. Pressing install now adds the game to the download manager queue.
  • Added new electron-store for download manager queue
  • Added new Download Manager screen
    • added ProgressChart for average downlaod speed
  • Replaced kill signal with abort controllers
  • Sidebar shows which game gets installed and on click navigate to download manager

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@Etaash-mathamsetty
Copy link
Member

  1. Instead of calling it "Download Manager", I could call it "Downloads" (the way steam does it)
  2. I would also put some units behind the numbers of the graph (like MB/s and whatnot)

@Nocccer
Copy link
Collaborator Author

Nocccer commented Sep 24, 2022

  1. Instead of calling it "Download Manager", I could call it "Downloads" (the way steam does it)
  2. I would also put some units behind the numbers of the graph (like MB/s and whatnot)

The pr doc is not up to date. I already added more frontend with MiB/s

@Etaash-mathamsetty
Copy link
Member

Etaash-mathamsetty commented Sep 24, 2022

Also for the sidebar, the best thing to do (In my opinion) would be to only show the game that is currently installing, since showing the ones that are queued would be redundant and unnecessary to show in the sidebar.

@flavioislima
Copy link
Member

Also for the sidebar, the best thing to do (In my opinion) would be to only show the game that is currently installing, since showing the ones that are queued would be redundant and unnecessary to show in the sidebar.

we are thinking on removing this and show the graphic instead or maybe dont show anything there and add some other way of seeing the current download. Perhaps using a floating snackbar that when clicked show the list or something like this.
For now, yes, lets show only one game.

@Nocccer Nocccer added the pr:ready-for-review Feature-complete, ready for the grind! :P label Sep 26, 2022
@Nocccer Nocccer linked an issue Sep 26, 2022 that may be closed by this pull request
@Nocccer Nocccer marked this pull request as ready for review September 26, 2022 13:59
@Etaash-mathamsetty
Copy link
Member

Etaash-mathamsetty commented Sep 26, 2022

image
is this intentional or were the actual game names supposed to be here?

sidebar got stuck on an old status (download manager doesn't say anything is installing either):
image

seems like I now broke the entire manager, the download is stuck on 0%, it is not getting cancelled, and I was able to requeue the same exact game after that. edit: after restarting heroic a third time, it seems to work.

(11:29:44) INFO:    [Legendary]:        Running command: /tmp/.mount_HeroicW9EWvq/resources/app.asar.unpacked/build/bin/linux/legendary --version
(11:29:45) INFO:    [Legendary]:        Legendary location: /tmp/.mount_HeroicW9EWvq/resources/app.asar.unpacked/build/bin/linux/legendary
(11:29:45) INFO:    [Gog]:              GOGDL location: /tmp/.mount_HeroicW9EWvq/resources/app.asar.unpacked/build/bin/linux/gogdl
(11:29:45) INFO:    [Backend]:          

Heroic Version: 2.4.3 Chopper
Legendary Version:  0.20.28 Dark Energy (hotfix #2)
OS: Arch KERNEL: 5.19.11-zen1-1-zen ARCH: x64
CPU: AMD Ryzen 7 4700U with Radeon Graphics @2 GOVERNOR: schedutil
RAM: Total: 15 GiB Available: 4.73 GiB
GRAPHICS: GPU0: gfx90c:xnack- VRAM: 512MB DRIVER:  
PROTOCOL: wayland

(11:29:45) INFO:    [Gog]:              Getting data about the user
(11:29:46) WARNING: [Backend]:          Protocol already registered.
(11:29:47) INFO:    [Backend]:          AreWeAntiCheatYet data downloaded
(11:29:47) INFO:    [Gog]:              Saved user data to config
(11:29:47) INFO:    [Backend]:          Checking for new Heroic Updates
(11:29:47) INFO:    [Frontend]:         Refreshing Library
(11:29:47) INFO:    [Legendary]:        Refreshing library...
(11:29:47) INFO:    [Legendary]:        Refreshing Epic Games...
(11:29:47) INFO:    [Legendary]:        Game list updated, got 148 games & DLCs
(11:29:47) INFO:    [Gog]:              Getting GOG library
(11:29:48) INFO:    [Legendary]:        Running command: /tmp/.mount_HeroicW9EWvq/resources/app.asar.unpacked/build/bin/linux/legendary list
(11:29:48) INFO:    [Gog]:              Number of library pages: 1
(11:29:48) INFO:    [Winetricks]:       Downloaded Winetricks
(11:29:48) INFO:    [Gog]:              Saved games data
(11:30:06) DEBUG:   [Legendary]:        Using cached install info
(11:30:07) DEBUG:   [Backend]:          {"free":89677385728,"diskSize":469188419584,"message":"83.52 GiB / 436.97 GiB","validPath":true}
(11:30:07) DEBUG:   [Backend]:          {"free":89677385728,"diskSize":469188419584,"message":"83.52 GiB / 436.97 GiB","validPath":true}
(11:30:07) DEBUG:   [Backend]:          {"free":89677385728,"diskSize":469188419584,"message":"83.52 GiB / 436.97 GiB","validPath":true}
(11:30:09) INFO:    [Backend]:          Writing config for 1317e4e3b3ed40c289dde85b194347d3
(11:30:09) INFO:    [Backend]:          {
  "autoInstallDxvk": true,
  "autoInstallVkd3d": true,
  "preferSystemLibs": false,
  "enableEsync": true,
  "nvidiaPrime": false,
  "enviromentOptions": [],
  "wrapperOptions": [],
  "showFps": false,
  "showMangohud": true,
  "useGameMode": false,
  "language": "",
  "wineVersion": {
    "bin": "/home/etaash/.local/share/Steam/compatibilitytools.d/GE-Proton7-35/proton",
    "name": "Proton - GE-Proton7-35",
    "type": "proton"
  },
  "winePrefix": "/home/etaash/Games/Heroic/Prefixes/threeoutof10Ep2"
}
(11:30:09) INFO:    [Backend]:          Preventing machine to sleep
(11:30:09) INFO:    [DownloadManager]:  1317e4e3b3ed40c289dde85b194347d3 added to download manager.
(11:30:13) ERROR:   [Frontend]:         null
(11:30:18) ERROR:   [Backend]:          Aborting not possible. Could not find a matching abort controller for 1317e4e3b3ed40c289dde85b194347d3
(11:30:18) INFO:    [Backend]:          Trying to kill 1317e4e3b3ed40c289dde85b194347d3
(11:30:18) INFO:    [Backend]:          Killed 1317e4e3b3ed40c289dde85b194347d3

@BrettCleary
Copy link
Collaborator

I don't think this was introduced on your branch, but I got this error message in the browser when clicking download initially

index.tsx:301 Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'languages' in undefined
    at getInfo (index.tsx:301:11)

and on the backend:

(21:06:12) ERROR:   [Gog]:              Error with refreshing token, reauth required
(21:06:19) INFO:    [Gog]:              Refreshing access_token
(21:06:19) DEBUG:   [Backend]:          {"free":242982338560,"diskSize":998984978432,"message":"226.29 GiB / 930.38 GiB","validPath":true}
(21:06:19) ERROR:   [Gog]:              Error with refreshing token, reauth required
(21:06:19) ERROR:   [Backend]:          No credentials, cannot get install info
(21:06:19) ERROR:   [Gog]:              Could not get install info for 1692939089, returning empty object. Something is probably gonna go wrong soon

So I have to log out and then back into my gog account. Then it works.

Would be good to send a message to the frontend and prompt the user to re-login automatically for this case.

@BrettCleary
Copy link
Collaborator

I ran into an issue when following these steps:

  1. starting download
  2. losing internet connection during download
  3. closing out of app and reconnecting internet
  4. relaunching app

The download didn't resume and I got the following error message from the backend

(13:37:17) INFO:    [Gog]:              Saved user data to config
(13:37:21) INFO:    [Backend]:          Checking for new Heroic Updates
(13:37:21) INFO:    [Frontend]:         Refreshing Library
(13:37:21) INFO:    [Legendary]:        Refreshing library...
(13:37:21) INFO:    [Legendary]:        Refreshing Epic Games...
(13:37:21) INFO:    [Legendary]:        Game list updated, got 4 games & DLCs
(13:37:21) INFO:    [Gog]:              Getting GOG library
(13:37:21) INFO:    [Legendary]:        Installed game list updated
(node:20704) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'webContents')
    at installQueueElement (C:\HeroicGamesLauncher\build\electron\main.30919b2d.js:10319:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async initQueue (C:\HeroicGamesLauncher\build\electron\main.30919b2d.js:10391:5)
(node:20704) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

I was also able to click download again on the same the game and it queued it up again in the Download Manager. So there were two instances of the same undownloaded game in the download manager. I also couldn't cancel the current download. The native popup would show up but the app was unresponsive to any of the action buttons on that window.

BrettCleary and others added 5 commits September 27, 2022 13:51
* css and layout changes

* rounding disk and down values, layout improvements, colored disk and down labels
@BrettCleary
Copy link
Collaborator

BrettCleary commented Oct 12, 2022

I get unknown error when clicking the action icon or the game's name after downloading league of legends on windows
image

my backend console is

(17:21:34) INFO:    [Legendary]:        Installed game list updated
(17:21:34) INFO:    [DownloadManager]:  Finished installing of 64b0c77d07f644e6a2326a1fd7ab9926
(17:21:34) INFO:    [DownloadManager]:  64b0c77d07f644e6a2326a1fd7ab9926 added to download manager finished.
(17:21:34) INFO:    [DownloadManager]:  64b0c77d07f644e6a2326a1fd7ab9926 removed from download manager.
(17:21:34) INFO:    [Frontend]:         Refreshing Library
(17:21:34) INFO:    [Legendary]:        Refreshing library...
(17:21:34) INFO:    [Legendary]:        Game list updated, got 4 games & DLCs
(17:21:34) INFO:    [Backend]:          operation interrupted
(17:21:43) DEBUG:   [Legendary]:        Using cached install info
(17:21:43) ERROR:   [Frontend]:         TypeError: Cannot read properties of undefined (reading 'name')
[41240:1011/172203.603:ERROR:gpu_init.cc(486)] Passthrough is not supported, GL is disabled, ANGLE is

Settings also changes to Game Settings on the sidebar when this happens

@BrettCleary
Copy link
Collaborator

  1. Instead of calling it "Download Manager", I could call it "Downloads" (the way steam does it)
  2. I would also put some units behind the numbers of the graph (like MB/s and whatnot)

I agree that "Downloads" is better

@BrettCleary
Copy link
Collaborator

Also I think we should just use MB instead of MiB

I agree with this Microsoft article

@Etaash-mathamsetty
Copy link
Member

Etaash-mathamsetty commented Oct 12, 2022

this PR is functioning quite nicely from what I have tested so far, it's just that I would like to see updates showing up in the download manager as well, since they are not currently in there as far as I can tell.

src/backend/downloadmanager/downloadqueue.ts Outdated Show resolved Hide resolved
src/backend/gog/games.ts Show resolved Hide resolved
src/backend/gog/games.ts Show resolved Hide resolved
src/backend/gog/library.ts Show resolved Hide resolved
src/backend/launcher.ts Show resolved Hide resolved
src/backend/legendary/games.ts Show resolved Hide resolved
src/backend/legendary/user.ts Show resolved Hide resolved
src/frontend/screens/Game/GamePage/index.tsx Outdated Show resolved Hide resolved
Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as much as I could.
Some thing that will need to be improved for next iteration:
Add support for updates
Add support for wine manager
Better UI

@flavioislima flavioislima merged commit 1e01cb2 into beta Oct 26, 2022
@flavioislima flavioislima deleted the feat/download-manager branch October 26, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Queue system for download and updates.
6 participants