Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
aae81c3d
Commit
aae81c3d
authored
Jul 11, 2021
by
Ozzie Isaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #2048 (Display book title in reader)
parent
1bf065fd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
16 deletions
+18
-16
jinjia.py
cps/jinjia.py
+1
-4
detail.html
cps/templates/detail.html
+1
-1
read.html
cps/templates/read.html
+1
-1
readcbr.html
cps/templates/readcbr.html
+1
-1
readdjvu.html
cps/templates/readdjvu.html
+1
-1
readpdf.html
cps/templates/readpdf.html
+1
-1
readtxt.html
cps/templates/readtxt.html
+1
-1
web.py
cps/web.py
+11
-6
No files found.
cps/jinjia.py
View file @
aae81c3d
...
...
@@ -113,10 +113,7 @@ def yesno(value, yes, no):
@
jinjia
.
app_template_filter
(
'formatfloat'
)
def
formatfloat
(
value
,
decimals
=
1
):
formatedstring
=
'
%
d'
%
value
if
(
value
%
1
)
!=
0
:
formatedstring
=
(
'
%
s.
%
d'
%
(
formatedstring
,
(
value
%
1
)
*
10
**
decimals
))
.
rstrip
(
'0'
)
return
formatedstring
return
(
'{0:.'
+
str
(
decimals
)
+
'g}'
)
.
format
(
value
)
@
jinjia
.
app_template_filter
(
'formatseriesindex'
)
...
...
cps/templates/detail.html
View file @
aae81c3d
...
...
@@ -122,7 +122,7 @@
{% endif %}
{% if entry.series|length > 0 %}
<p>
{{_('Book')}} {{entry.series_index}} {{_('of')}}
<a
href=
"{{url_for('web.books_list', data='series', sort_param='stored', book_id=entry.series[0].id)}}"
>
{{entry.series[0].name}}
</a></p>
<p>
{{_('Book')}} {{entry.series_index
|formatfloat(2)
}} {{_('of')}}
<a
href=
"{{url_for('web.books_list', data='series', sort_param='stored', book_id=entry.series[0].id)}}"
>
{{entry.series[0].name}}
</a></p>
{% endif %}
{% if entry.languages.__len__() > 0 %}
...
...
cps/templates/read.html
View file @
aae81c3d
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
ePub Reader
</title>
<title>
{{_('epub Reader')}} | {{title}}
</title>
<meta
name=
"description"
content=
""
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
...
...
cps/templates/readcbr.html
View file @
aae81c3d
<!DOCTYPE html>
<html>
<head>
<title>
Comic Reader
</title>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
name=
"description"
content=
""
>
<title>
{{_('Comic Reader')}} | {{title}}
</title>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
...
...
cps/templates/readdjvu.html
View file @
aae81c3d
...
...
@@ -7,7 +7,7 @@
<link
type=
"text/css"
rel=
"stylesheet"
href=
"{{ url_for('static', filename='js/libs/djvu_html5/Djvu_html5.css') }}"
>
<title>
Djvu HTML5 browser demo
</title>
<title>
{{_('DJVU Reader')}} | {{title}}
</title>
<script
type=
"text/javascript"
language=
"javascript"
src=
"{{ url_for('static', filename='js/libs/djvu_html5/djvu_html5/djvu_html5.nocache.js') }}"
></script>
...
...
cps/templates/readpdf.html
View file @
aae81c3d
...
...
@@ -26,7 +26,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1"
>
<meta
name=
"google"
content=
"notranslate"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<title>
{{_('PDF
reader')
}}
</title>
<title>
{{_('PDF
Reader')}} | {{title
}}
</title>
<link
rel=
"stylesheet"
href=
"{{ url_for('static', filename='css/libs/viewer.css') }}"
>
...
...
cps/templates/readtxt.html
View file @
aae81c3d
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
{{_('
Basic txt Reader')
}}
</title>
<title>
{{_('
txt Reader')}} | {{title
}}
</title>
<meta
name=
"description"
content=
""
>
<meta
name=
"viewport"
content=
"width=device-width"
>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
...
...
cps/web.py
View file @
aae81c3d
...
...
@@ -1680,28 +1680,33 @@ def read_book(book_id, book_format):
ub
.
Bookmark
.
format
==
book_format
.
upper
()))
.
first
()
if
book_format
.
lower
()
==
"epub"
:
log
.
debug
(
u"Start epub reader for
%
d"
,
book_id
)
return
render_title_template
(
'read.html'
,
bookid
=
book_id
,
title
=
_
(
u"Read a Book"
)
,
bookmark
=
bookmark
)
return
render_title_template
(
'read.html'
,
bookid
=
book_id
,
title
=
book
.
title
,
bookmark
=
bookmark
)
elif
book_format
.
lower
()
==
"pdf"
:
log
.
debug
(
u"Start pdf reader for
%
d"
,
book_id
)
return
render_title_template
(
'readpdf.html'
,
pdffile
=
book_id
,
title
=
_
(
u"Read a Book"
)
)
return
render_title_template
(
'readpdf.html'
,
pdffile
=
book_id
,
title
=
book
.
title
)
elif
book_format
.
lower
()
==
"txt"
:
log
.
debug
(
u"Start txt reader for
%
d"
,
book_id
)
return
render_title_template
(
'readtxt.html'
,
txtfile
=
book_id
,
title
=
_
(
u"Read a Book"
)
)
return
render_title_template
(
'readtxt.html'
,
txtfile
=
book_id
,
title
=
book
.
title
)
elif
book_format
.
lower
()
==
"djvu"
:
log
.
debug
(
u"Start djvu reader for
%
d"
,
book_id
)
return
render_title_template
(
'readdjvu.html'
,
djvufile
=
book_id
,
title
=
_
(
u"Read a Book"
)
)
return
render_title_template
(
'readdjvu.html'
,
djvufile
=
book_id
,
title
=
book
.
title
)
else
:
for
fileExt
in
constants
.
EXTENSIONS_AUDIO
:
if
book_format
.
lower
()
==
fileExt
:
entries
=
calibre_db
.
get_filtered_book
(
book_id
)
log
.
debug
(
u"Start mp3 listening for
%
d"
,
book_id
)
return
render_title_template
(
'listenmp3.html'
,
mp3file
=
book_id
,
audioformat
=
book_format
.
lower
(),
title
=
_
(
u"Read a Book"
),
entry
=
entries
,
bookmark
=
bookmark
)
entry
=
entries
,
bookmark
=
bookmark
)
for
fileExt
in
[
"cbr"
,
"cbt"
,
"cbz"
]:
if
book_format
.
lower
()
==
fileExt
:
all_name
=
str
(
book_id
)
title
=
book
.
title
if
len
(
book
.
series
):
title
=
title
+
" - "
+
book
.
series
[
0
]
.
name
if
book
.
series_index
:
title
=
title
+
" #"
+
'{0:.2g}'
.
format
(
book
.
series_index
)
log
.
debug
(
u"Start comic reader for
%
d"
,
book_id
)
return
render_title_template
(
'readcbr.html'
,
comicfile
=
all_name
,
title
=
_
(
u"Read a Book"
)
,
return
render_title_template
(
'readcbr.html'
,
comicfile
=
all_name
,
title
=
title
,
extension
=
fileExt
)
log
.
debug
(
u"Oops! Selected book title is unavailable. File does not exist or is not accessible"
)
flash
(
_
(
u"Oops! Selected book title is unavailable. File does not exist or is not accessible"
),
category
=
"error"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment