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
1ac9b3d8
Commit
1ac9b3d8
authored
Sep 30, 2018
by
Virgil Grigoras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update OPDS-part to display publishers
parent
6a007ec8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
feed.xml
cps/templates/feed.xml
+3
-0
index.xml
cps/templates/index.xml
+8
-1
web.py
cps/web.py
+20
-0
No files found.
cps/templates/feed.xml
View file @
1ac9b3d8
...
@@ -43,6 +43,9 @@
...
@@ -43,6 +43,9 @@
<author>
<author>
<name>
{{entry.authors[0].name}}
</name>
<name>
{{entry.authors[0].name}}
</name>
</author>
</author>
<publisher>
<name>
{{entry.publishers[0].name}}
</name>
</publisher>
<dcterms:language>
{{entry.language}}
</dcterms:language>
<dcterms:language>
{{entry.language}}
</dcterms:language>
{% for tag in entry.tags %}
{% for tag in entry.tags %}
<category
scheme=
"http://www.bisg.org/standards/bisac_subject/index.html"
<category
scheme=
"http://www.bisg.org/standards/bisac_subject/index.html"
...
...
cps/templates/index.xml
View file @
1ac9b3d8
...
@@ -61,7 +61,14 @@
...
@@ -61,7 +61,14 @@
<id>
{{url_for('feed_authorindex')}}
</id>
<id>
{{url_for('feed_authorindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by Author')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by Author')}}
</content>
</entry>
</entry>
<entry>
<title>
{{_('Publishers')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('feed_publisherindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('feed_publisherindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by publisher')}}
</content>
</entry>
<entry>
<entry>
<title>
{{_('Category list')}}
</title>
<title>
{{_('Category list')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
rel=
"subsection"
href=
"{{url_for('feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
...
...
cps/web.py
View file @
1ac9b3d8
...
@@ -752,6 +752,26 @@ def feed_author(book_id):
...
@@ -752,6 +752,26 @@ def feed_author(book_id):
return
render_xml_template
(
'feed.xml'
,
entries
=
entries
,
pagination
=
pagination
)
return
render_xml_template
(
'feed.xml'
,
entries
=
entries
,
pagination
=
pagination
)
@
app
.
route
(
"/opds/publisher"
)
@
requires_basic_auth_if_no_ano
def
feed_publisherindex
():
off
=
request
.
args
.
get
(
"offset"
)
or
0
entries
=
db
.
session
.
query
(
db
.
Publishers
)
.
join
(
db
.
books_publishers_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_publishers_link.publisher'
)
.
order_by
(
db
.
Publishers
.
sort
)
.
limit
(
config
.
config_books_per_page
)
.
offset
(
off
)
pagination
=
Pagination
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
config
.
config_books_per_page
,
len
(
db
.
session
.
query
(
db
.
Publishers
)
.
all
()))
return
render_xml_template
(
'feed.xml'
,
listelements
=
entries
,
folder
=
'feed_publisher'
,
pagination
=
pagination
)
@
app
.
route
(
"/opds/publisher/<int:book_id>"
)
@
requires_basic_auth_if_no_ano
def
feed_publisher
(
book_id
):
off
=
request
.
args
.
get
(
"offset"
)
or
0
entries
,
__
,
pagination
=
fill_indexpage
((
int
(
off
)
/
(
int
(
config
.
config_books_per_page
))
+
1
),
db
.
Books
,
db
.
Books
.
publishers
.
any
(
db
.
Publishers
.
id
==
book_id
),
[
db
.
Books
.
timestamp
.
desc
()])
return
render_xml_template
(
'feed.xml'
,
entries
=
entries
,
pagination
=
pagination
)
@
app
.
route
(
"/opds/category"
)
@
app
.
route
(
"/opds/category"
)
@
requires_basic_auth_if_no_ano
@
requires_basic_auth_if_no_ano
def
feed_categoryindex
():
def
feed_categoryindex
():
...
...
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