Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

since we're not linking anymore, update BPM pictures on manual pictur… #117

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/js/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,17 @@ class Search extends React.Component {
this.setState({
items: clonedItems,
});

Steam.addAsset(location.state.assetType, game.appid, item.url).then(() => {

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') {
downloadPromises.push(Steam.addAsset(location.state.assetType, game.appidold, item.url));
}

Promise.all(downloadPromises).then(() => {
clonedItems[itemIndex].downloading = false;
this.setState({
items: clonedItems,
Expand Down
7 changes: 6 additions & 1 deletion src/js/Steam.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ class Steam {
items.shortcuts.forEach((item) => {
const appName = item.appname || item.AppName || item.appName;
const exe = item.exe || item.Exe;
const appid = this.generateNewAppId(exe, appName);
const appid = (item.appid) ?
(item.appid >>> 0) : //bitwise unsigned 32 bit ID of manually added non-steam game
this.generateNewAppId(exe, appName);
const appidOld = this.generateAppId(exe, appName);
const configId = metrohash64(exe + item.LaunchOptions);

if (store.has(`games.${configId}`)) {
Expand All @@ -161,6 +164,7 @@ class Steam {
platform: storedGame.platform,
type: 'shortcut',
appid,
appidOld,
});
processed.push(configId);
}
Expand All @@ -175,6 +179,7 @@ class Steam {
platform: 'other',
type: 'shortcut',
appid,
appidOld,
});
}
});
Expand Down