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
8759edd5
Commit
8759edd5
authored
Jan 14, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calibre-companion now working (#79)
parent
799d54bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
json.txt
cps/templates/json.txt
+8
-2
web.py
cps/web.py
+1
-1
No files found.
cps/templates/json.txt
View file @
8759edd5
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
"{{lang.lang_code}}"{% if not loop.last %},{% endif %}
"{{lang.lang_code}}"{% if not loop.last %},{% endif %}
{% endfor %}
{% endfor %}
],
],
"comments": "{% if entry.comments|length > 0 %}{{entry.comments[0].text
|safe}}{% endif %}",
"comments": "{% if entry.comments|length > 0 %}{{entry.comments[0].text
.replace('"', '\\"')|safe}}{% endif %}",
"tags": [
"tags": [
{% for tag in entry.tags %}
{% for tag in entry.tags %}
"{{tag.name}}"{% if not loop.last %},{% endif %}
"{{tag.name}}"{% if not loop.last %},{% endif %}
...
@@ -38,11 +38,17 @@
...
@@ -38,11 +38,17 @@
"main_format": {
"main_format": {
"{{entry.data[0].format|lower}}": "/download/{{entry.id}}/{{entry.data[0].format|lower}}"
"{{entry.data[0].format|lower}}": "/download/{{entry.id}}/{{entry.data[0].format|lower}}"
},
},
"rating":{% if entry.ratings.__len__() > 0 %} "{{entry.ratings[0].rating}}.0"{% else %}0.0{% endif %},
"authors": [
"authors": [
{% for author in entry.authors %}
{% for author in entry.authors %}
"{{author.name}}"{% if not loop.last %},{% endif %}
"{{author.name}}"{% if not loop.last %},{% endif %}
{% endfor %}
{% endfor %}
],
],
"other_formats": {},
"other_formats": {
{% if entry.data.__len__() > 1 %}
{% for format in entry.data[1:] %}
"{{format.format|lower}}": "/download/{{entry.id}}/{{format.format|lower}}"{% if not loop.last %},{% endif %}
{% endfor %}
{% endif %} },
"title_sort": "{{entry.sort}}"
"title_sort": "{{entry.sort}}"
}
}
\ No newline at end of file
cps/web.py
View file @
8759edd5
...
@@ -638,7 +638,7 @@ def get_metadata_calibre_companion(uuid):
...
@@ -638,7 +638,7 @@ def get_metadata_calibre_companion(uuid):
if
entry
is
not
None
:
if
entry
is
not
None
:
js
=
render_template
(
'json.txt'
,
entry
=
entry
)
js
=
render_template
(
'json.txt'
,
entry
=
entry
)
response
=
make_response
(
js
)
response
=
make_response
(
js
)
response
.
headers
[
"Content-Type"
]
=
"application/json"
response
.
headers
[
"Content-Type"
]
=
"application/json
; charset=utf-8
"
return
response
return
response
else
:
else
:
return
""
return
""
...
...
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