0">
Developed by
-
-
![]()
0" style="height: 52px;"
- src="v1/images/{{company.logoId}}" alt="{{company.name}}">
-
0">{{company.name}}
+
+
diff --git a/frontend/src/app/components/game-detail-view/game-detail-view.component.ts b/frontend/src/app/components/game-detail-view/game-detail-view.component.ts
index 8366c89..444f1b0 100644
--- a/frontend/src/app/components/game-detail-view/game-detail-view.component.ts
+++ b/frontend/src/app/components/game-detail-view/game-detail-view.component.ts
@@ -2,6 +2,7 @@ import {Component, HostListener} from '@angular/core';
import {ActivatedRoute, Params, Router} from "@angular/router";
import {DetectedGameDto} from "../../models/dtos/DetectedGameDto";
import {GamesService} from "../../services/games.service";
+import {CompanyDto} from "../../models/dtos/CompanyDto";
@Component({
selector: 'app-game-detail-view',
@@ -12,13 +13,20 @@ export class GameDetailViewComponent {
game!: DetectedGameDto;
+ companiesWithLogo: CompanyDto[]= [];
+
gridColumnCount: number;
constructor(private route: ActivatedRoute,
private router: Router,
private gamesService: GamesService) {
this.gamesService.getGame(this.route.snapshot.params['slug']).subscribe({
- next: game => this.game = game,
+ next: game => {
+ this.game = game;
+ if(game.companies !== undefined) {
+ this.companiesWithLogo = game.companies.filter(c => c.logoId !== undefined && c.logoId.length > 0);
+ }
+ },
error: error => {
if (error.status === 404) {
this.router.navigate(['/library']);
diff --git a/frontend/src/app/components/header/header.component.ts b/frontend/src/app/components/header/header.component.ts
index 71b017a..eb3e802 100644
--- a/frontend/src/app/components/header/header.component.ts
+++ b/frontend/src/app/components/header/header.component.ts
@@ -1,7 +1,6 @@
import {Component} from '@angular/core';
import {LibraryService} from "../../services/library.service";
import {MatSnackBar} from '@angular/material/snack-bar';
-import {timeInterval} from "rxjs";
import {Router} from "@angular/router";
import {GamesService} from "../../services/games.service";
import {ThemingService} from "../../services/theming.service";
@@ -26,11 +25,27 @@ export class HeaderComponent {
}
scanLibrary(): void {
- this.libraryService.scanLibrary().pipe(timeInterval()).subscribe({
- next: value => {
+ this.libraryService.scanLibrary().subscribe({
+ next: result => {
// Refresh the current page "angular style"
- this.router.navigate([this.router.url]).then(() =>
- this.snackBar.open(`Library scan completed in ${Math.trunc(value.interval / 1000)} seconds.`, undefined, {duration: 5000})
+ this.router.navigate([this.router.url]).then(() => {
+ const snackBarDuration: number = 10000;
+
+ let snackbarContent: string = 'Library scan completed in ' + result.scanDuration + ' seconds:\n' +
+ '- ' + result.newGames + ' new games\n' +
+ '- ' + result.deletedGames + ' games removed\n' +
+ '- ' + result.newUnmappableFiles + ' files/folders could not be mapped\n' +
+ '- ' + result.totalGames + ' games currently in your library';
+
+ if (result.companyLogoDownloads !== undefined && result.coverDownloads !== undefined && result.screenshotDownloads !== undefined) {
+ snackbarContent = snackbarContent.concat('\n' +
+ '- ' + result.coverDownloads + ' covers downloaded\n' +
+ '- ' + result.screenshotDownloads + ' screenshots downloaded\n' +
+ '- ' + result.companyLogoDownloads + ' company logos downloaded');
+ }
+
+ this.snackBar.open(snackbarContent, undefined, {duration: snackBarDuration});
+ }
)
},
error: error => this.snackBar.open(`Error while scanning library: ${error.error.message}`, undefined, {duration: 5000})
diff --git a/frontend/src/app/models/dtos/ImageDownloadResultDto.ts b/frontend/src/app/models/dtos/ImageDownloadResultDto.ts
new file mode 100644
index 0000000..a7048c0
--- /dev/null
+++ b/frontend/src/app/models/dtos/ImageDownloadResultDto.ts
@@ -0,0 +1,5 @@
+export class ImageDownloadResultDto {
+ coverDownloads!: number;
+ screenshotDownloads!: number;
+ companyLogoDownloads!: number;
+}
diff --git a/frontend/src/app/models/dtos/LibraryScanResultDto.ts b/frontend/src/app/models/dtos/LibraryScanResultDto.ts
new file mode 100644
index 0000000..f34977a
--- /dev/null
+++ b/frontend/src/app/models/dtos/LibraryScanResultDto.ts
@@ -0,0 +1,10 @@
+export class LibraryScanResultDto {
+ newGames!: number;
+ deletedGames!: number;
+ newUnmappableFiles!: number;
+ totalGames!: number;
+ coverDownloads!: number;
+ screenshotDownloads!: number;
+ companyLogoDownloads!: number;
+ scanDuration!: number;
+}
diff --git a/frontend/src/app/services/library.service.ts b/frontend/src/app/services/library.service.ts
index e0cd2b5..3fd7d82 100644
--- a/frontend/src/app/services/library.service.ts
+++ b/frontend/src/app/services/library.service.ts
@@ -1,7 +1,9 @@
import {Injectable} from '@angular/core';
-import {HttpClient, HttpResponse} from "@angular/common/http";
+import {HttpClient} from "@angular/common/http";
import {Observable} from "rxjs";
import {LibraryApi} from "../api/LibraryApi";
+import {LibraryScanResultDto} from "../models/dtos/LibraryScanResultDto";
+import {ImageDownloadResultDto} from "../models/dtos/ImageDownloadResultDto";
@Injectable({
providedIn: 'root'
@@ -13,12 +15,12 @@ export class LibraryService implements LibraryApi {
constructor(private http: HttpClient) {
}
- scanLibrary(): Observable
> {
- return this.http.get>(`${this.apiPath}/scan`);
+ scanLibrary(): Observable {
+ return this.http.get(`${this.apiPath}/scan`);
}
- downloadImages(): Observable> {
- return this.http.get>(`${this.apiPath}/download-images`);
+ downloadImages(): Observable {
+ return this.http.get(`${this.apiPath}/download-images`);
}
getFiles(): Observable {
diff --git a/pom.xml b/pom.xml
index 1959753..e34baa5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
de.grimsi
gameyfin
- 1.1.4-RC1
+ 1.2.0
gameyfin
gameyfin