HeroicGamesLauncher icon indicating copy to clipboard operation
HeroicGamesLauncher copied to clipboard

[Feature] Download Manager

Open Nocccer opened this issue 1 year ago • 7 comments

  • 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:

  • [x] 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)

Nocccer avatar Sep 22 '22 15:09 Nocccer

  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)

Etaash-mathamsetty avatar Sep 23 '22 20:09 Etaash-mathamsetty

  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

Nocccer avatar Sep 24 '22 01:09 Nocccer

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.

Etaash-mathamsetty avatar Sep 24 '22 17:09 Etaash-mathamsetty

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.

flavioislima avatar Sep 24 '22 17:09 flavioislima

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

Etaash-mathamsetty avatar Sep 26 '22 15:09 Etaash-mathamsetty

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 avatar Sep 27 '22 04:09 BrettCleary

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 avatar Sep 27 '22 20:09 BrettCleary

@Heroic-Games-Launcher/development this one is ready for review

flavioislima avatar Oct 11 '22 13:10 flavioislima

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 avatar Oct 12 '22 00:10 BrettCleary

  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 avatar Oct 12 '22 00:10 BrettCleary

Also I think we should just use MB instead of MiB

I agree with this Microsoft article

BrettCleary avatar Oct 12 '22 00:10 BrettCleary

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.

Etaash-mathamsetty avatar Oct 12 '22 00:10 Etaash-mathamsetty