mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-01 18:37:42 -05:00
The first stages of getting thumbnails back
This commit is contained in:
@@ -35,7 +35,7 @@ class FetchView(LoginRequiredMixin, DetailView):
|
||||
|
||||
def render_to_response(self, context, **response_kwargs):
|
||||
"""
|
||||
Override the default to return the unencrypted PDF as raw data.
|
||||
Override the default to return the unencrypted image/PDF as raw data.
|
||||
"""
|
||||
|
||||
content_types = {
|
||||
@@ -46,6 +46,12 @@ class FetchView(LoginRequiredMixin, DetailView):
|
||||
Document.TYPE_TIF: "image/tiff",
|
||||
}
|
||||
|
||||
if self.kwargs["kind"] == "thumb":
|
||||
return HttpResponse(
|
||||
GnuPG.decrypted(self.object.thumb_file),
|
||||
content_type=content_types[Document.TYPE_JPG]
|
||||
)
|
||||
|
||||
response = HttpResponse(
|
||||
GnuPG.decrypted(self.object.source_file),
|
||||
content_type=content_types[self.object.file_type]
|
||||
|
Reference in New Issue
Block a user