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
0c27ff11
Commit
0c27ff11
authored
Apr 01, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Updater
parent
4eacb212
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
admin.py
cps/admin.py
+2
-1
updater.py
cps/updater.py
+3
-0
web.py
cps/web.py
+3
-3
No files found.
cps/admin.py
View file @
0c27ff11
...
...
@@ -964,7 +964,8 @@ def get_updater_status():
"8"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'HTTP Error'
),
"9"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'Connection error'
),
"10"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'Timeout while establishing connection'
),
"11"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'General error'
)
"11"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'General error'
),
"12"
:
_
(
u'Update failed:'
)
+
u' '
+
_
(
u'Update File Could Not be Saved in Temp Dir'
)
}
status
[
'text'
]
=
text
updater_thread
.
status
=
0
...
...
cps/updater.py
View file @
0c27ff11
...
...
@@ -114,6 +114,9 @@ class Updater(threading.Thread):
except
(
requests
.
exceptions
.
RequestException
,
zipfile
.
BadZipFile
):
self
.
status
=
11
log
.
info
(
u'General error'
)
except
(
IOError
,
OSError
):
self
.
status
=
12
log
.
info
(
u'Update File Could Not be Saved in Temp Dir'
)
self
.
pause
()
return
False
...
...
cps/web.py
View file @
0c27ff11
...
...
@@ -1039,11 +1039,11 @@ def serve_book(book_id, book_format, anyname):
else
:
return
send_from_directory
(
os
.
path
.
join
(
config
.
config_calibre_dir
,
book
.
path
),
data
.
name
+
"."
+
book_format
)
@
web
.
route
(
"/download/<int:book_id>/<book_format>"
)
@
web
.
route
(
"/download/<int:book_id>/<book_format>"
,
defaults
=
{
'anyname'
:
'None'
})
@
web
.
route
(
"/download/<int:book_id>/<book_format>
/<anyname>
"
)
@
login_required_if_no_ano
@
download_required
def
download_link
(
book_id
,
book_format
):
def
download_link
(
book_id
,
book_format
,
anyname
):
return
get_download_link
(
book_id
,
book_format
.
lower
())
...
...
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