feat(refresh): added refresh button on game detail view to refresh metadata

Resolves grimsi/gameyfin#45
This commit is contained in:
shawly
2022-10-19 23:35:24 +02:00
parent 6ee1117f3d
commit 130ec4565d
6 changed files with 45 additions and 3 deletions
@@ -48,6 +48,24 @@ export class GameDetailViewComponent {
this.gamesService.downloadGame(this.game.slug);
}
public refreshGame(): void {
this.gamesService.refreshGame(this.game.slug).subscribe({
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']);
} else {
console.error(error);
}
}
});
}
public bytesAsHumanReadableString(bytes: number): string {
const thresh = 1024;