Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Simple OPDS
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Simple OPDS
Commits
204218e6
Commit
204218e6
authored
Feb 18, 2018
by
Dmitry Shelepnev
Browse files
Options
Downloads
Patches
Plain Diff
Create books cover caching
parent
dbcc89ee
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
opds_catalog/dl.py
+2
-0
2 additions, 0 deletions
opds_catalog/dl.py
with
2 additions
and
0 deletions
opds_catalog/dl.py
+
2
−
0
View file @
204218e6
...
@@ -7,6 +7,7 @@ import io
...
@@ -7,6 +7,7 @@ import io
import
subprocess
import
subprocess
from
django.http
import
HttpResponse
,
Http404
from
django.http
import
HttpResponse
,
Http404
from
django.views.decorators.cache
import
cache_page
from
opds_catalog.models
import
Book
,
bookshelf
from
opds_catalog.models
import
Book
,
bookshelf
from
opds_catalog
import
settings
,
utils
,
opdsdb
,
fb2parse
from
opds_catalog
import
settings
,
utils
,
opdsdb
,
fb2parse
...
@@ -93,6 +94,7 @@ def Download(request, book_id, zip_flag):
...
@@ -93,6 +94,7 @@ def Download(request, book_id, zip_flag):
return
response
return
response
# Новая версия (0.42) процедуры извлечения обложек из файлов книг fb2, epub, mobi
# Новая версия (0.42) процедуры извлечения обложек из файлов книг fb2, epub, mobi
@cache_page
(
config
.
SOPDS_CACHE_TIME
)
def
Cover
(
request
,
book_id
,
thumbnail
=
False
):
def
Cover
(
request
,
book_id
,
thumbnail
=
False
):
"""
Загрузка обложки
"""
"""
Загрузка обложки
"""
book
=
Book
.
objects
.
get
(
id
=
book_id
)
book
=
Book
.
objects
.
get
(
id
=
book_id
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment