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
88f31dda
Commit
88f31dda
authored
Nov 07, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #1034
parent
a7ab7fcf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
15 deletions
+16
-15
opds.py
cps/opds.py
+3
-2
feed.xml
cps/templates/feed.xml
+1
-1
index.xml
cps/templates/index.xml
+12
-12
No files found.
cps/opds.py
View file @
88f31dda
...
@@ -219,7 +219,7 @@ def feed_series(book_id):
...
@@ -219,7 +219,7 @@ def feed_series(book_id):
@
requires_basic_auth_if_no_ano
@
requires_basic_auth_if_no_ano
def
feed_shelfindex
(
public
):
def
feed_shelfindex
(
public
):
off
=
request
.
args
.
get
(
"offset"
)
or
0
off
=
request
.
args
.
get
(
"offset"
)
or
0
if
public
is
not
0
:
if
public
!=
0
:
shelf
=
g
.
public_shelfes
shelf
=
g
.
public_shelfes
number
=
len
(
shelf
)
number
=
len
(
shelf
)
else
:
else
:
...
@@ -261,9 +261,10 @@ def opds_download_link(book_id, book_format):
...
@@ -261,9 +261,10 @@ def opds_download_link(book_id, book_format):
return
get_download_link
(
book_id
,
book_format
)
return
get_download_link
(
book_id
,
book_format
)
@
opds
.
route
(
"/ajax/book/<string:uuid>/<library>"
)
@
opds
.
route
(
"/ajax/book/<string:uuid>"
)
@
opds
.
route
(
"/ajax/book/<string:uuid>"
)
@
requires_basic_auth_if_no_ano
@
requires_basic_auth_if_no_ano
def
get_metadata_calibre_companion
(
uuid
):
def
get_metadata_calibre_companion
(
uuid
,
library
):
entry
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
uuid
.
like
(
"
%
"
+
uuid
+
"
%
"
))
.
first
()
entry
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
uuid
.
like
(
"
%
"
+
uuid
+
"
%
"
))
.
first
()
if
entry
is
not
None
:
if
entry
is
not
None
:
js
=
render_template
(
'json.txt'
,
entry
=
entry
)
js
=
render_template
(
'json.txt'
,
entry
=
entry
)
...
...
cps/templates/feed.xml
View file @
88f31dda
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
{% for entry in entries %}
{% for entry in entries %}
<entry>
<entry>
<title>
{{entry.title}}
</title>
<title>
{{entry.title}}
</title>
<id>
{{entry.uuid}}
</id>
<id>
urn:uuid:
{{entry.uuid}}
</id>
<updated>
{{entry.atom_timestamp}}
</updated>
<updated>
{{entry.atom_timestamp}}
</updated>
{% if entry.authors.__len__() > 0 %}
{% if entry.authors.__len__() > 0 %}
<author>
<author>
...
...
cps/templates/index.xml
View file @
88f31dda
...
@@ -15,28 +15,28 @@
...
@@ -15,28 +15,28 @@
</author>
</author>
<entry>
<entry>
<title>
{{_('Hot Books')}}
</title>
<title>
{{_('Hot Books')}}
</title>
<link
rel=
"http://opds-spec.org/sort/popular"
href=
"{{url_for('opds.feed_hot')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_hot')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_hot')}}
</id>
<id>
{{url_for('opds.feed_hot')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Downloads.')}}
</content>
<content
type=
"text"
>
{{_('Popular publications from this catalog based on Downloads.')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Best rated Books')}}
</title>
<title>
{{_('Best rated Books')}}
</title>
<link
rel=
"http://opds-spec.org/recommended"
href=
"{{url_for('opds.feed_best_rated')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_best_rated')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_best_rated')}}
</id>
<id>
{{url_for('opds.feed_best_rated')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<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
rel=
"http://opds-spec.org/sort/new"
href=
"{{url_for('opds.feed_new')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_new')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_new')}}
</id>
<id>
{{url_for('opds.feed_new')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<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
rel=
"http://opds-spec.org/featured"
href=
"{{url_for('opds.feed_discover')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_discover')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_discover')}}
</id>
<id>
{{url_for('opds.feed_discover')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Show Random Books')}}
</content>
<content
type=
"text"
>
{{_('Show Random Books')}}
</content>
...
@@ -44,14 +44,14 @@
...
@@ -44,14 +44,14 @@
{% if not current_user.is_anonymous %}
{% if not current_user.is_anonymous %}
<entry>
<entry>
<title>
{{_('Read Books')}}
</title>
<title>
{{_('Read Books')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('opds.feed_read_books')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_read_books')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_read_books')}}
</id>
<id>
{{url_for('opds.feed_read_books')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Read Books')}}
</content>
<content
type=
"text"
>
{{_('Read Books')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Unread Books')}}
</title>
<title>
{{_('Unread Books')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('opds.feed_unread_books')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_unread_books')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_unread_books')}}
</id>
<id>
{{url_for('opds.feed_unread_books')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Unread Books')}}
</content>
<content
type=
"text"
>
{{_('Unread Books')}}
</content>
...
@@ -59,35 +59,35 @@
...
@@ -59,35 +59,35 @@
{% endif %}
{% endif %}
<entry>
<entry>
<title>
{{_('Authors')}}
</title>
<title>
{{_('Authors')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('opds.feed_authorindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_authorindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_authorindex')}}
</id>
<id>
{{url_for('opds.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>
<entry>
<title>
{{_('Publishers')}}
</title>
<title>
{{_('Publishers')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('opds.feed_publisherindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_publisherindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_publisherindex')}}
</id>
<id>
{{url_for('opds.feed_publisherindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by publisher')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by publisher')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Category list')}}
</title>
<title>
{{_('Category list')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('opds.feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_categoryindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_categoryindex')}}
</id>
<id>
{{url_for('opds.feed_categoryindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<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
rel=
"subsection"
href=
"{{url_for('opds.feed_seriesindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_seriesindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_seriesindex')}}
</id>
<id>
{{url_for('opds.feed_seriesindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books ordered by series')}}
</content>
<content
type=
"text"
>
{{_('Books ordered by series')}}
</content>
</entry>
</entry>
<entry>
<entry>
<title>
{{_('Public Shelves')}}
</title>
<title>
{{_('Public Shelves')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('opds.feed_shelfindex', public="
public"
)}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_shelfindex', public='public'
)}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_shelfindex', public="public")}}
</id>
<id>
{{url_for('opds.feed_shelfindex', public="public")}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_('Books organized in public shelfs, visible to everyone')}}
</content>
<content
type=
"text"
>
{{_('Books organized in public shelfs, visible to everyone')}}
</content>
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
{% if not current_user.is_anonymous %}
{% if not current_user.is_anonymous %}
<entry>
<entry>
<title>
{{_('Your Shelves')}}
</title>
<title>
{{_('Your Shelves')}}
</title>
<link
rel=
"subsection"
href=
"{{url_for('opds.feed_shelfindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<link
href=
"{{url_for('opds.feed_shelfindex')}}"
type=
"application/atom+xml;profile=opds-catalog"
/>
<id>
{{url_for('opds.feed_shelfindex')}}
</id>
<id>
{{url_for('opds.feed_shelfindex')}}
</id>
<updated>
{{ current_time }}
</updated>
<updated>
{{ current_time }}
</updated>
<content
type=
"text"
>
{{_("User's own shelfs, only visible to the current user himself")}}
</content>
<content
type=
"text"
>
{{_("User's own shelfs, only visible to the current user himself")}}
</content>
...
...
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