mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-14 16:20:04 +00:00
WIP: Implement frontend
Implemented 1st version of game-detail-view
This commit is contained in:
@@ -1,29 +1,34 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {NavMenuItem} from '../../models/objects/NavMenuItem';
|
||||
import {Component} from '@angular/core';
|
||||
import {LibraryService} from "../../services/library.service";
|
||||
import {MatSnackBar} from '@angular/material/snack-bar';
|
||||
import {timeInterval} from "rxjs";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
templateUrl: './header.component.html',
|
||||
styleUrls: ['./header.component.scss']
|
||||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
|
||||
activeItem: NavMenuItem | undefined;
|
||||
export class HeaderComponent {
|
||||
|
||||
constructor(private libraryService: LibraryService,
|
||||
private snackBar: MatSnackBar) {
|
||||
private snackBar: MatSnackBar,
|
||||
private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
reloadLibrary() {
|
||||
reloadLibrary(): void {
|
||||
this.libraryService.scanLibrary().pipe(timeInterval()).subscribe({
|
||||
next: value => this.snackBar.open(`Library scan completed in ${Math.trunc(value.interval/1000)} seconds.`),
|
||||
next: value => this.snackBar.open(`Library scan completed in ${Math.trunc(value.interval / 1000)} seconds.`),
|
||||
error: error => this.snackBar.open(`Error while scanning library: ${error}`)
|
||||
})
|
||||
}
|
||||
|
||||
goToLibraryScreen(): void {
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
|
||||
notOnLibraryScreen(): boolean {
|
||||
return !(this.router.url === "/library");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user