Feature/999 add high resolution cover support upload storage and search (#1006)
* Add high-resolution cover support: upload, storage, and search * Disable tests until fixed
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import {inject, Injectable} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs';
|
||||
import {API_CONFIG} from '../../config/api-config';
|
||||
|
||||
export interface CoverImage {
|
||||
url: string;
|
||||
source?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
index: number;
|
||||
}
|
||||
|
||||
export interface CoverFetchRequest {
|
||||
title?: string;
|
||||
author?: string;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class BookCoverService {
|
||||
private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/books`;
|
||||
|
||||
private http = inject(HttpClient);
|
||||
|
||||
fetchBookCovers(request: CoverFetchRequest): Observable<CoverImage[]> {
|
||||
return this.http.post<CoverImage[]>(`${this.baseUrl}/1/metadata/covers`, request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user