mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-15 16:20:03 +00:00
Added missing files
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LibraryManagementService } from './library-management.service';
|
||||
|
||||
describe('LibraryManagementService', () => {
|
||||
let service: LibraryManagementService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(LibraryManagementService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {Observable} from "rxjs";
|
||||
import {DetectedGameDto} from "../models/dtos/DetectedGameDto";
|
||||
import {PathToSlugDto} from "../models/dtos/PathToSlugDto";
|
||||
import {UnmappedFileDto} from "../models/dtos/UnmappedFileDto";
|
||||
import {LibraryManagementApi} from "../api/LibraryManagementApi";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LibraryManagementService implements LibraryManagementApi {
|
||||
|
||||
private readonly apiPath = '/library-management';
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
}
|
||||
|
||||
mapGame(pathToSlugDto: PathToSlugDto): Observable<DetectedGameDto> {
|
||||
return this.http.post<DetectedGameDto>(`${this.apiPath}/map-path`, pathToSlugDto);
|
||||
}
|
||||
|
||||
getUnmappedFiles(): Observable<UnmappedFileDto[]> {
|
||||
return this.http.get<UnmappedFileDto[]>(`${this.apiPath}/unmapped-files`);
|
||||
}
|
||||
|
||||
confirmGameMapping(slug: string): Observable<DetectedGameDto> {
|
||||
return this.http.get<DetectedGameDto>(`${this.apiPath}/confirm-game/${slug}`);
|
||||
}
|
||||
|
||||
deleteGame(slug: string): Observable<Response> {
|
||||
return this.http.delete<Response>(`${this.apiPath}/delete-game/${slug}`);
|
||||
}
|
||||
|
||||
deleteUnmappedFile(id: number): Observable<Response> {
|
||||
return this.http.delete<Response>(`${this.apiPath}/delete-unmapped-file/${id}`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user