mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-15 08:15:37 +00:00
WIP: Implement frontend
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GamesService } from './games.service';
|
||||
|
||||
describe('GameserverApiService', () => {
|
||||
let service: GamesService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(GamesService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {GamesApi} from "../api/GamesApi";
|
||||
import {HttpClient, HttpResponse} from "@angular/common/http";
|
||||
import {Observable} from "rxjs";
|
||||
import {DetectedGameDto} from "../models/dtos/DetectedGameDto";
|
||||
import {GameOverviewDto} from "../models/dtos/GameOverviewDto";
|
||||
import {LibraryApi} from "../api/LibraryApi";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LibraryService implements LibraryApi {
|
||||
|
||||
private readonly apiPath = '/library';
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
}
|
||||
|
||||
scanLibrary(): Observable<HttpResponse<Response>> {
|
||||
return this.http.get<HttpResponse<Response>>(`${this.apiPath}/scan`);
|
||||
}
|
||||
|
||||
downloadImages(): Observable<HttpResponse<Response>> {
|
||||
return this.http.get<HttpResponse<Response>>(`${this.apiPath}/download-images`);
|
||||
}
|
||||
|
||||
getFiles(): Observable<string[]> {
|
||||
return this.http.get<string[]>(`${this.apiPath}/files`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user