mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-09-09 19:38:21 +02:00
request resized versions of covers to save bandwidth
This commit is contained in:
@@ -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'
|
||||
}
|
||||
/>
|
||||
|
@@ -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'
|
||||
}
|
||||
/>
|
||||
|
@@ -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,
|
||||
});
|
||||
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user