feat(api,web): support CBZ — scan, métadonnées, lecteur d'albums
- api: cbz utilitaire commun, scanner/métadonnées (+ tests), books, schéma et migrations - web: CbzReader, ReaderPage/locators (+ tests), types et client API - shared: types formats Refs: #16
This commit is contained in:
@ -26,6 +26,19 @@ export class BooksController {
|
||||
return this.books.get(Number(id));
|
||||
}
|
||||
|
||||
@Get(":id/pages")
|
||||
pages(@Param("id") id: string) {
|
||||
return this.books.listCbzPages(Number(id));
|
||||
}
|
||||
|
||||
@Get(":id/pages/:page")
|
||||
page(@Param("id") id: string, @Param("page") page: string, @Res() reply: FastifyReply) {
|
||||
const result = this.books.readCbzPage(Number(id), Number(page));
|
||||
reply.header("Content-Type", result.contentType);
|
||||
reply.header("Cache-Control", "private, max-age=3600");
|
||||
return reply.send(result.data);
|
||||
}
|
||||
|
||||
@Get(":id/file")
|
||||
file(@Param("id") id: string, @Res() reply: FastifyReply) {
|
||||
const { book, stream } = this.books.streamFile(Number(id));
|
||||
|
||||
Reference in New Issue
Block a user