request resized versions of covers to save bandwidth

This commit is contained in:
2025-09-05 20:36:58 +02:00
parent fad3a7f07e
commit 58a5e65772
4 changed files with 19 additions and 23 deletions

View File

@@ -44,7 +44,7 @@ export default function MangaDetail(props: MangaDetailProps): ReactNode {
<img
src={
manga
? `${Api.baseUrl}/v2/Manga/${manga.key}/Cover`
? `${Api.baseUrl}/v2/Manga/${manga.key}/Cover/Medium`
: '/blahaj.png'
}
/>

View File

@@ -30,7 +30,7 @@ export default function MangaCard(props: MangaCardProps): ReactNode {
<img
src={
props.manga && props.manga.key != 'Search'
? `${Api.baseUrl}/v2/Manga/${props.manga?.key}/Cover`
? `${Api.baseUrl}/v2/Manga/${props.manga?.key}/Cover/Medium`
: '/blahaj.png'
}
/>

View File

@@ -13,6 +13,7 @@
import {
Author,
Chapter,
CoverSize,
FileLibrary,
GotifyRecord,
LibraryConnector,
@@ -317,30 +318,14 @@ export class V2<SecurityDataType = unknown> extends HttpClient<SecurityDataType>
* No description
*
* @tags Manga
* @name MangaCoverList
* @name MangaCoverDetail
* @summary Returns Cover of API.Controllers.DTOs.Manga with MangaId
* @request GET:/v2/Manga/{MangaId}/Cover
* @request GET:/v2/Manga/{MangaId}/Cover/{CoverSize}
*/
mangaCoverList = (
mangaId: string,
query?: {
/**
* If width is provided, height needs to also be provided
* @format int32
*/
width?: number;
/**
* If height is provided, width needs to also be provided
* @format int32
*/
height?: number;
},
params: RequestParams = {}
) =>
this.request<string, ProblemDetails | string | void>({
path: `/v2/Manga/${mangaId}/Cover`,
mangaCoverDetail = (mangaId: string, coverSize: CoverSize, params: RequestParams = {}) =>
this.request<File, ProblemDetails | string | void>({
path: `/v2/Manga/${mangaId}/Cover/${coverSize}`,
method: 'GET',
query: query,
format: 'blob',
...params,
});

View File

@@ -41,6 +41,13 @@ export enum LibraryType {
Kavita = 'Kavita',
}
export enum CoverSize {
Original = 'Original',
Large = 'Large',
Medium = 'Medium',
Small = 'Small',
}
/** API.Schema.MangaContext.AltTitle DTO */
export interface AltTitle {
/**
@@ -390,6 +397,10 @@ export interface TrangaSettings {
MangaInfo?: number;
} | null;
downloadLanguage?: string | null;
/** @format int32 */
maxConcurrentDownloads?: number;
/** @format int32 */
maxConcurrentWorkers?: number;
}
/** API.Workers.BaseWorker DTO */