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
0bcdbc4a
Commit
0bcdbc4a
authored
Dec 29, 2016
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix Search opds feed
Improvement OPDS feed for displaying covers
parent
f434511d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
42 deletions
+15
-42
feed.xml
cps/templates/feed.xml
+6
-9
index.xml
cps/templates/index.xml
+8
-28
osd.xml
cps/templates/osd.xml
+0
-4
web.py
cps/web.py
+1
-1
No files found.
cps/templates/feed.xml
View file @
0bcdbc4a
...
@@ -40,17 +40,14 @@
...
@@ -40,17 +40,14 @@
{% endfor %}
{% endfor %}
<summary>
{% if entry.comments[0] %}{{entry.comments[0].text|striptags}}{% endif %}
</summary>
<summary>
{% if entry.comments[0] %}{{entry.comments[0].text|striptags}}{% endif %}
</summary>
{% if entry.has_cover %}
{% if entry.has_cover %}
<link
rel=
"http://opds-spec.org/image"
<link
rel=
"http://opds-spec.org/image"
href=
"{{ url_for('feed_get_cover', cover_path=entry.path) }}"
type=
"image/jpg"
/>
href=
"{{ url_for('feed_get_cover', cover_path=entry.path) }}"
<link
rel=
"http://opds-spec.org/cover"
href=
"{{ url_for('feed_get_cover', cover_path=entry.path) }}"
type=
"image/jpg"
/>
type=
"image/jpg"
/>
<link
rel=
"http://opds-spec.org/image/thumbnail"
href=
"{{ url_for('feed_get_cover', cover_path=entry.path) }}"
type=
"image/jpg"
/>
<link
rel=
"http://opds-spec.org/image/thumbnail"
href=
"{{ url_for('feed_get_cover', cover_path=entry.path) }}"
type=
"image/jpg"
/>
{% endif %}
{% endif %}
{% for format in entry.data %}
{% for format in entry.data %}
<link
rel=
"http://opds-spec.org/acquisition"
<link
rel=
"http://opds-spec.org/acquisition"
href=
"{{ url_for('get_opds_download_link', book_id=entry.id, format=format.format|lower)}}"
href=
"{{ url_for('get_opds_download_link', book_id=entry.id, format=format.format|lower)}}"
{%
if
format.format|
lower =
=
"epub"
%}
length=
"{{format.uncompressed_size}}"
mtime=
"{{entry.timestamp}}"
{%
if
format.format|
lower =
=
"epub"
%}
type=
"application/epub+zip"
/>
type=
"application/epub+zip"
/>
{% else %}
{% else %}
type="application/x-mobipocket-ebook"/>
type="application/x-mobipocket-ebook"/>
...
...
cps/templates/index.xml
View file @
0bcdbc4a
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<feed
xmlns=
"http://www.w3.org/2005/Atom"
>
<feed
xmlns=
"http://www.w3.org/2005/Atom"
>
<id>
urn:uuid:2853dacf-ed79-42f5-8e8a-a7bb3d1ae6a2
</id>
<id>
urn:uuid:2853dacf-ed79-42f5-8e8a-a7bb3d1ae6a2
</id>
<link
rel=
"self"
<link
rel=
"self"
href=
"{{url_for('feed_index')}}"
type=
"application/atom+xml;profile=opds-catalog;kind=navigation"
/>
href=
"{{url_for('feed_index')}}"
<link
rel=
"start"
title=
"{{_('Start')}}"
href=
"{{url_for('feed_index')}}"
type=
"application/atom+xml;profile=opds-catalog;kind=navigation"
/>
type=
"application/atom+xml;profile=opds-catalog;kind=navigation"
/>
<link
rel=
"start"
<link
rel=
"search"
title=
"{{_('Search')}}"
href=
"{{url_for('feed_osd')}}"
title=
"{{_('Start')}}"
href=
"{{url_for('feed_index')}}"
type=
"application/atom+xml;profile=opds-catalog;kind=navigation"
/>
<link
rel=
"search"
title=
"{{_('Search')}}"
href=
"{{url_for('feed_osd')}}"
type=
"application/opensearchdescription+xml"
/>
type=
"application/opensearchdescription+xml"
/>
<title>
Calibre Web
</title>
<title>
Calibre Web
</title>
<author>
<author>
<name>
Calibre Web
</name>
<name>
Calibre Web
</name>
<uri>
https://github.com/janeczku/calibre-web
</uri>
<uri>
https://github.com/janeczku/calibre-web
</uri>
</author>
</author>
<entry>
<entry>
<title>
{{_('Hot Books')}}
</title>
<title>
{{_('Hot Books')}}
</title>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_hot')}}"
/>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_hot')}}"
/>
...
@@ -26,50 +18,38 @@
...
@@ -26,50 +18,38 @@
<id>
{{url_for('feed_hot')}}
</id>
<id>
{{url_for('feed_hot')}}
</id>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Rating.')}}
</content>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Rating.')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('New Books')}}
</title>
<title>
{{_('New Books')}}
</title>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_new')}}"
/>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_new')}}"
/>
<link
rel=
"http://opds-spec.org/sort/new"
<link
rel=
"http://opds-spec.org/sort/new"
href=
"{{url_for('feed_new')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
/>
href=
"{{url_for('feed_new')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
/>
<id>
{{url_for('feed_new')}}
</id>
<id>
{{url_for('feed_new')}}
</id>
<content
type=
"text"
>
{{_('The latest Books')}}
</content>
<content
type=
"text"
>
{{_('The latest Books')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Random Books')}}
</title>
<title>
{{_('Random Books')}}
</title>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_discover')}}"
/>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_discover')}}"
/>
<link
rel=
"http://opds-spec.org/featured"
<link
rel=
"http://opds-spec.org/featured"
href=
"{{url_for('feed_discover')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
/>
href=
"{{url_for('feed_discover')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
/>
<id>
{{url_for('feed_discover')}}
</id>
<id>
{{url_for('feed_discover')}}
</id>
<content
type=
"text"
>
{{_('Show Random Books')}}
</content>
<content
type=
"text"
>
{{_('Show Random Books')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Authors')}}
</title>
<title>
{{_('Authors')}}
</title>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_authorindex')}}"
/>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_authorindex')}}"
/>
<link
rel=
"subsection"
<link
rel=
"subsection"
href=
"{{url_for('feed_authorindex')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"
/>
href=
"{{url_for('feed_authorindex')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"
/>
<id>
{{url_for('feed_authorindex')}}
</id>
<id>
{{url_for('feed_authorindex')}}
</id>
<content
type=
"text"
>
{{_('Books ordered by Author')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by Author')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Category list')}}
</title>
<title>
{{_('Category list')}}
</title>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_categoryindex')}}"
/>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_categoryindex')}}"
/>
<link
rel=
"subsection"
<link
rel=
"subsection"
href=
"{{url_for('feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"
/>
href=
"{{url_for('feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"
/>
<id>
{{url_for('feed_categoryindex')}}
</id>
<id>
{{url_for('feed_categoryindex')}}
</id>
<content
type=
"text"
>
{{_('Books ordered by category')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by category')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Series list')}}
</title>
<title>
{{_('Series list')}}
</title>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_seriesindex')}}"
/>
<link
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=acquisition"
href=
"{{url_for('feed_seriesindex')}}"
/>
<link
rel=
"subsection"
<link
rel=
"subsection"
href=
"{{url_for('feed_seriesindex')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"
/>
href=
"{{url_for('feed_seriesindex')}}"
type=
"application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"
/>
<id>
{{url_for('feed_seriesindex')}}
</id>
<id>
{{url_for('feed_seriesindex')}}
</id>
<content
type=
"text"
>
{{_('Books ordered by series')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by series')}}
</content>
</entry>
</entry>
...
...
cps/templates/osd.xml
View file @
0bcdbc4a
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription
xmlns=
"http://a9.com/-/spec/opensearch/1.1/"
>
<OpenSearchDescription
xmlns=
"http://a9.com/-/spec/opensearch/1.1/"
>
<LongName>
Calibre Web
</LongName>
<LongName>
Calibre Web
</LongName>
<ShortName>
Calibre Web
</ShortName>
<ShortName>
Calibre Web
</ShortName>
<Description>
Calibre Web ebook catalog
</Description>
<Description>
Calibre Web ebook catalog
</Description>
<Developer>
janeczku
</Developer>
<Developer>
janeczku
</Developer>
<Contact>
https://github.com/janeczku/calibre-web
</Contact>
<Contact>
https://github.com/janeczku/calibre-web
</Contact>
<Url
type=
"text/html"
<Url
type=
"text/html"
template=
"{{url_for('search')}}?query={searchTerms}"
/>
template=
"{{url_for('search')}}?query={searchTerms}"
/>
<Url
type=
"application/atom+xml"
<Url
type=
"application/atom+xml"
template=
"{{url_for('feed_search')}}?query={searchTerms}"
/>
template=
"{{url_for('feed_search')}}?query={searchTerms}"
/>
<SyndicationRight>
open
</SyndicationRight>
<SyndicationRight>
open
</SyndicationRight>
<Language>
de-DE
</Language>
<Language>
de-DE
</Language>
<OutputEncoding>
UTF-8
</OutputEncoding>
<OutputEncoding>
UTF-8
</OutputEncoding>
...
...
cps/web.py
View file @
0bcdbc4a
...
@@ -452,7 +452,7 @@ def feed_search():
...
@@ -452,7 +452,7 @@ def feed_search():
db
.
Books
.
authors
.
any
(
db
.
Authors
.
name
.
like
(
"
%
"
+
term
+
"
%
"
)),
db
.
Books
.
authors
.
any
(
db
.
Authors
.
name
.
like
(
"
%
"
+
term
+
"
%
"
)),
db
.
Books
.
title
.
like
(
"
%
"
+
term
+
"
%
"
)))
.
filter
(
filter
)
.
all
()
db
.
Books
.
title
.
like
(
"
%
"
+
term
+
"
%
"
)))
.
filter
(
filter
)
.
all
()
xml
=
render_template
(
'feed.xml'
,
searchterm
=
term
,
entries
=
entries
,
Last_Updated
=
Last_Updated
)
xml
=
render_template
(
'feed.xml'
,
searchterm
=
term
,
entries
=
entries
)
else
:
else
:
xml
=
render_template
(
'feed.xml'
,
searchterm
=
""
)
xml
=
render_template
(
'feed.xml'
,
searchterm
=
""
)
response
=
make_response
(
xml
)
response
=
make_response
(
xml
)
...
...
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