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
75fb7c2e
Commit
75fb7c2e
authored
May 09, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowing upload extensions (#1119)
parent
51f12c51
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
admin.py
cps/admin.py
+4
-3
config_sql.py
cps/config_sql.py
+1
-1
web.py
cps/web.py
+2
-0
No files found.
cps/admin.py
View file @
75fb7c2e
...
...
@@ -542,7 +542,7 @@ def _configuration_oauth_helper(to_save):
"oauth_client_secret"
:
to_save
[
"config_"
+
str
(
element
[
'id'
])
+
"_oauth_client_secret"
],
"active"
:
element
[
"active"
]})
def
_configuration_logfile_helper
(
gdriveError
,
to_save
):
def
_configuration_logfile_helper
(
to_save
,
gdriveError
):
reboot_required
=
False
reboot_required
|=
_config_int
(
to_save
,
"config_log_level"
)
reboot_required
|=
_config_string
(
to_save
,
"config_logfile"
)
...
...
@@ -615,13 +615,11 @@ def _configuration_update_helper():
db_change
=
False
to_save
=
request
.
form
.
to_dict
()
db_change
|=
_config_string
(
to_save
,
"config_calibre_dir"
)
# Google drive setup
gdriveError
=
_configuration_gdrive_helper
(
to_save
)
reboot_required
|=
_config_int
(
to_save
,
"config_port"
)
reboot_required
|=
_config_string
(
to_save
,
"config_keyfile"
)
...
...
@@ -638,6 +636,9 @@ def _configuration_update_helper():
reboot_required
|=
_config_checkbox_int
(
to_save
,
"config_kobo_sync"
)
_config_checkbox_int
(
to_save
,
"config_kobo_proxy"
)
_config_string
(
to_save
,
"config_upload_formats"
)
constants
.
EXTENSIONS_UPLOAD
=
[
x
.
lstrip
()
.
rstrip
()
for
x
in
config
.
config_upload_formats
.
split
(
','
)]
_config_string
(
to_save
,
"config_calibre"
)
_config_string
(
to_save
,
"config_converterpath"
)
_config_string
(
to_save
,
"config_kepubifypath"
)
...
...
cps/config_sql.py
View file @
75fb7c2e
...
...
@@ -291,7 +291,7 @@ class _ConfigSQL(object):
db_file
=
os
.
path
.
join
(
self
.
config_calibre_dir
,
'metadata.db'
)
have_metadata_db
=
os
.
path
.
isfile
(
db_file
)
self
.
db_configured
=
have_metadata_db
constants
.
EXTENSIONS_UPLOAD
=
[
x
.
lstrip
()
.
rstrip
()
for
x
in
self
.
config_upload_formats
.
split
(
','
)]
logger
.
setup
(
self
.
config_logfile
,
self
.
config_log_level
)
def
save
(
self
):
...
...
cps/web.py
View file @
75fb7c2e
...
...
@@ -1241,6 +1241,8 @@ def serve_book(book_id, book_format, anyname):
def
download_link
(
book_id
,
book_format
,
anyname
):
if
"Kobo"
in
request
.
headers
.
get
(
'User-Agent'
):
client
=
"kobo"
else
:
client
=
""
return
get_download_link
(
book_id
,
book_format
,
client
)
...
...
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