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
cc7dcfb3
Commit
cc7dcfb3
authored
Nov 01, 2018
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Updater
Bugfix author in opds-feed
parent
c1818e8f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
helper.py
cps/helper.py
+2
-5
feed.xml
cps/templates/feed.xml
+6
-5
web.py
cps/web.py
+5
-4
No files found.
cps/helper.py
100755 → 100644
View file @
cc7dcfb3
...
...
@@ -399,15 +399,12 @@ class Updater(threading.Thread):
z
.
extractall
(
tmp_dir
)
self
.
status
=
4
self
.
update_source
(
os
.
path
.
join
(
tmp_dir
,
os
.
path
.
splitext
(
fname
)[
0
]),
ub
.
config
.
get_main_dir
)
self
.
status
=
5
db
.
session
.
close
()
db
.
engine
.
dispose
()
ub
.
session
.
close
()
ub
.
engine
.
dispose
()
self
.
status
=
6
time
.
sleep
(
2
)
server
.
Server
.
setRestartTyp
(
True
)
server
.
Server
.
stopServer
()
self
.
status
=
7
time
.
sleep
(
2
)
except
requests
.
exceptions
.
HTTPError
as
ex
:
logging
.
getLogger
(
'cps.web'
)
.
info
(
u'HTTP Error'
+
' '
+
str
(
ex
))
self
.
status
=
8
...
...
cps/templates/feed.xml
View file @
cc7dcfb3
...
...
@@ -43,11 +43,12 @@
<title>
{{entry.title}}
</title>
<id>
{{entry.uuid}}
</id>
<updated>
{{entry.atom_timestamp}}
</updated>
<author>
<name>
{{entry.authors[0].name}}
</name>
</author>
{% if publishers.__len__() > 0 %}
{% if entry.authors.__len__() > 0 %}
<author>
<name>
{{entry.authors[0].name}}
</name>
</author>
{% endif %}
{% if entry.publishers.__len__() > 0 %}
<publisher>
<name>
{{entry.publishers[0].name}}
</name>
</publisher>
...
...
cps/web.py
View file @
cc7dcfb3
...
...
@@ -1289,9 +1289,9 @@ def get_updater_status():
"1"
:
_
(
u'Requesting update package'
),
"2"
:
_
(
u'Downloading update package'
),
"3"
:
_
(
u'Unzipping update package'
),
"4"
:
_
(
u'
Files are replaced
'
),
"4"
:
_
(
u'
Replacing files
'
),
"5"
:
_
(
u'Database connections are closed'
),
"6"
:
_
(
u'S
erver is stopped
'
),
"6"
:
_
(
u'S
topping server
'
),
"7"
:
_
(
u'Update finished, please press okay and reload page'
),
"8"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'HTTP Error'
),
"9"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'Connection error'
),
...
...
@@ -1305,8 +1305,9 @@ def get_updater_status():
elif
request
.
method
==
"GET"
:
try
:
status
[
'status'
]
=
helper
.
updater_thread
.
get_update_status
()
except
Exception
:
status
[
'status'
]
=
11
except
Exception
as
e
:
app
.
logger
.
exception
(
e
)
status
[
'status'
]
=
7
return
json
.
dumps
(
status
)
...
...
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