From 83567a9457c827aecdcd8a60b714ea4d71dc260b Mon Sep 17 00:00:00 2001 From: SantaHey <33598903+SantaHey@users.noreply.github.com> Date: Mon, 5 Apr 2021 16:11:53 +0200 Subject: [PATCH 1/4] Add appidold for BPM horizontalgrid --- src/js/Steam.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/Steam.js b/src/js/Steam.js index c538ccc..5b8ff99 100644 --- a/src/js/Steam.js +++ b/src/js/Steam.js @@ -146,6 +146,7 @@ class Steam { const appName = item.appname || item.AppName || item.appName; const exe = item.exe || item.Exe; const appid = this.generateNewAppId(exe, appName); + const appidold = this.generateAppId(exe, appName); const configId = metrohash64(exe + item.LaunchOptions); if (store.has(`games.${configId}`)) { From 429d7c30a3f0d858bf1b4235722a9c6d3df65e2f Mon Sep 17 00:00:00 2001 From: SantaHey <33598903+SantaHey@users.noreply.github.com> Date: Mon, 5 Apr 2021 16:14:05 +0200 Subject: [PATCH 2/4] Push appidold for non-steam games --- src/js/Steam.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/Steam.js b/src/js/Steam.js index 5b8ff99..c82990e 100644 --- a/src/js/Steam.js +++ b/src/js/Steam.js @@ -162,6 +162,7 @@ class Steam { platform: storedGame.platform, type: 'shortcut', appid, + appidold, }); processed.push(configId); } @@ -176,6 +177,7 @@ class Steam { platform: 'other', type: 'shortcut', appid, + appidold, }); } }); From ff0cd1a96604f8cc7a933513207f2b3799e64917 Mon Sep 17 00:00:00 2001 From: SantaHey <33598903+SantaHey@users.noreply.github.com> Date: Mon, 5 Apr 2021 16:53:57 +0200 Subject: [PATCH 3/4] Add horizontalGrid BPM image for Non-Steam Games --- src/js/Search.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/Search.jsx b/src/js/Search.jsx index d7f6aca..2c74121 100644 --- a/src/js/Search.jsx +++ b/src/js/Search.jsx @@ -66,6 +66,11 @@ class Search extends React.Component { this.setState({ items: clonedItems, }); + + //Add horizontalGrid BPM image for Non-Steam Games + if (game.appidold && location.state.assetType == 'horizontalGrid') { + Steam.addAsset(location.state.assetType, game.appidold, item.url); + } Steam.addAsset(location.state.assetType, game.appid, item.url).then(() => { clonedItems[itemIndex].downloading = false; From 239b7eb4c8fd985bfa40e30b923d3a142dbae75f Mon Sep 17 00:00:00 2001 From: SantaHey <33598903+SantaHey@users.noreply.github.com> Date: Mon, 5 Apr 2021 17:23:41 +0200 Subject: [PATCH 4/4] Update horizontalGrid with downloadPromises Adapted from https://github.com/SteamGridDB/steamgriddb-manager/pull/117 --- src/js/Search.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/js/Search.jsx b/src/js/Search.jsx index 2c74121..0556c95 100644 --- a/src/js/Search.jsx +++ b/src/js/Search.jsx @@ -67,12 +67,16 @@ class Search extends React.Component { items: clonedItems, }); - //Add horizontalGrid BPM image for Non-Steam Games + const downloadPromises = []; + + downloadPromises.push(Steam.addAsset(location.state.assetType, game.appid, item.url)); + + // Add horizontalGrid BPM image for Non-Steam Games if (game.appidold && location.state.assetType == 'horizontalGrid') { - Steam.addAsset(location.state.assetType, game.appidold, item.url); + downloadPromises.push(Steam.addAsset(location.state.assetType, game.appidold, item.url)); } - - Steam.addAsset(location.state.assetType, game.appid, item.url).then(() => { + + Promise.all(downloadPromises).then(() => { clonedItems[itemIndex].downloading = false; this.setState({ items: clonedItems,