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 <img
src={ src={
manga manga
? `${Api.baseUrl}/v2/Manga/${manga.key}/Cover` ? `${Api.baseUrl}/v2/Manga/${manga.key}/Cover/Medium`
: '/blahaj.png' : '/blahaj.png'
} }
/> />

View File

@@ -30,7 +30,7 @@ export default function MangaCard(props: MangaCardProps): ReactNode {
<img <img
src={ src={
props.manga && props.manga.key != 'Search' 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' : '/blahaj.png'
} }
/> />

View File

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

View File

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