mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
Remove ThePdfReader.vue and migrate PDF handling to pymupdf
This commit removes the frontend component ThePdfReader.vue and replaces its functionality with a backend implementation based on pymupdf. Also includes package updates, refactors PDF archive handling, and adjusts security settings to support development on localhost.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from http.client import HTTPResponse
|
||||
from pathlib import Path
|
||||
from typing import Union, Optional, Dict, Iterable, List
|
||||
from uuid import UUID
|
||||
@@ -247,7 +248,7 @@ class ReadViewSet(viewsets.GenericViewSet):
|
||||
@swagger_auto_schema(responses={status.HTTP_200_OK: 'PDF Binary Data',
|
||||
status.HTTP_400_BAD_REQUEST: 'User below classification allowed'})
|
||||
@action(methods=['get'], detail=True)
|
||||
def pdf(self, request: Request, selector: UUID) -> Union[FileResponse, Response]:
|
||||
def pdf(self, request: Request, selector: UUID) -> Union[FileResponse, Response, HTTPResponse]:
|
||||
book = models.ComicBook.objects.get(selector=selector)
|
||||
misc, _ = models.UserMisc.objects.get_or_create(user=request.user)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user