Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed Apr 30, 2024
1 parent 8d7a4fa commit 1a0144e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lib/file-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ export class FileParser {
resolve(parsedConfig)
})
} catch(e) {
reject(`Backed up images step for blech:\n ${e}`)
reject(`Backed up images step for "${parsedConfig.configurationTitle}":\n ${e}`)
}
})
}
Expand Down
9 changes: 2 additions & 7 deletions src/renderer/services/preview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ export class PreviewService {
setTimeout(this.generatePreviewDataCallback.bind(this), 100);
}
else {
let oldPreviewData = this.previewData;
this.previewData = undefined;
let previewData;
this.loggerService.info(this.lang.info.executingParsers, { invokeAlert: true });
Expand Down Expand Up @@ -466,7 +465,7 @@ export class PreviewService {
}
else {
this.loggerService.info(this.lang.info.shutdownSteam, { invokeAlert: true, alertTimeout: 3000 });
previewData = await this.createPreviewData(data.parsedData.parsedConfigs, oldPreviewData);
previewData = await this.createPreviewData(data.parsedData.parsedConfigs);
}
}
else if (data.invalid.length === 0 && data.skipped.length === 0) {
Expand Down Expand Up @@ -507,7 +506,7 @@ export class PreviewService {
this.sgdbToArt = artworkCache.sgdbToArt;
}

private async createPreviewData(data: ParsedUserConfiguration[], oldData?: PreviewData) {
private async createPreviewData(data: ParsedUserConfiguration[]) {
let steamTreeData = steam.generateTreeFromParsedConfig(data);
let treeData: {gridData: SteamTree<any>, steamTreeData: SteamTree<any>};
if (this.appSettings.previewSettings.retrieveCurrentSteamImages)
Expand All @@ -525,14 +524,11 @@ export class PreviewService {

for (let i = 0; i < data.length; i++) {
let config = data[i];
let oldDataDir = oldData !== undefined ? oldData[config.steamDirectory] : undefined;

if (previewData[config.steamDirectory] === undefined)
previewData[config.steamDirectory] = {};

for (let j = 0; j < config.foundUserAccounts.length; j++) {
let userAccount = config.foundUserAccounts[j];
let oldDataAccount = oldDataDir !== undefined ? oldDataDir[userAccount.accountID] : undefined;

if (previewData[config.steamDirectory][userAccount.accountID] === undefined) {
previewData[config.steamDirectory][userAccount.accountID] = {
Expand All @@ -554,7 +550,6 @@ export class PreviewService {
} else {
appID = steam.lengthenAppId(executableLocation.replace(/\"/g,""));
}
let oldDataApp = oldDataAccount !== undefined ? oldDataAccount.apps[appID] : undefined;

if (shortcutsData[config.steamDirectory][userAccount.accountID][appID] !== undefined) {
if (shortcutsData[config.steamDirectory][userAccount.accountID][appID]['icon'] !== undefined) {
Expand Down

0 comments on commit 1a0144e

Please sign in to comment.