Skip to content

Commit

Permalink
just some small UI stuff left
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed Jun 11, 2024
1 parent 6071a95 commit 167cb12
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 16 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## 2.5.11
### Added
* Improved exception management from preview (current exception details now show up under fix match)
### Changed
* Steam now auto exits gracefully on Windows.
* Increased timeout for Steam to exit.

## 2.5.10
### Added
* Settings option to automatically kill Steam when writing to Steam Categories (Windows & Linux only).
Expand Down
4 changes: 2 additions & 2 deletions src/lib/helpers/steam/stop-start-steam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppSettings } from "../../../models";
import { LoggerService } from "../../../renderer/services";

const checkDelay = 500;
const timeout = 40000;
const timeout = 60000;

interface ActAndCheck {
commands: {
Expand Down Expand Up @@ -76,7 +76,7 @@ export async function stopSteam() {
}
if (os.type() == 'Windows_NT') {
data.commands = {
action: `wmic process where "name='steam.exe'" delete`,
action: "Start-Process \"${env:PROGRAMFILES(X86)}\\Steam\\steam.exe\" \"-shutdown\"",
check: `(Get-Process steam -ErrorAction SilentlyContinue) -eq $null`
}
data.shell = 'powershell'
Expand Down
13 changes: 10 additions & 3 deletions src/renderer/components/preview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class PreviewComponent implements OnDestroy {
showDetails: boolean = false;
detailsSearchText: string = '';
detailsException: UserExceptionData;
detailsOriginalExcludeArt: boolean = false;

showExcludes: boolean = false;
excludedAppIds: {
Expand Down Expand Up @@ -404,6 +405,7 @@ export class PreviewComponent implements OnDestroy {
exclude: false,
timeStamp: undefined
}
this.detailsOriginalExcludeArt = existingException ? existingException.excludeArtwork : false;
this.detailsApp = {
appId: appId,
app: app,
Expand Down Expand Up @@ -494,22 +496,27 @@ export class PreviewComponent implements OnDestroy {
if(commandLineArguments) {
this.previewData[steamDirectory][userId].apps[appId].argumentString = commandLineArguments;
}
if(searchTitle) {
if(searchTitle && !excludeArtwork) {
for(const artworkType of artworkTypes) {
const oldPool = this.previewData[steamDirectory][userId].apps[appId].images[artworkType].imagePool;
this.previewData[steamDirectory][userId].apps[appId].images[artworkType].imagePool = searchTitle;
this.previewData[steamDirectory][userId].apps[appId].images[artworkType].singleProviders.steam = undefined;
this.previewService.updateAppImages(searchTitle, oldPool, artworkType)
}
}
if(newTitle||searchTitle||commandLineArguments||excludeArtwork) {
if(excludeArtwork != this.detailsOriginalExcludeArt) {
for(const artworkType of artworkTypes) {
this.previewService.updateLocalArtworkOnly(searchTitle, artworkType, excludeArtwork)
}
}
if(newTitle||searchTitle||commandLineArguments||(excludeArtwork!=this.detailsOriginalExcludeArt)) {
const exceptionId = this.userExceptionsService.makeExceptionId(app.executableLocation, app.extractedTitle, app.parserType);
this.userExceptionsService.addExceptionById(exceptionId, app.extractedTitle, {
newTitle: newTitle,
searchTitle: searchTitle,
commandLineArguments: commandLineArguments,
excludeArtwork: excludeArtwork,
exclude: false,
excludeArtwork: false,
timeStamp: Date.now(),
})
this.refreshAfterSavingDetails(steamDirectory,userId,appId);
Expand Down
31 changes: 20 additions & 11 deletions src/renderer/services/preview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,26 @@ export class PreviewService {
}

updateAppImages(imageKey: string, oldPool: string, artworkType: ArtworkType) {
this.onlineImages[artworkType][imageKey] = {
retrieving: false,
online: initOnlineProviderRecord(()=>null),
offline: this.onlineImages[artworkType][oldPool].offline,
parserEnabledProviders: this.onlineImages[artworkType][oldPool].parserEnabledProviders
}
for(const providerType of onlineProviders) {
this.onlineImages[artworkType][imageKey].online[providerType] = {
searchQueries: [imageKey],
imageProviderAPIs: this.onlineImages[artworkType][oldPool].online[providerType].imageProviderAPIs,
content: []
if(this.onlineImages[artworkType][oldPool]) {
this.onlineImages[artworkType][imageKey] = _.cloneDeep(this.onlineImages[artworkType][oldPool])
this.onlineImages[artworkType][imageKey].retrieving = false;
for(const providerType of onlineProviders) {
this.onlineImages[artworkType][imageKey].online[providerType].searchQueries = [imageKey];
this.onlineImages[artworkType][imageKey].online[providerType].content = [];
}
if(imageKey != oldPool) {
delete this.onlineImages[artworkType][oldPool];
}
} else {
throw 'Tried to call updateAppImages on a missing oldPool';
}
}

updateLocalArtworkOnly(imageKey: string, artworkType: ArtworkType, excludeArtwork: boolean) {
if(this.onlineImages[artworkType][imageKey]) {
for(const providerType of onlineProviders) {
this.onlineImages[artworkType][imageKey].online[providerType].searchQueries = excludeArtwork ? [] : [imageKey];
this.onlineImages[artworkType][imageKey].online[providerType].content = [];
}
}
}
Expand Down

0 comments on commit 167cb12

Please sign in to comment.