Compare commits

...

2852 Commits

Author SHA1 Message Date
Ozzie Isaacs ab11919c0b Merge remote-tracking branch 'Synctoken/fix/kobo-sync-token' 2024-05-12 17:56:49 +02:00
Ozzie Isaacs 58c269881f Merge remote-tracking branch 'barnesnnoble/db-barnesnoble' 2024-05-12 09:03:40 +02:00
Ozzie Isaacs 6760d6971c Fix for #2983 (visible OPDS categories reflect settings in web UI)
Merge branch 'feature/OPDS-access'
2024-05-12 08:57:55 +02:00
Kreeblah ad05534ed2
Add support for barnesnoble identifier 2024-05-11 23:56:37 -07:00
Ozzie Isaacs ee451fb236 Testrun 2024-05-12 08:56:20 +02:00
Ozzie Isaacs ab13fcf60c Merge remote-tracking branch 'origin/feature/OPDS-access' into feature/OPDS-access 2024-05-11 18:37:10 +02:00
Ozzie Isaacs 6f60ec7b99 Change order of imports for goodreads to make import error message clear agan 2024-05-11 18:27:35 +02:00
Ozzie Isaacs 894fd9d30a get rid of apscheduler timezone warning 2024-05-11 18:21:03 +02:00
Ozzie Isaacs 2b1efdb50e Bugfixes opds feed 2024-05-11 14:26:43 +02:00
Ozzie Isaacs fc9a9cb9ac Fix for #3016 (Parsing lubimyczytac: Tags instead of categories are taken, translator is appended to description) 2024-05-11 09:03:22 +02:00
Ozzie Isaacs e99be72ff7 Merge branch 'Develop' into feature/OPDS-access
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2024-05-11 07:12:46 +02:00
Ozzie Isaacs f1ceff2b52 Merge branch 'master' into Develop (goodreads) 2024-05-11 07:11:22 +02:00
Ozzie Isaacs 7e85894b3a Bugfix for goodreads (html formated info for authors now visible) 2024-05-11 07:10:41 +02:00
Ozzie Isaacs 5c49c8cdd7 Fix for Flask-SimpleLDAP 2.0.0 2024-05-10 20:23:41 +02:00
Ozzie Isaacs c8c3b3cba3 Fix for goodreads not working anymore (due to blocked requests calls by goodreads.com) 2024-05-10 15:24:24 +02:00
Ozzie Isaacs 4911843146 Bugfix for flask-ldap 2.0.0 2024-05-10 11:30:47 +02:00
Ozzie Isaacs 2c37546598 Code cosmetics 2024-05-10 10:41:04 +02:00
Ozzie Isaacs 25a875b628 Fix for goodreads blocking "requests" 2024-05-10 09:42:44 +02:00
Ozzie Isaacs 506f0a33cf Merge branch 'master' into Develop (apply fix for #3050) 2024-05-10 09:06:11 +02:00
Ozzie Isaacs 921caf6716 Fix for #3050 (metadata extraction for cb7 files not working) 2024-05-10 09:05:31 +02:00
Ozzie Isaacs 60ed1904f5 testrun 2024-05-10 09:04:50 +02:00
Ozzie Isaacs cb62d36e44 Bugfix for visibility opds feed 2024-05-07 08:27:55 +02:00
Ozzie Isaacs 737d758362 Return 404 if current element is not visible 2024-05-07 07:30:57 +02:00
Ozzie Isaacs 8e27912ff5 Merge branch 'master' into Develop
Bugfix for too new lxml
2024-05-07 07:16:54 +02:00
Ozzie Isaacs 3a603cec22 Handle error on uploading a book with lxml too new and no bleach, nh3 installation 2024-05-05 11:18:31 +02:00
eggy b1d7badef4 fix: change b64-encoded token to unicode string 2024-05-02 03:06:53 -04:00
Ozzie Isaacs e591211b57 Fix for #3037 (catch OError on detect epub layout) 2024-04-27 07:22:58 +02:00
Ozzie Isaacs a305c35de4 Merge remote-tracking branch 'it/patch-1' 2024-04-27 07:22:23 +02:00
growfrow 51d306b11d chore: fix some typos in comments
Signed-off-by: growfrow <growfrow@outlook.com>
2024-04-20 20:49:56 +02:00
mapi68 abb418fe86
Update messages.po 2024-04-17 07:45:40 +02:00
Ozzie Isaacs 0925f34557 Merge remote-tracking branch 'caliblur/issue/caliBlur-3002' 2024-04-07 18:51:00 +02:00
Ozzie Isaacs 15952a764c Fix for #3021 (speed of calculating number of pages) 2024-04-07 18:49:18 +02:00
Ozzie Isaacs fcc95bd895 Improvements for password verify (addresses: https://github.com/iiab/calibre-web/pull/138) 2024-03-10 16:39:51 +01:00
Ghighi Eftimie 964e7de920 fixes 3002 2024-03-06 15:42:10 +02:00
Ozzie Isaacs 14b578dd3a Implement correct password verification of Umlaunts, kyrillic, greek.. charactersets, CJK-Characters, and special characters (#2964) 2024-02-29 12:08:58 +01:00
Ozzie Isaacs becb84a73d Finish Fix_Umlauts 2024-02-29 12:06:48 +01:00
Ozzie Isaacs c901ccbb01 Improved js password strength check
Improved check of CJK-Characters
2024-02-29 11:48:07 +01:00
Ozzie Isaacs f987fb0aba Fixed recognition of capital umlauts 2024-02-27 19:48:33 +01:00
Ozzie Isaacs c30460d76b Merge branch 'Develop'
- Back function for delete and edit books
- configure ratelimiter backend possible
- embed metadata during send to ereader
- bugfixes split library
- updated requirements
2024-02-27 06:03:54 +01:00
Ozzie Isaacs 97380b4b3f Updated teststatus 2024-02-27 06:01:11 +01:00
Ozzie Isaacs 4fbd064b85 Merge remote-tracking branch 'origin/back' into Develop 2024-02-26 18:42:48 +01:00
Ozzie Isaacs abbd9a5888 Revert logging line termination feature 2024-02-26 18:07:24 +01:00
Ozzie Isaacs e860b4e097 Back function implemented for delete book and edit book 2024-02-26 15:07:59 +01:00
Ozzie Isaacs 23a8a4657d Merge branch 'master' into Develop
(Fix for #3005 and #2993)
2024-02-25 20:07:40 +01:00
Ozzie Isaacs b38a1b2298 Admin can now force full sync for users (fix for #2993 2024-02-25 20:03:38 +01:00
Ozzie Isaacs 0ebfba8d05 Added blobs to csp for reader page (fix for #3005) 2024-02-25 19:32:04 +01:00
Ozzie Isaacs 990ad8d72d Update Requirements 2024-02-25 16:11:57 +01:00
Ozzie Isaacs c3fc125501 Added command line option or overwriting limiter backend
Added logger functions to remove newlines in messages
CalibreTask has now a default name
2024-02-25 16:02:01 +01:00
Ozzie Isaacs 3c4ed0de1a Added ratelimiterbackends 2024-02-25 09:00:49 +01:00
Ozzie Isaacs 117c92233d Added sending email to embed metadata text
Updated test result
2024-02-25 06:54:35 +01:00
Ozzie Isaacs 2ba14acf4f Merge branch 'master' into Develop
# Conflicts:
#	cps/helper.py
2024-02-24 14:51:53 +01:00
Ozzie Isaacs 80a2d07009 fix embed metadata, split library and download file / convert files 2024-02-24 14:48:56 +01:00
Ozzie Isaacs ff9e1ed7c8 Implemented embed metadata on send to ereader 2024-02-24 13:59:49 +01:00
Ozzie Isaacs 8e5bee5352 Merge remote-tracking branch 'embed_metadata/embed_metadata_on_send' into Develop 2024-02-18 14:48:04 +01:00
Ozzie Isaacs d659430116 Bugfix view None ratings caused error 500 in certain cases 2024-02-18 14:17:43 +01:00
Ozzie Isaacs 859dac462b Update Teststatus 2024-02-18 13:29:03 +01:00
Ozzie Isaacs 2bea4dbd06 Show List with no file formats available
Bugfix save order of format list view
2024-02-17 11:13:49 +01:00
Ozzie Isaacs 0180b4b6b5 Better error handling on next parameter 2024-02-12 20:58:26 +01:00
Ozzie Isaacs 2bfb02c448 Updated requirements
Updated testresults
2024-02-11 07:31:57 +01:00
Ozzie Isaacs 4864254e37 Merge branch 'Develop'
# Conflicts:
#	cps/config_sql.py
2024-02-10 10:55:02 +01:00
Ozzie Isaacs 09dce28a0e Merge remote-tracking branch 'embed_metadata/embed_metadata_on_convert' into Develop 2024-02-10 10:54:29 +01:00
Ozzie Isaacs e55d09d8bb
Merge branch 'Develop' into embed_metadata_on_convert 2024-02-10 10:52:16 +01:00
Ozzie Isaacs 92c162b2fd Merge remote-tracking branch 'embed_metadata/embed_metadata_on_download'
# Conflicts:
#	cps/helper.py
#	cps/tasks/convert.py
#	cps/templates/config_edit.html
2024-02-10 10:49:09 +01:00
Ozzie Isaacs 57fb5001e2 Merge branch 'Develop' 2024-02-10 10:43:58 +01:00
Ozzie Isaacs 64e5314148 Merge remote-tracking branch 'identifier/master' into Develop 2024-02-10 10:31:57 +01:00
Ozzie Isaacs 873602a5c9 Deleted unused code 2024-02-10 10:30:41 +01:00
Ozzie Isaacs 09e966e18a Merge remote-tracking branch 'optimize_details_html/only-render-cc-with-data' into Develop 2024-02-10 10:28:36 +01:00
Ozzie Isaacs f7718cae0c Fix typo in send password message 2024-02-10 10:07:10 +01:00
Ozzie Isaacs 90e728516c Merge remote-tracking branch 'it/master' 2024-02-10 10:04:01 +01:00
Ozzie Isaacs 7c04b68c88 Merge remote-tracking branch 'icon/master' 2024-02-10 10:01:16 +01:00
Ozzie Isaacs 8549689a0f Merge branch 'Develop'
Separate library from metadata file
embed metadata on download
2024-02-10 09:57:28 +01:00
Ozzie Isaacs d8f5c17518 Mark separate library as highly experimental 2024-02-10 09:56:32 +01:00
mapi68 05367d2df5
Update messages.po 2024-01-25 07:46:31 +01:00
Webysther Sperandio eb6fbfc90c
HiDPI icons 2024-01-23 04:24:21 +01:00
Ozzie Isaacs c2267b6902 Bugfix add to shelf 2024-01-22 13:17:27 +01:00
Ozzie Isaacs 0e5520a261 Bugfix add to shelf 2024-01-22 13:16:58 +01:00
Ozzie Isaacs 6f5e9f167e Fix typo 2024-01-21 14:42:39 +01:00
Ozzie Isaacs ce83fb6816
Update bug_report.md 2024-01-21 14:37:12 +01:00
Ozzie Isaacs fbfb7adef6
Update issue templates 2024-01-21 14:33:50 +01:00
Ozzie Isaacs cc52ad5d27 Added Notice 2024-01-21 14:27:38 +01:00
Ozzie Isaacs 706b9c4013 Improved errorhandling for adding invalid book_id to shelf 2024-01-21 08:12:49 +01:00
Ozzie Isaacs 6972c1b841 Improved errorhandling for adding invalid book_id to shelf 2024-01-21 08:12:28 +01:00
Ozzie Isaacs b9c329535d Fix for #2980 (invalid seriesindex causes no longer a crash) 2024-01-18 19:41:46 +01:00
Ozzie Isaacs 8fdf7a94ab Updated testresult 2024-01-18 19:37:33 +01:00
Ozzie Isaacs 31a344b410 Bugfix from testrun 2024-01-17 20:29:47 +01:00
Ozzie Isaacs 3814fbf08f Bugfixes from testrun 2024-01-14 14:28:08 +01:00
Ozzie Isaacs ffc13a5565 Merge branch 'master' into Develop 2024-01-13 14:48:09 +01:00
Ozzie Isaacs 74c61d9685 Merge branch 'metadata' into Develop 2024-01-13 14:47:48 +01:00
Ozzie Isaacs b8031cd53f Add possibility to replace kepub metadata on download 2024-01-13 14:31:42 +01:00
Ozzie Isaacs 898e76fc37 re enable gevent 2024-01-13 12:32:54 +01:00
Ozzie Isaacs af71a1a2ed Fix for #2973 (No unix sockets on windows available) 2024-01-13 12:26:53 +01:00
Ozzie Isaacs e0327db08f Enable embedd metadata of kepub file during conversion 2024-01-08 20:51:38 +01:00
Ozzie Isaacs bf2ac97c47 Update setup.cfg 2024-01-07 13:28:31 +01:00
Ozzie Isaacs 902fa254b0 Merge branch 'master' into Develop 2024-01-07 08:03:40 +01:00
Ozzie Isaacs f0cc93abd3 Sanitze username for logging 2024-01-06 16:08:14 +01:00
Ozzie Isaacs 977f07364b Fix for #2961 (empty comment with newline causes error 500 on upload)
Language of error message for kobo sync improved
2024-01-06 16:08:14 +01:00
Ozzie Isaacs 00acd745f4 Fix tornado deprecation warning 2024-01-06 16:08:14 +01:00
Ozzie Isaacs d272f43424 Show error message if user is missing download permission for kobo sync 2024-01-06 16:08:14 +01:00
Whatever Cloud 7a8d8375d0 Refactor detail.html to optimize custom_column rendering
The div with class "real_custom_columns" is now only rendered if the custom_column data exists, removing blank space in details view.
2024-01-01 20:38:05 +01:00
Johannes H 3aa75ef4a7 fix: link to Linux Mind installation in README.md
the link the wiki page had an typo (missing '-') https://github.com/janeczku/calibre-web/wiki/How-To:-Install-Calibre-Web-in-Linux-Mint-19-or-20
2023-12-30 14:19:39 +01:00
Ozzie Isaacs 25fb8d934f Merge remote-tracking branch 'nl/master' 2023-12-21 13:47:02 +01:00
GONCALVES Nelson (T0025615) f08c8faaff Generate identifiers in opf metadata file 2023-12-21 11:02:45 +01:00
Michiel Cornelissen bc0ebdb78d Updated Dutch translation. 2023-12-20 21:52:09 +01:00
Ozzie Isaacs 2a4b3cb7af Update Teststatus
Add hint for calibre binary
2023-12-17 08:04:16 +01:00
Ozzie Isaacs 4401cf66d1 Remove remains of ie8 support 2023-12-16 17:23:20 +01:00
Ozzie Isaacs d353c9b6d3 Fix #2945 (handle illegal multibyte sequence) 2023-12-16 10:48:49 +01:00
Ozzie Isaacs 0aba96c032 Update Teststatus 2023-12-16 10:31:36 +01:00
Ozzie Isaacs c60b7e9192 Update teststatus 2023-12-14 07:09:50 +01:00
Ozzie Isaacs 23033255b8 Bugfix updater 2023-12-12 18:15:48 +01:00
Ozzie Isaacs 31c8909dea Merge branch 'Develop' into metadata -> Now all tests should run "pass" now
# Conflicts:
#	cps/constants.py
#	cps/helper.py
#	cps/tasks/convert.py
#	test/Calibre-Web TestSummary_Linux.html
2023-12-11 14:23:12 +01:00
Ozzie Isaacs 9ef89dbcc3 Bugfix convert file from gdrive without cover
Update Teststatus
2023-12-10 15:23:26 +01:00
Ozzie Isaacs 1086296d1d Make embed metadata configurable 2023-12-09 11:29:11 +01:00
Ozzie Isaacs d341faf204 Make Version setuptools compatible and still have the "Beta" in the User interface 2023-12-09 09:36:28 +01:00
Ozzie Isaacs 2334e8f9c9 Refactored calibre executable detection for better error messages 2023-12-07 16:47:10 +01:00
Ozzie Isaacs 90ad570578 Show only folders for selecting converter binaries 2023-12-07 16:22:34 +01:00
Ozzie Isaacs fd90d6e375 Delete temp dir not shown in tasks overview
Handle case no cover during convert ebook
2023-12-06 19:33:22 +01:00
Ozzie Isaacs 7fbbb85f47 Temp folder is deleted on regular base 2023-12-04 19:26:43 +01:00
Ozzie Isaacs 52c7557878 Merge remote-tracking branch 'caliblur/issue/caliBlur2931'
Updated optional requirements
2023-12-04 19:05:39 +01:00
Ozzie Isaacs 794cd354ca Added ToDo's 2023-12-04 18:57:50 +01:00
Ghighi Eftimie 389e3f09f5 small fix for mobile resolution - add to shelf button 2023-12-04 16:40:56 +02:00
Ghighi Eftimie 285979b68d fix for 2931 2023-12-04 16:00:00 +02:00
Ozzie Isaacs 3a012c900e Merge branch 'master' into Develop 2023-11-28 18:00:26 +01:00
Ozzie Isaacs ec45de3212 Merge remote-tracking branch 'douban/master' 2023-11-28 17:59:48 +01:00
Ozzie Isaacs f644a2a136 Merge remote-tracking branch 'kobo_cover/patch-1' 2023-11-28 17:56:36 +01:00
Russell 01108aac42
Remove trailing slash
Signed-off-by: Russell <russell@troxel.io>
2023-11-26 22:01:26 -08:00
Russell Troxel 400c745692
Update KOBO_IMAGEHOST_URL to new CDN endpoint
Kobo has introduced a vanity URL to their Akamai CDN config - "https://https://cdn.kobo.com". As a result, requests sent to the old raw Akamai endpoint now through 404s. This is a simple PR that updates to the new URL.

This is visible in the config of a newly bought Kobo Sage (mine):
```
image_host=https://cdn.kobo.com/book-images/
image_url_quality_template=https://cdn.kobo.com/book-images/{ImageId}/{Width}/{Height}/{Quality}/{IsGreyscale}/image.jpg
image_url_template=https://cdn.kobo.com/book-images/{ImageId}/{Width}/{Height}/false/image.jpg
```

Example:

OLD:
https://kbimages1-a.akamaihd.net/1abfb307-457b-4597-b2ea-74beb2eb1478/149/223/false/image.jpg
(Throws 404)

New:
https://cdn.kobo.com/book-images/1abfb307-457b-4597-b2ea-74beb2eb1478/149/223/false/image.jpg
(Renders Properly)

fixes #2371 
ref #2731
2023-11-26 14:31:24 -08:00
ye 9841a4d068 fix the the problem that metadata_provider/douban.py can't get tags info 2023-11-26 09:06:25 +08:00
Ozzie Isaacs 7fd1d10fca Implement gdrive metadata on download 2023-11-11 15:26:05 +01:00
Ozzie Isaacs 4f6bbfa8b8 Little refactoring do_download 2023-11-11 15:00:12 +01:00
Ozzie Isaacs cf6810db87 Refactored get_temp_dir
bugfixes export_metadata
2023-11-11 14:48:59 +01:00
Ozzie Isaacs 5afff2231e Fix for #2743 (read status is no longer implicitly added to advanced search query) 2023-11-11 10:43:50 +01:00
Ozzie Isaacs d611582b78 Fix for #2743 (read status is no longer implicitly added to advanced search query) 2023-11-11 10:43:23 +01:00
Ozzie Isaacs 3bbd8ee27e Use belach or nh3 for cleaning html (fix for #2874) 2023-11-09 17:59:20 +01:00
Ozzie Isaacs f78e0ff938 Use belach or nh3 for cleaning html (fix for #2874) 2023-11-09 17:59:06 +01:00
Ozzie Isaacs bd71391bfb Possible fix for #2849 (404 error during sync request) 2023-11-09 17:43:02 +01:00
Ozzie Isaacs 20b2936cc1 Merge branch 'master' into Develop 2023-11-09 17:41:39 +01:00
Ozzie Isaacs 19825a635a Possible fix for 2849 (404 error during sync request) 2023-11-09 17:41:20 +01:00
Ozzie Isaacs 0d611d35de Updated Testresult
Updated requirements
2023-11-09 06:39:25 +01:00
Ozzie Isaacs effd026fe2 Merge branch 'master' into Develop 2023-11-08 20:36:49 +01:00
Ozzie Isaacs d68e57c4fc Implement split library and books
Bugfix arrows in comic reader
Fix kobo download link
Updated requirement
2023-11-08 20:11:03 +01:00
Ozzie Isaacs 184ce23351 Catch error with tornado on restart 2023-11-06 18:05:36 +01:00
Ozzie Isaacs 2fbc3da451 Added Slovak translation 2023-11-06 16:51:08 +01:00
Ozzie Isaacs fad6550ff1 Show "all" opds feed entries only if there is at least one entry 2023-11-06 16:35:39 +01:00
Ozzie Isaacs b7aaa0f24d Add metadata change code 2023-11-02 17:05:02 +01:00
Ozzie Isaacs 5040bb762c Merge remote-tracking branch 'vi/master' 2023-11-02 16:35:54 +01:00
Ozzie Isaacs 55deca1ec8 Catch additional errors on logfile
Fix error on exception in session management
2023-11-02 16:34:04 +01:00
Ozzie Isaacs 40a16f4717 Reenabled gevent as server 2023-11-01 07:47:29 +01:00
Ozzie Isaacs d26e60724a Socket listening and socket activation enabled on tornado
Refactoring of server code
Updates requirements
Improved requirements parsing for versions containing letters
2023-10-30 14:39:22 +01:00
Ozzie Isaacs d877fa1c68 Merge remote-tracking branch 'socket-activation/socket-activated' 2023-10-29 08:20:03 +01:00
Ozzie Isaacs d55bafdfa9 Added hint for beta release format 2023-10-28 19:10:44 +02:00
Ozzie Isaacs a2a431802a Added prc to supported convert from formats (#2801)
Improved error message for not able to listen to ipv6 address with gevent
2023-10-28 13:49:16 +02:00
Ozzie Isaacs b2e4907165 Merge branch 'master' into Develop 2023-10-28 09:06:51 +02:00
Ozzie Isaacs 6c2e40f544 Added favicon in opds feed
Merge remote-tracking branch 'favicon/master'
2023-10-28 09:05:24 +02:00
Ozzie Isaacs 5e3d0ec2ad Fix location of config files for executable files (#2917) 2023-10-28 08:48:13 +02:00
Ozzie Isaacs c550d6c90d Fix comic reader arrow visiblilty for one paged comic files
Changed logging during kobo sync
2023-10-28 08:48:13 +02:00
bacpd 3b1d0b4013
Update messages.po 2023-10-25 15:08:10 +07:00
Ozzie Isaacs 3d07efbb4f Update Italian and German translation 2023-10-21 15:47:35 +02:00
mapi68 c0ae5bb381
Update messages.po 2023-10-21 15:34:09 +02:00
Ozzie Isaacs 6e755a26f9 Version update
Updated security file
2023-10-21 14:37:21 +02:00
Ozzie Isaacs c45188beb2 Version update 2023-10-21 12:40:32 +02:00
Ozzie Isaacs 0736c53d7b Update teststatus 2023-10-18 18:14:00 +02:00
Ozzie Isaacs f0f8011d24 Modified build script to avoid warnings 2023-10-16 18:17:54 +02:00
Ozzie Isaacs 65f3ecb924 Updated test results 2023-10-15 15:43:50 +02:00
Ozzie Isaacs 87b3999ec8 Merge remote-tracking branch 'ko/master' 2023-10-14 15:55:27 +02:00
Ozzie Isaacs e32312b54a Merge branch 'master' into Develop 2023-10-14 15:53:10 +02:00
Ozzie Isaacs d7ea569e5d Merge remote-tracking branch 'upload_text/patch-1' into Develop 2023-10-14 15:52:37 +02:00
Ozzie Isaacs 96958e7266 Merge remote-tracking branch 'upload_text/patch-1' 2023-10-14 15:48:06 +02:00
Ozzie Isaacs 2c339ed10c Merge branch 'Develop':
- Fix for new tornado version
- bookmark for comic viewer
- Bugfix for showing series containing only one book in list view containing having this book no series_index value set
- updated requirements
2023-10-14 15:30:44 +02:00
Ozzie Isaacs dc2c30f508 Added additional debug output for download links during kobo sync 2023-10-14 09:51:54 +02:00
Ozzie Isaacs 0c43d80163 Added additional debug output for download links
Removed unused code
2023-10-14 09:51:19 +02:00
Ozzie Isaacs df71a86f94 New testrun 2023-10-14 09:34:34 +02:00
Ozzie Isaacs 7ed56b4397 Better fix for new tornado version 2023-10-08 15:46:51 +02:00
Ozzie Isaacs 5ceb2b6d83 Merge branch 'master' into Develop 2023-10-04 20:11:34 +02:00
Ozzie Isaacs 8abea1ddd0 Fix for #2904, werkzeug breaks master branch 2023-10-04 19:46:14 +02:00
Ozzie Isaacs 11816d3405 Fix for tornado 6.3 no response in restart moment
Update test results (many tests fail due to above problem)
2023-10-03 08:12:33 +02:00
Ozzie Isaacs 198bff928f Merge remote-tracking branch 'cn/master' 2023-10-02 20:03:27 +02:00
lawsssscat cac200ba61 Fix messages.po in zh_Hans_CN 2023-09-25 10:48:41 +08:00
David K 8cc36ab081
Clarify `Enable Uploads` text.
This change updates the help text next to the `Enable Uploads` setting.

- Current: `Please ensure users having also upload rights`
- Update: `Please ensure that users also have upload permissions`

---

The current help text is a little odd in terms of sentence structure for an English speaker.
The updated version clarifies the meaning.
2023-09-11 10:35:01 +01:00
databoy2k b3d1558df8
Add Favicon to OPDS Feed
<icon> is a standard of the OPDS spec, and this commit adds the favicon to the feed. Certain OPDS readers, e.g. FBReader on Windows, respect this tag and will show the same icon as the main page.
2023-09-08 13:09:40 -06:00
byword77 a045b6f467
Update messages.po
It is final commit. 
I made a mistake in the previous update. 
So, Please disregard the previous file.
2023-09-05 17:01:38 +09:00
Ozzie Isaacs 7a961c9011 Fix for click on scrollbar in long strip view
Fix for tornado version
2023-09-01 07:35:48 +02:00
Ozzie Isaacs 444ac181f8 more bookmark feature
tornado fix for tornado <6.2
2023-08-31 17:03:56 +02:00
Ozzie Isaacs 4bbcec21e4 Update test results 2023-08-31 11:42:55 +02:00
Ozzie Isaacs 5509d4598b Bugfix for showing series coatining only one book in list view containing having this book no series_index value set 2023-08-30 20:23:40 +02:00
Ozzie Isaacs fab35e69ec Update Teststatus
Little code refactoring
2023-08-29 20:05:57 +02:00
Ozzie Isaacs 4f0f5b1495 Merge remote-tracking branch 'origin/Develop' into Develop
# Conflicts:
#	optional-requirements.txt
2023-08-28 19:38:51 +02:00
Ozzie Isaacs cfa309f0d1 Merge branch 'master' into Develop
# Conflicts:
#	cps/services/SyncToken.py
#	cps/static/js/kthoom.js
#	cps/templates/readcbr.html
2023-08-28 18:08:19 +02:00
Ozzie Isaacs 885d914f18 Update tornado to 6.2
Remove unneeded imports from jsonschema for synctoken
Update optional requirements
Remove invalid direction arrows in comic reader
2023-08-28 18:06:32 +02:00
Ozzie Isaacs b580f418f7 Merge branch 'master' into Develop 2023-08-27 15:12:26 +02:00
Ozzie Isaacs 6a14e2cf68 Next try showing last book of series in grid view 2023-08-27 12:00:34 +02:00
Ozzie Isaacs 8535bb5821 Fix "got an unexpected keyword argument 'rarExecutable'" during format upload 2023-08-27 11:20:53 +02:00
Ozzie Isaacs b2a26a421c Removed deprecation warning for sqlalchemy2.0 2023-08-26 20:26:01 +02:00
Ozzie Isaacs 7aea7fc0bb Merge remote-tracking branch 'comic-bookmark/comics-save-position'
# Conflicts:
#	cps/static/js/kthoom.js
#	cps/templates/readcbr.html
#	cps/web.py
2023-08-26 20:13:42 +02:00
Ozzie Isaacs 52172044e6 Fix deprecation warnings 2023-08-26 20:12:52 +02:00
Ozzie Isaacs 9b99427c84 Merged comic save position 2023-08-26 20:12:34 +02:00
Ozzie Isaacs 0499e578cd Added /opds/stats route 2023-08-24 13:49:22 +02:00
Ozzie Isaacs b3a85ffcbb Added CB7 to supported upload formats 2023-08-24 10:51:16 +02:00
PhracturedBlue 074e611705 Add support for systemd socket-activation 2023-08-23 20:52:05 -07:00
Ozzie Isaacs a1899bf582 Fix for #2603 (Kobo UserKey in request missing due to no kobo account) 2023-08-23 21:13:17 +02:00
Ozzie Isaacs f7ff3e7cba Added py7zr to setup.cfg 2023-08-23 20:50:39 +02:00
Ozzie Isaacs 3a08b91ffa Added cb7 to supported comic files for upload and metadata extraction 2023-08-16 18:44:15 +02:00
Ozzie Isaacs d253804a50 fix for #2865 (Kobo sync fails during cover request) 2023-08-16 18:04:45 +02:00
Ozzie Isaacs ba0e5399d6 Fixes Uploading pdf file fails with whitespace title (#2824)
Merge remote-tracking branch 'pdf_title/fix/title-parsing-of-pdf-metadata'
2023-08-12 14:09:14 +02:00
Ozzie Isaacs 7818c4a7b0 Adapt cover size to kobo sync requested sze 2023-08-08 19:21:47 +02:00
Ozzie Isaacs 3f6a12898b Merge branch 'Develop' 2023-07-31 19:02:41 +02:00
Ozzie Isaacs caf69669cb Removed encode utf-8 in dodownload 2023-07-31 19:01:15 +02:00
Ozzie Isaacs de59181be7 Merge remote-tracking branch 'home/link_fixes' into Develop 2023-07-31 18:49:53 +02:00
Ozzie Isaacs 966c9236b9 Merge remote-tracking branch 'home/link_fixes' 2023-07-30 20:00:18 +02:00
Ozzie Isaacs 34c6010ad0 Catch additional error during kobo detect layout 2023-07-30 19:57:42 +02:00
Ozzie Isaacs 60e904967b Fix deprecated text parameter 2023-07-30 19:47:29 +02:00
Ozzie Isaacs 3efcbcc679 Fix deprecated text parameter 2023-07-30 07:44:41 +02:00
Ozzie Isaacs 7bb4bc934c Merge remote-tracking branch 'caliblur/issues/caliblur2838' 2023-07-29 15:36:44 +02:00
Ozzie Isaacs dcb8a0f77b Merge remote-tracking branch 'lubimyczytac/fix-lubimyczytac-metadata' 2023-07-29 15:35:53 +02:00
Ozzie Isaacs 2f12b2e315 Handle invalid or missing container.xml during kobo sync (Fix for #2840) 2023-07-29 15:32:35 +02:00
Ozzie Isaacs 279f0569e4 Fix visibility for sending to reader without download permissions (fix for #2847) 2023-07-29 15:15:38 +02:00
Ozzie Isaacs 6723369d65 Merge branch 'master' into Develop
# Conflicts:
#	cps/admin.py
2023-07-29 12:12:03 +02:00
Ozzie Isaacs 4b93ac034f Do not show password in smtp settings 2023-07-29 12:11:04 +02:00
Ozzie Isaacs fda62dde1d Fix for not changing password in email settings
Improved ssl certificate check on sending emails
2023-07-29 12:03:45 +02:00
Ozzie Isaacs df74fdb4d1 Update edit identifiers 2023-07-29 11:10:54 +02:00
Ozzie Isaacs cce538d5a7 Update Testresult 2023-07-28 13:44:56 +02:00
Ozzie Isaacs e8b0051b31 Merge development into master 2023-07-26 21:43:18 +02:00
Ozzie Isaacs fe55958ecc Update Teststatus 2023-07-26 21:42:19 +02:00
Ozzie Isaacs 7b321d63c1 update testresults 2023-07-26 21:42:19 +02:00
Ozzie Isaacs 986eaf9f02 Merge remote-tracking branch 'br/horus68-pt-translation' 2023-07-26 20:49:13 +02:00
Ozzie Isaacs caf8ed77d7 Merge remote-tracking branch 'br/horus68-ptbr-fix' 2023-07-26 20:30:19 +02:00
Ghighi Eftimie ee5cfa1f36 fix for #2838 2023-07-26 15:11:04 +03:00
Horus68 5eef476135
Update messages.po 2023-07-25 13:48:57 +01:00
Horus68 b5e4a88357
Update messages.po 2023-07-25 13:11:08 +01:00
Horus68 256f4bb428
Update messages.po
fix typo
2023-07-25 11:43:03 +01:00
Horus68 a4d45512ee
pt-BR Update messages.po
fixing pt-BR major errors
2023-07-25 11:40:26 +01:00
Horus68 074687c330
Create pt-PT translation
Translation to european portuguese - pt-PT portuguese (Portugal)
Note: messages.mo not created as file was translated directly in browser
2023-07-25 11:29:20 +01:00
archont 2f7b175dda Fix tags xpath 2023-07-16 18:50:54 +02:00
Ozzie Isaacs a256bd5260 Password is not returned in smtp settings 2023-07-09 10:23:56 +02:00
Ozzie Isaacs fdd1410b06 Improved pathchooser 2023-07-09 10:01:48 +02:00
Ozzie Isaacs 3f5583017f Improved pathchooser 2023-07-09 10:00:54 +02:00
Ozzie Isaacs 63b7d70f33 Update optional requirements
Update to be compatible with comicapi 3.2
2023-06-25 14:39:45 +02:00
Ozzie Isaacs 500758050c Fixed typo in German translation 2023-06-25 11:32:23 +02:00
Ozzie Isaacs 4b4c0daab0 Update testresults 2023-06-18 18:30:01 +02:00
Ozzie Isaacs 709a4e51ba Testrun 2023-06-18 11:17:06 +02:00
Ozzie Isaacs eff0750d77 Fix for renaming uppercase/lowercase author, tag, series, publisher entries (fix for #2787)
Update epub.js
2023-06-18 10:17:55 +02:00
Ozzie Isaacs e63a04093c Bugfix rename author in book list 2023-06-18 10:14:53 +02:00
Ozzie Isaacs 07d97d18d0 Merge remote-tracking branch 'epubreader/update_epub.min.js' into Develop 2023-06-17 15:50:51 +02:00
Ozzie Isaacs d8f30983d5 Merge remote-tracking branch 'readme/patch-1' 2023-06-17 15:48:18 +02:00
Ozzie Isaacs 062efc4e78 Bugfix change uppercase/lowercase on edit authors
Remove autocomplete on several elements to make typeahead work without problems
2023-06-17 10:47:23 +02:00
boosh 4e6c9c2703
Update README.md
Link to the raw download URL of the metadata.db file
2023-06-13 06:23:53 +00:00
Ozzie Isaacs 4dc5885723 Bugfix for upper/lowercase rename if not before part of book 2023-06-10 10:37:22 +02:00
quarz12 39638d3c9c updated epub.min.js to version 0.3.93 2023-06-09 16:11:53 +02:00
Ozzie Isaacs 3ef34c8f15 Bugfixes rename upper-lowercase after testrun 2023-06-08 10:28:42 +02:00
Ozzie Isaacs 932abbf090 Merge remote-tracking branch 'error_scroll/error_page' 2023-06-05 14:54:10 +02:00
Ozzie Isaacs 860443079d Fix for (#2802) search request fails with error after browser session closed and currently returns all results 2023-06-05 14:41:03 +02:00
Ozzie Isaacs bd4b7ffaba Fix for upper lower change of non ascii values in series, tags, ... 2023-05-30 20:02:52 +02:00
Ozzie Isaacs 33e35eeb52 Added option -o to define logfile via command line (fixes #2792) 2023-05-29 11:29:14 +02:00
Ozzie Isaacs ed09814460 Prevent log_message on startup
logfile Parameter
2023-05-28 20:42:18 +02:00
Ozzie Isaacs e52eb74121 Merge branch 'Develop' 2023-05-28 19:58:33 +02:00
Daniel dc7fbce4f7 changed style property of container 2023-05-28 13:21:26 +02:00
Ozzie Isaacs dad0fd5a1c Update test results 2023-05-28 10:24:40 +02:00
Ozzie Isaacs 8a87c152b4 Bugfix opds search 2023-05-27 16:25:06 +02:00
Ozzie Isaacs 16baa306c5 Update test results 2023-05-27 15:32:48 +02:00
Daniel 2eb334fb3d fixed a typo in http_error.html which broke the github link
changed the behavior of the home button so it directs to the application root, not the server root .
2023-05-08 21:48:04 +02:00
Ozzie Isaacs cb7356a04d Fixes to word with new version of comicapi 2023-05-04 20:23:02 +03:00
Ozzie Isaacs 63a561bf9b Merge remote-tracking branch 'chinese/translation/Simplified_Chinese' 2023-05-04 19:54:06 +03:00
Ozzie Isaacs cc733454b2 Merge remote-tracking branch 'chinese/translation/Simplified_Chinese' 2023-04-30 19:38:59 +03:00
whilenot 940544577a don't mutate meta into a str, keep it a namedtuple 2023-04-30 13:37:08 +02:00
xlivevil 9e0fc320cb Update Simplified Chinese translation 2023-04-25 16:03:28 +08:00
xlivevil bf3ca20fb2 Update Simplified Chinese translation 2023-04-25 15:38:40 +08:00
Ozzie Isaacs c7e1736ade Merge branch 'master' into Develop 2023-04-23 11:05:19 +02:00
Ozzie Isaacs bc6a50550e Merge branch 'master' into Develop 2023-04-23 11:03:12 +02:00
Ozzie Isaacs fe4dc1bb8f Fix #2757 (Sqlalchemy >1.30 <1.4.24 wasn't supported anymore) 2023-04-22 09:25:54 +02:00
Ozzie Isaacs f2369609e8 Bugfix for non existent rating, language, and user downloaded books 2023-04-18 20:53:55 +02:00
Ozzie Isaacs de4d6ec7df Merge remote-tracking branch 'it/patch-1' 2023-04-18 20:06:46 +02:00
mapi68 7754f4aa5d
Update messages.po 2023-04-18 09:05:19 +02:00
Ozzie Isaacs 524751ea51 Removed superfluous space 2023-04-17 18:52:52 +02:00
Ozzie Isaacs 8111d0dd51 Update translation status 2023-04-16 15:06:34 +02:00
Ozzie Isaacs fad5929253 Bugfix getPath for logfile viewer 2023-04-16 13:08:50 +02:00
Ozzie Isaacs 9f28144779 Fix for #2756 (Home button in caliblur is leading to "/" instead of calibre-web home) 2023-04-16 09:43:13 +02:00
Ozzie Isaacs 42fd6973a0 Merge remote-tracking branch 'readme/patch-1' 2023-04-15 19:15:21 +02:00
driz b2e20ff50c
update readme due to my mistake on link
i fubarred the optional calibre layer somehow, my apologies

thanks for all you guys do, myself and my entire family love calibre-web :)
2023-04-15 13:02:55 -04:00
Ozzie Isaacs 6075b3dd1d Merge remote-tracking branch 'readme/patch-2' 2023-04-15 18:46:45 +02:00
driz 37871ea8cb
Update README.md
this is built against the formatting changes of https://github.com/janeczku/calibre-web/pull/2742
it corrects the docker-mods section which is incorrect, fixes a dead link, and removes armhf from the listed of supported arches.
2023-04-15 11:38:04 -04:00
Ozzie Isaacs e2785c3985 Added djv file format to djvu reader 2023-04-15 15:25:46 +02:00
Ozzie Isaacs dba83a2900 Fixes for sqlalachemy2 2023-04-15 13:22:17 +02:00
Ozzie Isaacs 33c19b20f4 Merge remote-tracking branch 'readme/update-readme' 2023-04-15 11:20:52 +02:00
Ozzie Isaacs d2f39d3dce Update Teststatus 2023-04-15 11:00:38 +02:00
Ozzie Isaacs 1c8bc78b48 Improvements for sqlalchemy 2 2023-04-13 19:01:53 +02:00
Ozzie Isaacs 6c6841f8b0 Further fixes for sqlalchemy 2.0 2023-04-12 18:56:21 +02:00
Ozzie Isaacs 592216588c Revert "post" as search request. Search request is now get again (fix for #2741)
Revert "Auxiliary commit to revert individual files from 275675b48add79d2bbce06426cc1224c5e2c1bfb"

This reverts commit 6c920bc49f133d5c7451230448121f1f8b3cd9f2.
2023-04-12 18:29:15 +02:00
Wladimir Kirianov f4db0f04d2
add table of contents and contributor recognition section 2023-04-09 13:07:33 +02:00
Wladimir Kirianov b16e3a6e2c
Update README.md for clarity, formatting, and improved readability 2023-04-09 12:36:19 +02:00
Ozzie Isaacs 13c0d30a8f Update login
Removed not needed parameters for task status
2023-04-03 20:00:40 +02:00
Ozzie Isaacs b9c942befc Fix for 'NoneType' object has no attribute 'author_sort' while trying to read a book (#2733) 2023-03-31 07:48:18 +02:00
Ozzie Isaacs a68a0dd037 Fixed typo 2023-03-30 11:25:34 +02:00
Thomas de Ruiter a952c36ab7 Remove unused fallback cover handling 2023-03-28 16:13:10 +02:00
Thomas de Ruiter 5f0c7737fe Fix proxy cover images to Kobo store 2023-03-28 15:56:02 +02:00
Ozzie Isaacs 38484624e9 Version update 2023-03-27 20:20:18 +02:00
Ozzie Isaacs 1451a67912 Version bump 2023-03-27 19:49:57 +02:00
Ozzie Isaacs a72f0a160b Bugfix for python3.11, table gdrive_ids2 already exists (fix for #2729) 2023-03-27 17:58:07 +02:00
Ozzie Isaacs 253386b0a5 Bugfix parse ldap server config 2023-03-26 18:27:43 +02:00
Ozzie Isaacs 6c8ffb3e7e Bugfix path selection for reverse proxy 2023-03-26 14:31:19 +02:00
Ozzie Isaacs 7d26e6fc85 Bugfix get updater status 2023-03-26 14:19:12 +02:00
Ozzie Isaacs 085a6b88a3 Fix for #2713 (strip scheme from ldap server name) 2023-03-26 14:08:09 +02:00
Ozzie Isaacs bde36e3cd4 Bugfix for logging ldap debug messages with non stream logfile 2023-03-26 13:17:02 +02:00
Ozzie Isaacs 9646b6e2dd Enable debug output for ldap login 2023-03-26 11:29:54 +02:00
Ozzie Isaacs d35e781d41 Bugfixes after testrun
Catch StaleDataError
2023-03-26 08:19:36 +02:00
Ozzie Isaacs 321db4d712 Refactored send email by make use of ajax calls instead of posting the page
Always use getPath instead of pathname
2023-03-25 12:34:16 +01:00
Ozzie Isaacs 2b9f920454 Metadata backup configurable 2023-03-25 10:42:36 +01:00
Ozzie Isaacs 45acd3febe Merge branch jvonau/patch-1
Updated requirements
Updated test results
2023-03-22 17:50:38 +01:00
Ozzie Isaacs cbd7ca2f3e Activate metadata backup 2023-03-21 20:03:45 +01:00
Ozzie Isaacs ba7fee3918 Update metadatabackup 2023-03-21 20:02:57 +01:00
Ozzie Isaacs 1210ccb43f Update teststatus 2023-03-21 18:51:56 +01:00
Jerry Vonau 04f1f6493b
Update optional-requirements.txt
faust-cchardet has the latest code for cchardet https://pypi.org/project/faust-cchardet/#history
2023-03-21 09:52:38 -05:00
Ozzie Isaacs 46d2d217ee Bugfix metadata backup with custom columns 2023-03-20 20:11:37 +01:00
Ozzie Isaacs e3fffa8a8f Bugfix backup metadata for custom date, custom categories 2023-03-20 19:57:05 +01:00
Ozzie Isaacs dfb49bfca9 Merge branch 'master' into Develop (handle case of cover smaller than thumbnail) 2023-03-20 19:03:15 +01:00
Ozzie Isaacs 224777f5e3 Handle case that cover size is smaller than thumbnail size
Update teststatus
2023-03-20 19:00:35 +01:00
Ozzie Isaacs 7ade4615a4 Bugfix write metadata
Bugfix change of custom column now sets updates the book timestamp
2023-03-19 17:23:05 +01:00
Ozzie Isaacs cbd679eb24 Bugfix write metadata
Bugfix change of custom column now sets updates the book timestamp
2023-03-19 17:21:30 +01:00
Ozzie Isaacs b277ed3359 Update teststatus 2023-03-19 15:29:23 +01:00
Ozzie Isaacs fa95b07a95 Merge branch 'master' into Develop
# Conflicts:
#	requirements.txt
2023-03-05 16:06:49 +01:00
Ozzie Isaacs 87bc8c6d96 Updated requirements 2023-03-05 16:06:14 +01:00
Ozzie Isaacs db2bc6a2c2 Changed requirements 2023-03-05 16:03:54 +01:00
Ozzie Isaacs cf850c6ed5 Bugfix backup metadata 2023-03-05 16:03:07 +01:00
Ozzie Isaacs a6b54e398b Bugfix backup metadata 2023-03-05 16:02:48 +01:00
Ozzie Isaacs 28eeb9eec3 Merge branch 'master' into Develop 2023-03-04 11:13:57 +01:00
Ozzie Isaacs 7d76f2ae33 Updated requirements 2023-03-04 11:13:41 +01:00
Ozzie Isaacs 49e4f540c9 ** Be careful, after updating, there is no way back **
** Please install flask-limiter after updating **

Update Teststatus
Bugfix after merge
Bugfix generate Metadata backup
2023-03-04 10:37:05 +01:00
Ozzie Isaacs 64e9b13311 Bugfix after merge
Bugfix generate Metadata backup
2023-03-03 19:59:19 +01:00
Ozzie Isaacs 3cf778b591 Prevent double error message logging in case error in delete user 2023-02-27 19:27:48 +01:00
Ozzie Isaacs 942bcff5c4 Merge branch 'Develop' 2023-02-27 18:54:32 +01:00
Ozzie Isaacs 5c5db34a52 Merge branch 'master' into Develop
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2023-02-27 18:54:02 +01:00
Ozzie Isaacs ae850172a3 Deactivate metadata backup 2023-02-27 18:53:46 +01:00
Ozzie Isaacs 7ff4747f63 Bugfix after merge 2023-02-27 13:17:34 +01:00
Ozzie Isaacs 76b0411c33 Bugfix failed tasks can no longer aborted
Metdatabackup is done on startup if app mode is test
2023-02-25 16:31:48 +01:00
Ozzie Isaacs a414db0243 Merge remote-tracking branch 'fixed_layout/kobo-sync-detect-fixed-layout'
# Conflicts:
#	cps/kobo.py
2023-02-25 15:26:49 +01:00
Ozzie Isaacs 162ac73bee Bugfixes from testrun 2023-02-22 18:59:11 +01:00
Ozzie Isaacs fc31132f4e Merge remote-tracking branch 'pdf/master' 2023-02-21 20:52:25 +01:00
Ozzie Isaacs 856dce8add Merge remote-tracking branch 'refactor_epub/refactor_epub'
# Conflicts:
#	cps/epub.py
2023-02-21 20:47:10 +01:00
Ozzie Isaacs 3debe4aa4b Merge remote-tracking branch 'comic/long_strip_cbrreader' 2023-02-21 20:33:11 +01:00
Ozzie Isaacs b28a2cc58c Merge branch 'master' into Develop
# Conflicts:
#	cps/web.py
#	test/Calibre-Web TestSummary_Linux.html
2023-02-21 17:03:54 +01:00
Ozzie Isaacs 5fd0e4c046 Updated testresult 2023-02-20 18:46:48 +01:00
Ozzie Isaacs 595f01e7a3 Bugfix change erader email in /me page 2023-02-19 19:36:52 +01:00
Ozzie Isaacs c79aa75f00 Merge remote-tracking branch 'author_opds/opds_add_metadata' 2023-02-19 18:34:40 +01:00
Ozzie Isaacs 0177a8bcca Update installing problem on Raspberry Pi 2023-02-19 16:03:25 +01:00
Ozzie Isaacs 38c601bb10 Bugfix server restart to prevent infinite calibre-web instances 2023-02-19 09:10:25 +01:00
Ozzie Isaacs e7a6fe0bec Bugfix restart calibre-web on windows 2023-02-19 09:03:01 +01:00
Ozzie Isaacs 6119eb3681 Revert restart change 2023-02-18 14:34:53 +01:00
Ozzie Isaacs 6b2ca9537d revert restart change 2023-02-18 14:34:31 +01:00
Ozzie Isaacs 3cb9a9b04a Merge branch 'master' into Develop
# Conflicts:
#	cps/server.py
2023-02-18 14:23:58 +01:00
Ozzie Isaacs 3d8256b6a6 Bugfix for restarting on ubuntu 20.04 on restart 2023-02-18 14:23:15 +01:00
Ozzie Isaacs 660d1fb1ff Fix for infinite creation of subprocesses on restart 2023-02-18 13:59:10 +01:00
Ozzie Isaacs fa3fe47059 Fix for infinite process generation on restart 2023-02-18 13:58:22 +01:00
Ozzie Isaacs 89bc72958e new random password generation algorithm to ensure compliance with password rules
bugfix opds login limit
2023-02-16 16:23:06 +01:00
Ozzie Isaacs 73ea18b8ce Update teststatus 2023-02-16 13:08:39 +01:00
Ozzie Isaacs 7ca07f06ce Bugfix change password on commandline 2023-02-15 20:17:10 +01:00
Ozzie Isaacs 8ee34bf428 Bugfixes for password policy 2023-02-15 19:53:35 +01:00
Ozzie Isaacs 66d5b5a697 Exclude also .key file from updater 2023-02-12 13:12:38 +01:00
Ozzie Isaacs ce48e06c45 Improved limiter 2023-02-12 13:10:00 +01:00
Ozzie Isaacs f4ecfe4aca Merge branch 'master' into Develop
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2023-02-11 07:44:40 +01:00
Ozzie Isaacs dda20eb912 Further improvements for sqlalchemy compatibility 2023-02-11 07:43:48 +01:00
GarcaMan c4326c9495 Merge branch 'master' of github.com:GarckaMan/calibre-web into long_strip_cbrreader 2023-02-11 03:25:31 +00:00
Ozzie Isaacs 63a3edd429 Merge remote-tracking branch 'csp/patch-2'
Updated testresult
2023-02-10 18:18:27 +01:00
Ozzie Isaacs 3b45234beb Bugfix from testrun 2023-02-09 19:46:36 +01:00
Ozzie Isaacs 8d0a699078 Merge branch 'master' into Develop 2023-02-07 18:38:47 +01:00
Ozzie Isaacs 5b5146a793 Merge remote-tracking branch 'csp/patch-2' 2023-02-07 18:38:25 +01:00
Ozzie Isaacs 7a4e6fbdfb Merge branch 'master' into Develop
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2023-02-06 19:02:47 +01:00
Ozzie Isaacs 14d14637cd Updated test status
updated jzip for epub reader
Bugfix for opds login with ldap
updated requirementes
2023-02-06 19:02:27 +01:00
Ozzie Isaacs fb42f6bfff Make it possible to disable ratelimiter
Update APScheduler
Error message on missing flask-limiter
2023-02-05 13:43:35 +01:00
Ozzie Isaacs 4b7a0f3662 Merge branch 'master' into Develop
# Conflicts:
#	cps/opds.py
#	cps/server.py
#	cps/web.py
2023-02-05 12:10:01 +01:00
Ozzie Isaacs 275675b48a Search query is now also a post request (possible fix for Forward Auth Search Redirect Issue #2681) 2023-02-05 09:34:57 +01:00
Ozzie Isaacs 907606295d Merge remote-tracking branch 'it/patch-1' 2023-02-05 08:50:33 +01:00
Ozzie Isaacs 794c6ba254 Updated chinese translation 2023-02-05 08:47:10 +01:00
Ozzie Isaacs ac13f6042a Removed prints
Enabled additional reverse proxy authentication for opds feeds (fixes #2399)
2023-02-05 08:47:10 +01:00
Ozzie Isaacs f8fbc807f1 further refactored user login 2023-02-05 08:47:10 +01:00
Ozzie Isaacs 98da7dd5b0 remove g.user from before request 2023-02-05 08:47:10 +01:00
Ozzie Isaacs 1c3b69c710 refactored login routines 2023-02-05 08:47:10 +01:00
mapi68 1dd638a786
Update messages.po 2023-02-04 20:39:36 +01:00
_Fervor_ 6da7d05c6c
Update readpdf.html 2023-02-03 23:34:55 +08:00
_Fervor_ 3f72c3fffe
Update web.py 2023-02-03 23:31:49 +08:00
Ozzie Isaacs cf9a7d538f
Add .key file to ignored files 2023-02-03 14:28:59 +01:00
Ozzie Isaacs ea9e8d4384
Delete .key 2023-02-03 14:27:59 +01:00
Ozzie Isaacs b9769a0975 Revert to latest syncronous jszip version to make comic reader work again 2023-02-01 18:46:23 +01:00
Ozzie Isaacs 3a262661b5 Update test status 2023-01-31 18:54:20 +01:00
Ozzie Isaacs d2056ceb51 Updated readme to make
and exclude library from getting zipped
2023-01-29 14:28:49 +01:00
Ozzie Isaacs e71a3452e1 Added empty database 2023-01-29 14:14:18 +01:00
Ozzie Isaacs 189da65fac leave fields filled after invalid login attempt 2023-01-29 13:20:22 +01:00
Ozzie Isaacs 0e6b7f96d3 Update flask requirement 2023-01-29 10:01:30 +01:00
Ozzie Isaacs 1babb566fb Update version 2023-01-29 09:55:32 +01:00
Ozzie Isaacs c4e4acfc26 Stop scheduler also on restart calibre-web 2023-01-29 09:54:07 +01:00
Ozzie Isaacs 6afb429185 Stop Scheduler also on reboot 2023-01-29 09:53:02 +01:00
Ozzie Isaacs f241b260d7 Updated requirements
Bugfix from testrun
Testresults
2023-01-29 09:52:25 +01:00
Ozzie Isaacs 260a694834 Bugfixes after merge 2023-01-28 18:59:14 +01:00
Ozzie Isaacs 508e2b4d0a Merge branch 'master' into Develop
# Conflicts:
#	cps/admin.py
#	cps/config_sql.py
#	cps/search.py
#	cps/templates/admin.html
#	cps/web.py
#	setup.cfg
#	test/Calibre-Web TestSummary_Linux.html
2023-01-28 18:52:50 +01:00
Ozzie Isaacs 9701a97a57 Updated optional-requirements 2023-01-28 18:42:20 +01:00
Ozzie Isaacs 4913f06e0d Updated test status
Fix for #2614 (Send to eReader not working for guest user)
2023-01-24 18:07:21 +01:00
Petipopotam d545ea9e6f
CSP invalid to display image when web.read_book
CSP 
Before : default-src 'self'  'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' data:; style-src-elem 'self' blob: 'unsafe-inline'; object-src 'none';
After :    default-src 'self'  'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' data: blob:; style-src-elem 'self' blob: 'unsafe-inline';object-src 'none';
2023-01-24 11:03:19 +01:00
Petipopotam 1ad8dc102a
CSP invalid syntax
CSP had some "cosmetic" errors

Before : default-src 'self'  'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' data: style-src-elem 'self' blob: 'unsafe-inline';object-src: 'none';
After :    default-src 'self'  'unsafe-inline' 'unsafe-eval'; font-src 'self' data:;  img-src 'self' data:; style-src-elem 'self' blob: 'unsafe-inline'; object-src 'none';
2023-01-24 10:51:48 +01:00
Ozzie Isaacs 36cb454d1c Bugfixes from testrun 2023-01-23 16:04:25 +01:00
Ozzie Isaacs 1899cda8d1 Update Teststatus 2023-01-23 12:55:18 +01:00
Ozzie Isaacs 8dd4d0be1b Merge handle epub iodentifier 2023-01-23 12:55:09 +01:00
Ozzie Isaacs d48d6880af Update German translation 2023-01-22 13:53:10 +01:00
Ozzie Isaacs 94a6931d48 Handle version 3.0 of flask-babel 2023-01-22 12:09:19 +01:00
Ozzie Isaacs c21a870b8e Migrated pypdf2 to the now active developed pypdf 2023-01-22 11:31:47 +01:00
Ozzie Isaacs 791bc9621a Improved parsing of pdf files, bugfix for pypdf2 > V3.0 2023-01-22 11:25:24 +01:00
Ozzie Isaacs 2d6fe483ba Fix for #2657 (TypeError: 'NoneType' object is not iterable from amazon) 2023-01-22 08:02:17 +01:00
Ozzie Isaacs ad43f07dab Added additional installation hints based on #2660 2023-01-22 07:52:17 +01:00
Ozzie Isaacs 77637d81dd Fix fro #2670 (user has no attribute eReader_mail) 2023-01-22 07:42:44 +01:00
Ozzie Isaacs a2bf6dfb7b Bugfix csp header
Bugfix for loading metadata from google with old books (publishing date only year)
2023-01-21 17:09:02 +01:00
Ozzie Isaacs 1cd05d614c Merge remote-tracking branch 'csp/patch-1' 2023-01-21 15:48:08 +01:00
Ozzie Isaacs d75f681247 Merge remote-tracking branch 'no/Translate-to-norwegian' 2023-01-21 15:44:10 +01:00
Ozzie Isaacs 2be2920833 Fixed typo 2023-01-21 15:27:51 +01:00
Ozzie Isaacs d6184619f5 New generated translation files 2023-01-21 15:27:11 +01:00
Ozzie Isaacs 43ee85fbb5 Removed unnecessary Unicode "u" 2023-01-21 15:23:18 +01:00
Ozzie Isaacs 8022b1bb36 Merge remote-tracking branch 'english/master' 2023-01-21 15:19:59 +01:00
Ozzie Isaacs 9e75c65af8 Merge remote-tracking branch 'pdfreader/issue-2659' 2023-01-21 14:27:59 +01:00
Ozzie Isaacs 7881950e66 Merge remote-tracking branch 'id-translation/master' 2023-01-21 14:18:45 +01:00
Ozzie Isaacs 031658ae94 Update teststatus 2023-01-21 14:17:43 +01:00
Arief Hidayat 48c2c7b543
First fix after proofread
Fixed typos and inconsistencies.
Defined "Berkas" instead of "File" for English term "File".
Defined "Pengaturan" and its root word "Atur" instead of "Konfigurasi" for English term "Configuration".
Reverting technical terms "Logfile", "access logfile", "Keyfile" to its English origin.
2023-01-21 09:37:16 +07:00
Petipopotam beb619c2c2
Correct CSP
no need blob: value for object-src
2023-01-19 20:19:55 +01:00
Petipopotam ed22209e6c
Content Security Policy syntax was invalid
According to https://csp-evaluator.withgoogle.com/ the CSP built here is NOT valid (and the blob: value is missing at img-src, so the image is not displayed when reading ebook in a browser)

Before this commit, in Chrome response header you can find 

Content-Security-Policy: default-src 'self'  'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self'  data:; object-src: 'none'; blob:;style-src-elem 'self' blob: 'unsafe-inline';

After :

Content-Security-Policy: default-src 'self'  'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' blob: data:; object-src 'none'  blob:; style-src-elem 'self' blob: 'unsafe-inline';

and image in viewer are displayed
2023-01-19 19:56:27 +01:00
blitzmann 364c48edd8 PdfFileReader -> PdfReader 2023-01-16 22:59:26 -05:00
Ozzie Isaacs e178efb58c Update for #2653 (AP Scheduler triggers are function calls and not strings anymore) 2023-01-15 13:49:16 +01:00
Vegard Fladby 4105c64320 Added norwegian translation 2023-01-06 10:17:53 +01:00
Josh O'Brien b3335f6733 English Language Updates - V3 2023-01-04 13:30:13 +11:00
Benedikt McMullin fba95956de epub: Skip invalid dc:identifier 2023-01-02 21:21:43 +01:00
Ozzie Isaacs ce0b3d8d10 Merge remote-tracking branch 'bump_sortable' 2022-12-27 09:13:15 +01:00
Ozzie Isaacs 9545aa2a0b Merge remote-tracking branch 'kobo_path/master' 2022-12-27 09:11:08 +01:00
jvoisin 4629eec774 Bump sortable.js 2022-12-27 00:18:56 +01:00
Jeroen Kroese 4977381b1c Fix 'Kobo eReader.conf' path 2022-12-26 16:19:19 +01:00
Ozzie Isaacs 6c1631acba Updated requirements 2022-12-26 15:47:04 +01:00
Ozzie Isaacs 1489228649 Bugfix for testability 2022-12-25 19:06:35 +01:00
Ozzie Isaacs 74efa52f26 Update lxml, pypdf2 requirement 2022-12-25 18:48:26 +01:00
Ozzie Isaacs 1ca1281346 Merge remote-tracking branch 'jszip/compress_dl' 2022-12-25 18:38:28 +01:00
jvoisin 631496775e Minor code refactorisation of epub.py
- Reduce the amount of nested indentation
- Use proper functions instead of fragile manual parsing
2022-12-25 16:37:58 +01:00
jvoisin c5e539bbcd Bump jszip 2022-12-25 16:11:29 +01:00
jvoisin 02ec853e3b Remove a duplicate library 2022-12-25 16:09:18 +01:00
Ozzie Isaacs d0411fd9c7 Merge remote-tracking branch 'google_cover/patch-1' 2022-12-25 13:27:05 +01:00
Ozzie Isaacs 567cb2e097 Inlcuded indonesian translation 2022-12-25 13:24:00 +01:00
Ozzie Isaacs a635e136be Added databazeknih to supported links 2022-12-25 13:10:21 +01:00
Ozzie Isaacs 5ffb3e917f Merge remote-tracking branch 'caliblur/issue/2515' 2022-12-25 11:04:14 +01:00
Ozzie Isaacs 5dc3385ae5 Merge remote-tracking branch 'douban/metadata_provider/douban' 2022-12-25 10:35:35 +01:00
Ozzie Isaacs 66e0a81d23 Merge remote-tracking branch 'mp3_csrf/save-mp3-position' 2022-12-25 10:34:01 +01:00
Ozzie Isaacs 1f6eb2def6 html tag fix 2022-12-25 10:32:01 +01:00
Ozzie Isaacs 7d3af5bbd0 Merge remote-tracking branch 'font_size/issue/487' 2022-12-25 10:29:29 +01:00
Ozzie Isaacs 043a612d1a Update path to kobo config file 2022-12-25 10:22:58 +01:00
Ozzie Isaacs 928e24fd1a Merge remote-tracking branch 'google_site_verification/master' 2022-12-25 09:59:32 +01:00
Ozzie Isaacs 3361c41c6d Merge remote-tracking branch 'caliblur/issues/caliBlur' 2022-12-25 09:49:02 +01:00
Ozzie Isaacs 85a6616606 Merge remote-tracking branch 'fix_default_language/master' 2022-12-25 09:45:14 +01:00
Ozzie Isaacs c15b603fef Merge remote-tracking branch 'mp3listen/master' 2022-12-25 09:41:56 +01:00
Ozzie Isaacs b12e47d0e5 Merge remote-tracking branch 'fr' 2022-12-25 09:29:05 +01:00
Ozzie Isaacs 389263f5e7 Merge remote-tracking branch 'object_src_csp' 2022-12-25 09:27:48 +01:00
Ozzie Isaacs 307b4526f6 Merge remote-tracking branch 'jquery/bump_jquery' 2022-12-25 09:23:18 +01:00
jvoisin 7d023ce741 Bump jquery's version from 3.6.0 to 3.6.3 2022-12-22 23:38:28 +01:00
Julien Voisin 2ddbaa2150
Add object-src to the CSP policy 2022-12-22 12:47:37 +01:00
jvoisin 29fef4a314 Add French articles to the title regex 2022-12-20 23:14:41 +01:00
JonathanHerrewijnen 9450084d6e Editing listenmp3.html page to show audiobook info 2022-11-24 20:34:01 +00:00
Vijay Pillai b52c7aac53 Added GOOGLE_SITE_VERIFICATION environmental value to enable google safe browsing 2022-11-10 11:02:50 -05:00
Feige-cn e8c461b14f
Update web.py
In Admin view page, Editor UI Configuration - Default Settings for New Users - Default Language, set up the new user's default language is not effective. I changed this web.py, add a line of code in 1248 lines in register function. Creating the new user need to take the default language.
2022-11-08 01:32:38 +08:00
Ghighi Eftimie 9409b9db9c fixes for 946, 2284 caliblur 2022-10-21 21:53:15 +02:00
Ghighi Eftimie a992aafc13 fixes #2515 2022-10-21 15:08:33 +02:00
Ghighi Eftimie b663f1ce83 added font size fader in reader's settings popup #487 2022-10-16 16:22:08 +02:00
Olivier b45d69ef2d set currentImage to the start if no bookmark 2022-10-11 23:43:54 +09:00
Olivier a80735d7d3 Save the position of the last read page for comics 2022-10-11 23:37:12 +09:00
Olivier adfbd447ed mp3 player was missing the csrf_token 2022-10-11 19:50:23 +09:00
xlivevil 73567db4fb
Update douban metadata provider
Change search API
Change to Return an empty list when an error occurs
Change the way to get tags
Fix series and publisher perse error
Rename a variable with the same name as the built-in
2022-10-10 01:49:42 +08:00
Ozzieisaacs 3d59a78c9f little refactoring for send emails through gmail account 2022-10-04 20:48:09 +02:00
Ozzieisaacs 8ba23ac3ee Merge remote-tracking branch 'gmail/issue/2471' 2022-10-04 20:46:19 +02:00
Ghighi Eftimie 397cd987cb added try except block for send_gmail_email method 2022-10-04 21:28:09 +03:00
Ozzie Isaacs 7eef44f73c Make drive letters available in file picker 2022-10-03 15:17:17 +02:00
Ozzie Isaacs e22ecda137 Merge remote-tracking branch 'it/patch-30' 2022-10-02 21:12:56 +02:00
ElQuimm a003cd9758
update message.po (italian)
Hello, I ran the October 2 update, and this error appeared: 

Merge remote-tracking branch 'it/patch-28'
# Conflicts:
# cps/translations/it/LC_MESSAGES/messages.po

Calibre-Web does not start again and the container logfile does not allow me to have more information.
I proceeded to verify the translation file (I did not find anything strange) and I made some updates of the text.
2022-10-02 21:07:24 +02:00
Ozzie Isaacs 44f6655dd2 Catch one additional database error on edit book 2022-10-02 15:21:53 +02:00
Ozzie Isaacs bd52f08a30 Fix for #2547 (None isn't iterable, so in case scholary request fails, empty list has to be returned) 2022-10-02 15:05:07 +02:00
Ozzie Isaacs edc9703716 Merge remote-tracking branch 'vi/add-translation' 2022-10-02 11:45:00 +02:00
Ozzie Isaacs 56d697122c Merge remote-tracking branch 'it/patch-28'
# Conflicts:
#	cps/translations/it/LC_MESSAGES/messages.po
2022-10-02 11:39:20 +02:00
Ozzie Isaacs d39a43e838 Merge remote-tracking branch 'cn/Translation/Simplifield_Chinese' 2022-10-02 11:36:47 +02:00
ElQuimm 9df3a2558d
update message.po
updated italian message.po translation
2022-09-29 11:07:31 +02:00
xlivevil 7339c804a3
fix typo 2022-09-29 13:18:21 +08:00
xlivevil 4d61c5535e
Update Simplifield Chinese translation 2022-09-28 20:14:58 +08:00
xlivevil 09e1ec3d08
fix typo 2022-09-28 20:12:21 +08:00
Ozzie Isaacs 8421a017f4 Updated Test result 2022-09-26 16:54:15 +02:00
Ozzie Isaacs 27eb514ca4 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	cps/static/js/table.js
2022-09-25 19:57:09 +02:00
Ozzie Isaacs b4d9e400d9 Handle None as identifier value during upload 2022-09-25 19:39:38 +02:00
Ozzie Isaacs 67bc23ee0c Fix for #2537 (Impossible to set Denied Column Value from user table) 2022-09-25 19:39:38 +02:00
Ozzie Isaacs b898b37e29 Fix for #2545 (Max task duration double entry "1hour") 2022-09-25 19:39:38 +02:00
Ozzie Isaacs 10dcf39d50 Merge branch '1' 2022-09-25 19:37:55 +02:00
Ozzie Isaacs e676e1685b Handle None as identifier value during upload 2022-09-25 19:37:38 +02:00
Ozzie Isaacs 59a5ccd05c Bugfixes after testrun 2022-09-25 19:36:40 +02:00
Ozzie Isaacs 04908e22fe backup metadata 5th step 2022-09-23 20:45:30 +02:00
Ozzie Isaacs 0f67e57be4 Merge branch 'master' 2022-09-20 19:12:36 +02:00
Ozzie Isaacs 071d19b8b3 Fix for #2537 (Impossible to set Denied Column Value from user table) 2022-09-20 19:10:45 +02:00
halink0803 1ffa190938
add vietnamese translation 2022-09-20 21:38:47 +07:00
Ozzie Isaacs c10708ed07 Backup metadata 4th step 2022-09-19 22:39:40 +02:00
Ozzie Isaacs b4851e1d70 Fix for #2545 (Max task duration double entry "1hour") 2022-09-19 18:57:55 +02:00
Ozzie Isaacs 26be5ee237 Backup metadata 3rd step 2022-09-19 18:56:31 +02:00
Ozzieisaacs 241aa77d41 backup metadata second step 2022-09-14 17:03:48 +02:00
Ozzieisaacs ca0ee5d391 backup metadata first step 2022-09-10 18:26:52 +02:00
Ozzieisaacs 110d283a50 Enable series type custom column 2022-09-10 17:17:20 +02:00
Giulio De Pasquale f6a9030c33
Removed extra space 2022-09-08 17:26:34 +02:00
Giulio De Pasquale 452093db47
Google Covers: strip curl in thumbnail and request higher resolution image 2022-09-08 17:23:53 +02:00
Ozzieisaacs 9fa56a2323 Merge remote-tracking branch 'kobolanguage/language' 2022-09-06 18:09:07 +02:00
Ozzieisaacs 3a133901e4 Fix: ignore special files originating from Apple devices 2022-09-06 18:06:59 +02:00
Ozzieisaacs 7750ebde0f Update pdf Reader 2022-09-05 19:42:02 +02:00
Ozzieisaacs 2472e03a69 Bugfix ratelimiter kobo 2022-09-05 18:45:24 +02:00
Ozzieisaacs 6598c4d259 Add rate limit for opds 2022-09-04 19:47:04 +02:00
Ozzie Isaacs a9b20ca136 Fix for big database not showing tags 2022-08-29 19:08:04 +02:00
Ozzie Isaacs bf0375d51d Bugfix change emails 2022-08-28 15:59:25 +02:00
Ozzie Isaacs 89d226e36b Allow deletion of kindle email address and force e-mail address to be valid 2022-08-28 15:54:43 +02:00
Ozzie Isaacs ec8844c7d4 Make pyPDF2 again to the favorite pdf metadata extractor 2022-08-27 15:44:21 +02:00
Ozzie Isaacs e5c8a7ce50 Change landing page for issues, to reduce number of empty issues 2022-08-27 10:20:53 +02:00
Ozzie Isaacs dc3cafd23d Debug message improved (fix for #2516) 2022-08-27 10:13:38 +02:00
Ozzie Isaacs 9de474e665 Add galician language to available translations (#2510) 2022-08-27 10:03:01 +02:00
Martin Brodbeck cd143b7ef4 Use part1 instead of part3 language codes 2022-08-12 15:18:50 +02:00
Martin Brodbeck 8a5112502d Considers the language of the ebook instead of always specifying "English". 2022-08-12 11:51:26 +02:00
Ozzie Isaacs b5d5660d04 Update version 2022-07-31 16:14:03 +02:00
Ozzie Isaacs fc9c641e55 Updated brazilian translation (fix #2496) 2022-07-31 11:30:56 +02:00
Ozzie Isaacs 68e21e1098 Fix #2495, Fix #2494 (Convert for not existent file no longer fails) 2022-07-31 11:28:11 +02:00
Ozzie Isaacs 828be29a80 Update teststatus 2022-07-30 18:13:09 +02:00
viljasenville 46e5305f23 Comic reader: ignore special files originating from Apple devices 2022-07-27 11:17:20 +03:00
Ozzie Isaacs a3f7dc2a5a Bugfix search with wrong custom column configured 2022-07-23 07:23:13 +02:00
Thore Schillmann 9bcbe523d7 (draft) metadata embedding when sending to device 2022-07-22 08:58:28 +00:00
Ozzie Isaacs ae3e3559b8 Rate limit prepared for feedback on login route 2022-07-18 10:59:54 +02:00
Ozzie Isaacs a72f16fd3a Fix missing or_ import 2022-07-16 19:27:44 +02:00
Ozzie Isaacs c2545315e1 Fix Ratings with 0 stars are counted as None 2022-07-16 19:09:19 +02:00
Ozzie Isaacs 61a0c72f8e Merge remote-tracking branch 'typo/fix-typos' 2022-07-16 17:52:45 +02:00
Ozzie Isaacs 1e44cb3b6c Merge remote-tracking branch 'cn/Translation/Simplifield_Chinese'
# Conflicts:
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
2022-07-16 17:49:27 +02:00
Ozzie Isaacs 462aa47ed6 Merge remote-tracking branch 'jp/japanese' 2022-07-16 17:47:54 +02:00
Thore Schillmann e176d63ca6 Merge branch 'embed_metadata_on_convert' into embed_metadata_on_download 2022-07-14 13:39:58 +00:00
Thore Schillmann 80b0e88650 fix for GDrive integration 2022-07-14 13:34:42 +00:00
Thore Schillmann 0b4731913e created `do_calibre_export` function 2022-07-14 09:25:37 +00:00
Thore Schillmann fc7ce8da2d cleanup 2022-07-13 15:39:01 +00:00
Thore Schillmann c89bc12c9b Merge branch 'embed_metadata_on_convert' into embed_metadata_on_download 2022-07-07 14:09:15 +00:00
Thore Schillmann 4913673e8f added `subprocess.wait()` when getting metadata 2022-07-07 11:47:10 +00:00
Thore Schillmann fc004f4f0c moved `get_calibre_binarypath()` to `helper.py` 2022-07-07 11:41:51 +00:00
Ozzie Isaacs 7344ef353c Rate limited login 2022-07-02 19:46:58 +02:00
Ozzie Isaacs 3bde8a5d95 Encrypt passwords 2022-07-02 17:45:24 +02:00
Thore Schillmann c5c3874243 first implementation 2022-07-01 16:04:25 +00:00
Kian-Meng Ang c4104ddaf4 Fix typos 2022-07-01 21:26:06 +08:00
Thore Schillmann 0d34f41a48 cleanup of `autodetect_converter_binary` 2022-07-01 12:06:33 +00:00
xlivevil b47c1d2431
Update Simplifield Chinese translation 2022-06-30 21:24:22 +08:00
Thore Schillmann a77aef83c6 automatically set `config_converterpath` 2022-06-30 13:05:36 +00:00
Thore Schillmann e39c6130c3 cleanup and better error handling 2022-06-29 19:54:53 +00:00
subdiox 12071f3e64 Fix author & series ID translation 2022-06-26 10:26:45 +09:00
subdiox 92b6dbf26f Fix one Japanese translation 2022-06-26 01:29:08 +09:00
subdiox 98b554a3a0 Fix Japanese translation 2022-06-26 01:24:44 +09:00
Thore Schillmann 03359599ed input validation for calibre binary directory 2022-06-23 20:02:54 +00:00
Thore Schillmann 3c4330ba51 refactoring of calibre binary detection 2022-06-21 17:04:44 +00:00
Thore Schillmann 8c781ad4a4 code cleanup and implements cover change 2022-06-19 23:20:59 +00:00
Thore Schillmann 5e9ec706c5 first draft of embedding metadata on conversion 2022-06-19 22:59:54 +00:00
Ozzie Isaacs 07c67b09db Merge remote-tracking branch 'uk/master' 2022-06-18 18:45:12 +02:00
Ozzie Isaacs b1c70d5b4a Update Teststatus 2022-06-18 18:44:02 +02:00
Ozzieisaacs c5fc30a1be Bugfix error message missing custom read status column
Bugfix password validation
2022-06-17 14:49:42 +02:00
Ozzie Isaacs 29fd4ae4a2 Bugfixes create users
Update Teststatus
2022-06-17 10:14:33 +02:00
Ozzieisaacs 4ef8c35fb7 Bugfies password validation from testrun 2022-06-16 14:16:00 +02:00
Ozzieisaacs 04326af2da password validation working 2022-06-16 11:15:17 +02:00
Ozzieisaacs d6a31e5db8 config verify password working 2022-06-16 10:44:42 +02:00
Ozzie Isaacs 73d48e4ac1 Frontend for password strength 2022-06-16 08:33:39 +02:00
Ozzie Isaacs b206b7a5d8 Merge branch 'master' into Develop 2022-06-14 18:45:50 +02:00
Ozzie Isaacs 02e1be09df Catch StaleDataError
Update requirements jsonschema
2022-06-13 17:54:35 +02:00
Ozzie Isaacs f85b587d0a Prevent converting of kepub on every new user (#2446)
Added error logging message if convert fails
If convert only task, only convert book message is logged
2022-06-13 17:05:00 +02:00
Ozzie Isaacs 89d522e389 Fix for #2445 (book read status can't be set if custom column is linked and read status was set before) 2022-06-11 11:35:02 +02:00
Thore Schillmann 2816a75c3e changed datetime format of published tag 2022-06-09 20:35:44 +00:00
Ozzie Isaacs 78b45f716a Bugfix for #2433 (LazyString is not JSON serializable if one of kepubify/ebook-convert/unrar is not installed) 2022-06-08 20:25:35 +02:00
Ozzie Isaacs 91df265d40 Fix for #2437 (advanced search for read status crashes calibre-web) 2022-06-08 17:17:07 +02:00
Illia Maier 7e7f54cfa7
Update Ukrainian translation
Update Ukrainian translation
2022-06-06 16:28:03 +03:00
Illia Maier 80bc14c0cf
Merge pull request #1 from Illia-M/Develop
Develop
2022-06-06 16:25:49 +03:00
Illia Maier 7685818b16
Update Ukrainian translation
Update Ukrainian translation
2022-06-06 14:37:07 +03:00
Ozzie Isaacs f44d42f834 Merge remote-tracking branch 'opds/bugfix_2419'
Bugfix send emails
2022-06-06 09:00:09 +02:00
GarcaMan bf12542df5 Updated Rotate Left/Right shortcut funtions to update inmediatly
Minor fixes
2022-06-05 19:56:34 +00:00
Ozzie Isaacs 25f2af3f03 Whitespaces are striped from email address (fixes #2432) 2022-06-05 10:06:43 +02:00
Ozzie Isaacs 909797dc49 Merge branch 'master' into Develop 2022-06-04 12:05:34 +02:00
Ozzie Isaacs 07d4e60655 Merge remote-tracking branch 'epub_theme/epub_themes' into Develop 2022-06-04 12:05:24 +02:00
Ozzie Isaacs d90cfce97f Merge remote-tracking branch 'ldap/master' 2022-06-04 12:03:16 +02:00
Ozzie Isaacs 543fe12862 Merge remote-tracking branch 'epub_theme/epub_themes' 2022-06-04 09:26:01 +02:00
Ozzie Isaacs 4f66d6b3b1 Update ukranian translation 2022-06-04 08:49:48 +02:00
Illia Maier c36138b144
Update Ukrainian translations 2022-06-03 08:59:18 +03:00
Thore Schillmann 7f6e88ce5e fixes bug 2419 2022-06-01 22:06:28 +02:00
Ozzie Isaacs aa442d8c51 Update flask-login requirement 2022-05-31 19:22:57 +02:00
Aisha Tammy a3cd217cea allow @ in auto username detection
Signed-off-by: Aisha Tammy <aisha@bsd.ac>
2022-05-25 12:14:09 -04:00
Thore Schillmann 0f3f918153 multiple authors and publication date in opds feed 2022-05-22 17:40:21 +00:00
Ozzieisaacs 790080f2a0 Fix Cache Buster 2022-05-22 12:49:00 +01:00
Ozzieisaacs 4ea80e9810 Code cosmetics 2022-05-21 21:52:59 +01:00
Ozzieisaacs 034d57134d Merge remote-tracking branch 'convert/master' 2022-05-21 22:27:53 +02:00
Ozzieisaacs f6101fd462 Merge remote-tracking branch 'links/patch-1' 2022-05-21 22:25:49 +02:00
Ozzieisaacs 1fa7de397a Merge remote-tracking branch 'cve/patch-1' 2022-05-21 22:22:02 +02:00
leexia 3b7cd38d5e Fix grammar mistake 2022-05-16 13:59:35 +08:00
ImanSharaf 78fb7a9756
Update SECURITY.md
I am the person who has reported the SQLi problem. I contacted the MITRE and they have given me this CVE number: CVE-2022-30765
2022-05-15 19:00:16 -07:00
Evan Peterson 7ae9f89bbf
Merge branch 'Develop' into kobo-sync-detect-fixed-layout 2022-05-14 10:02:31 -04:00
Ozzie Isaacs 8a6a8dcbe8 Transfer gevent errors to log file
Transfer warnings from warnings module to logfile (#2394)
2022-05-09 19:47:43 +02:00
Ozzie Isaacs fbac3e38ac Eenabled send epubs to E-Reader devices 2022-05-08 12:55:54 +02:00
Ozzie Isaacs c1f1952b04 Updated jsonschema requirement
Testupdate
Fixed file mode of main.js
2022-05-06 17:49:12 +02:00
Ozzie Isaacs 5e4cf839bc Replace "ast" by "json.loads" to handle enums with default values/colors (fix for #2398) 2022-05-05 18:04:34 +02:00
Ozzie Isaacs 056ecf0d90 Fix for #2394 2022-05-04 19:23:08 +02:00
Chris Thurber 0c2f67bc7b
Updates Links in README
Update links for optional pip features and GDrive integration.
2022-05-04 12:42:23 -04:00
Ozzie Isaacs 1bcb714fac Remove mature tags config option 2022-05-03 18:43:07 +02:00
Ozzie Isaacs 8cb3fe32a5 Try to prevent error from #2390 2022-05-02 17:42:26 +02:00
Ozzieisaacs ae5053e072 Added missing translation strings
Update German Translation
2022-05-01 13:24:11 +02:00
Ozzie Isaacs cde51e743a Removed duplicate Werkzeug entry in about page
Code cosmetics
2022-05-01 12:36:35 +02:00
Ozzie Isaacs 3233b357f8 Changed Readme 2022-05-01 11:13:36 +02:00
Ozzie Isaacs 49655e9f2d More bugfixes for time and datetime.time 2022-05-01 10:38:31 +02:00
Ozzie Isaacs 7b45324149 Bugfix time and datetime.time 2022-05-01 10:35:00 +02:00
Ozzie Isaacs 858d099509 Merge branch 'Develop' 2022-05-01 10:26:10 +02:00
Ozzie Isaacs 12f3a13d1d Fix typo
Fix missing maim.py file in update pypi package
Bugfix after last testrun
2022-05-01 10:25:38 +02:00
Ozzieisaacs 813d303ea7 Merge branch 'cover_thumbnail' into Develop 2022-04-30 17:05:36 +02:00
Ozzieisaacs c1ca18f7dc Merge remote-tracking branch 'origin/cover_thumbnail' into cover_thumbnail 2022-04-30 17:04:39 +02:00
Ozzie Isaacs e8e4d87d39 Bugfix session commit
Bugfix get_locale
Bugfix reconnect database schedule
Bugfix no permission error message logging
Bugfix updater
2022-04-30 10:17:41 +02:00
Ozzie Isaacs 5d5a94c9e5 Bugfix start as program 2022-04-29 18:26:09 +02:00
Ozzie Isaacs 258b4a6767 Bugfix OAuth Login 2022-04-28 21:43:26 +02:00
Ozzie Isaacs ef4b5e2881 Bugfix audio player
Bugfix Debugfile export
2022-04-28 21:40:48 +02:00
Ozzie Isaacs a968ddaef2 Bugfixes after testrun 2022-04-28 21:09:03 +02:00
Ozzie Isaacs aaa749933d Further migration to flask_babel
Bugfix sort order
Bugfix tasklist
2022-04-26 20:24:40 +02:00
Ozzie Isaacs 2e007a160e reenable startup logging
Bugfixes from refactoring and merge
2022-04-26 14:45:06 +02:00
Ozzie Isaacs e7464f2694 Refactored web.py to shrink size of file 2022-04-26 11:49:06 +02:00
Ozzie Isaacs 47414ada69 Merge branch 'master' into Develop 2022-04-26 11:11:00 +02:00
Ozzie Isaacs 9410b47144 Refactored startup for compatibility with pyinstaller 5.0 2022-04-26 11:10:44 +02:00
Ozzie Isaacs db03fb3edd Merge branch 'cover_thumbnail' into Develop 2022-04-26 10:59:04 +02:00
Ozzie Isaacs 2b03cae017 Bugfix scheduler end task 2022-04-26 10:55:11 +02:00
Ozzie Isaacs 21ebdc0130 Bugfixes from testrun 2022-04-26 10:49:06 +02:00
Ozzie Isaacs 6e8445fed5 Changed schedule start- and end-time to schedule start and duration
Localized display of schedule start-time and duration
Removed displaying scheduling settings if "APScheduler" is missing
Input check for start-time and duration
2022-04-25 17:00:07 +02:00
Ozzie Isaacs d83c731030 Reconnect only if reconnect is enabled 2022-04-25 08:28:29 +02:00
Ozzie Isaacs ae9a970782 Add button to update cover cache (for usecase sideloaded changed cover)
Bugfix logig start background schedue
2022-04-25 08:24:14 +02:00
Ozzie Isaacs 1e723dff3a Make texts in Background thread translatable 2022-04-24 18:40:50 +02:00
Ozzie Isaacs 8421a17a82 Always catch sqlite create_function error 2022-04-24 13:15:41 +02:00
Ozzie Isaacs bc96ff9a39 Enable scheduled side deleting of thumbnails of deleted books 2022-04-24 11:14:39 +02:00
Ozzie Isaacs bf049d8240 Make series cover cache invisible 2022-04-24 11:05:22 +02:00
Ozzie Isaacs 6e783cd7ee Make Task Stop Action green (marked as clickable) 2022-04-23 20:08:26 +02:00
Ozzie Isaacs 069dc2766f Update optional-requirements
Bugfix with serializing tasks
Bugfix order of tasks (id was used instead of task_id)
Code cosmetics
2022-04-23 20:03:59 +02:00
Ozzie Isaacs 2f5b9e41ac Reduce number visible System tasks in Tasks list 2022-04-22 20:31:03 +02:00
Ozzie Isaacs 9a8093db31 Thumbnail is generated directly after a book is added 2022-04-22 16:13:51 +02:00
Ozzie Isaacs 5c342d4e7c use get for dicts 2022-04-22 09:06:37 +02:00
Ozzie Isaacs 3c98cd1b9a Merge branch 'master' into cover_thumbnail
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2022-04-20 07:25:37 +02:00
Ozzie Isaacs 2303fc0814 Updated requirements
Update after testrun
2022-04-20 07:05:22 +02:00
Ozzie Isaacs a8680a45ca Bugfixes from Testrun
Update teststatus
2022-04-19 20:37:27 +02:00
Ozzie Isaacs d75d95f401 Merge remote-tracking branch 'epub_meta/master' 2022-04-18 20:07:01 +02:00
Ozzie Isaacs fbb6de7195 Merge remote-tracking branch 'translation/translation/Simplified_Chinese' 2022-04-18 20:02:09 +02:00
xlivevil 3cbbf6fa86
Update Simplifield Chinese translation 2022-04-18 14:52:31 +08:00
Ozzieisaacs c92d65aad3 Catch more errors on import metadata provider 2022-04-17 19:05:56 +02:00
Ozzieisaacs c61e5d6ac0 Fix amazon metadata-provider 2022-04-17 11:54:46 +02:00
Ozzieisaacs 130af069aa Merge remote-tracking branch 'douban/metadata_provider/douban'
# Conflicts:
#	cps/metadata_provider/amazon.py
#	cps/metadata_provider/lubimyczytac.py
2022-04-17 10:33:52 +02:00
Ozzieisaacs 09b381101b Added "None" to list of file formats, tags, series, languages
Unified languages.html and list.html template
2022-04-16 17:01:41 +02:00
Ozzieisaacs 35bb899879 Merge branch 'master' into cover_thumbnail 2022-04-14 20:03:43 +02:00
Ozzie Isaacs 6184e2b7bc Updated cve numbers 2022-04-14 19:58:15 +02:00
Ozzie Isaacs 2f3e5eadeb Bug fix after merge (renamed variable) 2022-04-13 19:34:14 +02:00
Ozzie Isaacs fe5d684d2c Merge branch 'master' into cover_thumbnail 2022-04-13 18:37:44 +02:00
Ozzie Isaacs df53a5d8c9 Prevent none comment while upload pdf documents 2022-04-13 18:37:23 +02:00
Ozzie Isaacs 83b99fcb1a Fix cover upload url with spaces at the end
Support image/jpg as upload format mimetype, remove redundant check of mimetype
2022-04-12 19:33:00 +02:00
Ozzie Isaacs 028e6855a7 Pagination button disapears in standard theme once infinite scroll is triggered 2022-04-12 18:45:06 +02:00
Wulf Rajek adf6728f14 Gracefully deal with incorrect dates 2022-04-12 00:22:05 +01:00
Ozzie Isaacs 652d0fd86f Update google-api-python-client version 2022-04-11 19:40:43 +02:00
Ozzie Isaacs 1136383b9a Bugfix for cli folder names as -p or -g parameters 2022-04-11 19:15:50 +02:00
Ozzie Isaacs d770e5392e Further fix for #2363 2022-04-06 11:12:57 +02:00
Ozzie Isaacs 3d2e7e847e Merge branch 'master' into cover_thumbnail
# Conflicts:
#	setup.cfg
#	test/Calibre-Web TestSummary_Linux.html
2022-04-05 19:11:11 +02:00
Ozzie Isaacs a63af5882e Fix for #2363 (Handle empty response from lubimyczytac metadata provider) 2022-04-05 19:04:42 +02:00
Wulf Rajek 2d0af0ab49 Add pubdate, publisher and identifiers metadata #2163 2022-04-05 01:26:35 +01:00
Ozzie Isaacs d912c1c476 Bugfix Quick start section 2022-04-04 14:37:39 +02:00
Ozzie Isaacs 42b0226f1a Fix for missing "query" entry in flask_session 2022-04-04 13:58:47 +02:00
Ozzie Isaacs 8adae6ed0c Handle permission errors for static files (Fix for #2358)
Version bump
2022-04-03 20:26:43 +02:00
Ozzie Isaacs fee76741a0 Update Testresult 2022-04-03 20:17:34 +02:00
Ozzie Isaacs f36d3a76be Return false if custom columns generate an error during connect database
Replaced existing with valid in readme to make it more clear what database is needed
2022-04-02 17:29:30 +02:00
Ozzie Isaacs afaf496fbe Merge branch 'master' into cover_thumbnail
# Conflicts:
#	cps/db.py
#	cps/templates/author.html
#	cps/templates/discover.html
#	cps/templates/index.html
#	cps/templates/search.html
#	cps/templates/shelf.html
#	cps/web.py
#	requirements.txt
#	test/Calibre-Web TestSummary_Linux.html
2022-04-02 11:57:18 +02:00
Ozzie Isaacs c06754975e Added bookeen to the reader for "simple theming" (#1861) 2022-04-02 11:37:02 +02:00
Ozzie Isaacs 834edadc28 Possible fix for #2350 and #2351 (databse locked)
Fix for #2309 (long unicode filenames could get to long)
2022-03-29 18:30:05 +02:00
Ozzie Isaacs 7861f8a89a Prevent problems with werkzeug and flask_login on new installations 2022-03-28 21:43:23 +02:00
Ozzie Isaacs 73d359af05 Bugfix logging with gdrive
Update optional-requirements.txt
2022-03-28 19:02:12 +02:00
Ozzie Isaacs 036cd7be48 Added cloud provider installation link 2022-03-28 14:22:18 +02:00
Ozzie Isaacs baffe1f537 Plus ("+" vs. "%2B") encoded search strings for opds search feeds are now working in request string (fix for #2175) 2022-03-28 14:09:28 +02:00
Ozzie Isaacs 2f949ce1dd Enabled search for text based custom column content in simple search (fix for #2279) 2022-03-28 14:09:28 +02:00
Ozzie Isaacs 32a3c45ee0 Refactored load read status for web access and opds access
Refactored and removed discover html page
Bugfix show author
Bugfix open dialog in author page
Fix for #2341 (advanced search with linked read column and read column having a higher number than number of available custom columns)
2022-03-27 12:21:19 +02:00
Ozzie Isaacs 14a6e7c42c Deactivated several functions for kindle tolino and kobo. Opening books now working for ebook readers 2022-03-25 18:30:12 +01:00
Ozzie Isaacs 2a5e9a97bb Fix #2349 (import error on python <3.7 dataclasses solved) 2022-03-24 18:19:41 +01:00
Nicolas Ferrari 504e58abdb
Installation on a Cloud Provider wiki link 2022-03-22 06:49:51 +01:00
Ozzie Isaacs a6a8f7eb43 Series Link in series view no longer clickable 2022-03-21 19:33:57 +01:00
Ozzie Isaacs 5070cc4c23 Merge branch 'master' into cover_thumbnail 2022-03-21 19:02:14 +01:00
Ozzie Isaacs 0d49b56883 Update gmail.json location 2022-03-21 18:50:02 +01:00
Ozzie Isaacs f5b79930ad Bugfix remember sort order of series and authors if entered from link below book cover (#2340) 2022-03-20 20:02:57 +01:00
Ozzie Isaacs c0d0660986 Added names for jobs to make log more readable
Bugfix logging delete thumbnail
2022-03-20 19:55:46 +01:00
Ozzie Isaacs ec53570118 Merge branch 'master' into cover_thumbnail
# Conflicts:
#	cps/editbooks.py
#	test/Calibre-Web TestSummary_Linux.html
2022-03-20 17:15:40 +01:00
Ozzie Isaacs 8cb5989c97 Catch additional error on not existing custom column linked to read column (#2341)
Prevent metadata changes are lost on edit books with errors (#2326)
Better log output
Renamed log message on database delete
2022-03-20 11:55:12 +01:00
Ozzie Isaacs 39459603d4
Update SECURITY.md 2022-03-19 18:01:51 +01:00
Ozzie Isaacs f34fc002da Implement missing cache delete Task identifier 2022-03-16 20:33:11 +01:00
Ozzie Isaacs 06e8845641 Implement delete thumbnail entry
Implement delete cache_dir on database change
2022-03-16 20:31:25 +01:00
Ozzie Isaacs 034ab73ccc Added environment variables for reconnect 2022-03-16 16:57:18 +01:00
Ozzie Isaacs 57cd8160a0 Removed accidently added line regarding "InstrumentedAttribute" 2022-03-16 16:28:58 +01:00
Ozzie Isaacs 399ddc5d6f Update testresults 2022-03-15 18:45:14 +01:00
Ozzie Isaacs d9a83e0638 Merge branch 'master' into cover_thumbnail
# Conflicts:
#	cps/editbooks.py
#	cps/helper.py
#	cps/web.py
#	test/Calibre-Web TestSummary_Linux.html
2022-03-14 19:41:47 +01:00
Ozzie Isaacs 8f3bb2e338 Bugfixes from testrun 2022-03-14 17:12:35 +01:00
Ozzie Isaacs 4545f4a20d Better epub cover parsing with multiple cover-image items
Code cosmetics
renamed variables
refactored xml page generation
refactored prepare author
2022-03-13 19:00:37 +01:00
Ozzie Isaacs 296f76b5fb Fixes after testrun
Code cosmetics
2022-03-13 10:23:13 +01:00
Ozzie Isaacs 3b5e5f9b90 Undo check of read checkbox in case of error
Display error message in details modal dialog
Bugfix set archive bit in booktable
Translate error message readstatus change
2022-03-12 22:16:33 +01:00
Ozzie Isaacs 8e2536c53b Improved cover extraction for epub files 2022-03-12 18:01:11 +01:00
Ozzie Isaacs 4379669cf8 Database error is more detailed
renamed debug_or_exception to error_or_exception
2022-03-12 17:14:54 +01:00
Ozzie Isaacs 2b31b6a306 Fix for #2325 (author sort order differs from authors order with readonly database) 2022-03-12 16:51:50 +01:00
Ozzie Isaacs 3a0dacc6a6 log message on not found author 2022-03-12 14:27:41 +01:00
Ozzie Isaacs 547ea93dc9 First fix for #2325 (edit book table with readonly database) 2022-03-12 10:19:21 +01:00
Ozzie Isaacs d80297e1a8 Bugfix sorting user table 2022-03-12 10:00:38 +01:00
Ozzie Isaacs 49692b4a45 Update catch errors for load metadata from amazon (#2333) 2022-03-12 08:27:42 +01:00
xlivevil b54a170a00
Add clean_date method in douban metadata_provider 2022-03-12 13:54:37 +08:00
Ozzie Isaacs 34478079d8 Prevent local variable 'from_book' referenced before assignment during merge of books
Merge books source book: Each book in own row
Merge books, sources are deleted before dialog shows up again
2022-03-09 14:45:51 +01:00
Ozzie Isaacs 753319c8b6 Version bump 2022-03-06 16:30:50 +01:00
Ozzie Isaacs c53817859a Version update
Updated testresult
2022-03-06 16:10:41 +01:00
Ozzie Isaacs 153a443fca Update setup config 2022-03-06 14:02:06 +01:00
Bharat KNV 9efd644360 Change dark theme from black to dark gray and add a black theme 2022-03-06 15:56:54 +05:30
Ozzie Isaacs 598618e428 Fix rename_files_on_change return handling
Updated test result
2022-03-01 16:36:46 +01:00
Ozzie Isaacs 965352c8d9 Don't allow redirects on cover uploads, catch more addresses which resolve to localhost 2022-02-26 08:05:35 +01:00
xlivevil 97cf20764b
Add exception handling and logger in metadata provider 2022-02-25 12:18:07 +08:00
xlivevil 695ce83681
Fix Uncaught RangeError 2022-02-25 01:12:22 +08:00
xlivevil 86b779f39b
Add douban metadate provider 2022-02-25 01:01:12 +08:00
Ozzie Isaacs 8007e450b3 Bugfix for cbr support without comicapi 2022-02-19 10:04:21 +01:00
Ozzie Isaacs 0aac961cde Update readme
Bugfix debug logging during update
unrar-free is now also recognized for displaying unrar version in about section, removed unused not configured string
2022-02-19 09:54:09 +01:00
Ozzie Isaacs ef7c6731bc Possible fix for #2301 (sending emails from custom domain name server) 2022-02-14 17:35:20 +01:00
Ozzie Isaacs e9b674f46e Fix a problem with sending emails from custom domain name server (#2301) 2022-02-13 16:17:04 +01:00
Ozzie Isaacs 8f665ebd58 Update Teststatus 2022-02-12 18:41:17 +01:00
Ozzie Isaacs 7bb3cac7fb Avoid problems with percent encoded utf-8 abstracts on certain chinese papers 2022-02-12 12:41:29 +01:00
Ozzie Isaacs 9c5970bbfc Bugfix for empty search results from google 2022-02-12 12:34:54 +01:00
Ozzie Isaacs ba23ada1fe Reenable showing of academic cover in case no cover was found from scholary 2022-02-12 12:32:35 +01:00
Ozzie Isaacs 86b621e768 refactored about
Update dependencies in setup.cfg
Improved detection of library change
2022-02-12 12:19:21 +01:00
Ozzie Isaacs 5f70406b30 Improved dependency check for executables 2022-02-12 12:14:02 +01:00
Ozzie Isaacs 6b026513cb refactored about 2022-02-12 12:12:30 +01:00
Ozzie Isaacs 0436f0f9b2 Improved dependency check for executables 2022-02-12 12:00:12 +01:00
Ozzie Isaacs 295888c654 Find imports in executables 2022-02-12 11:20:09 +01:00
Ozzie Isaacs 7317084a4e Update requirements 2022-02-12 11:11:08 +01:00
Ozzie Isaacs 0981337cdf Update optional_requirements 2022-02-09 20:57:39 +01:00
Ozzie Isaacs 461dd05e2f Readd cache directory to the excluded files during update 2022-02-08 20:18:32 +01:00
Ozzie Isaacs 764389ea2a small change 2022-02-08 20:15:01 +01:00
Ozzie Isaacs 4a0dde0371 Merge remote-tracking branch 'cover_images/thumbnails' into cover_thumbnail
# Conflicts:
#	cps/admin.py
#	cps/config_sql.py
#	cps/helper.py
#	cps/tasks/upload.py
#	cps/updater.py
#	cps/web.py
2022-02-08 19:55:20 +01:00
Ozzie Isaacs e22b3da601 Merge branch 'master' into Develop
# Conflicts:
#	cps/tasks/convert.py
#	test/Calibre-Web TestSummary_Linux.html
2022-02-07 13:57:50 +01:00
Ozzie Isaacs 7c623941de Bugfixes after testrun
Enabled re-encode of bookformats
2022-02-07 13:55:18 +01:00
Ozzie Isaacs 3bb41aca6d Bugfix for already present mobi file during convert (fixes #1900) 2022-02-06 18:57:58 +01:00
Ozzie Isaacs 0c3c0c0664 Improved logging of book title on upload 2022-02-06 16:33:12 +01:00
Ozzie Isaacs 411c13977f Fix for #2294 (cover files in epubs with property as property in manifest are now found) 2022-02-06 16:22:28 +01:00
Ozzie Isaacs 41f89af959 Log error in case gdrive.db folder can't be found 2022-02-06 14:23:35 +01:00
Ozzie Isaacs 895f68033f Improved detection of changed database 2022-02-06 14:22:55 +01:00
Ozzie Isaacs 2d49589e4b Merge branch 'Develop' 2022-02-06 10:43:15 +01:00
Ozzie Isaacs 89877835b3 Detect missing database file also in gdrive mode 2022-02-05 19:05:26 +01:00
Ozzie Isaacs 0ce41aef56 Detect missing database file also in gdrive mode 2022-02-05 19:05:14 +01:00
Ozzie Isaacs 5b3015619d Save book read status on edit in books table 2022-02-05 15:36:18 +01:00
Ozzie Isaacs 6ca08a7cc1 Prevent delete of everything if database wasn't really changed 2022-02-05 15:12:23 +01:00
Ozzie Isaacs 7254ce6c81 Prevent delete of everything if database wasn't really changed 2022-02-05 15:11:50 +01:00
Ozzie Isaacs cfa6b405da Upload files to gdrive with author rename working 2022-02-05 13:21:06 +01:00
Ozzie Isaacs 26a8ac1425 Mass rename author before last stage 2022-02-05 09:06:14 +01:00
Ozzie Isaacs 1ce45f3253 Update teststatus 2022-02-02 17:42:48 +01:00
Ozzie Isaacs a03c95329c Merge branch 'master' into Develop 2022-02-01 20:31:03 +01:00
Ozzie Isaacs e0bf829def Bugfix parsing /Keywords' in doc_info of pdf file with type bytes (fixes #2302) 2022-02-01 20:19:14 +01:00
Ozzie Isaacs 0bc15636f2 Bugfixes for renaming authors on gdrive 2022-02-01 20:08:42 +01:00
Ozzie Isaacs 61bfeae936 Merge branch 'master' into Develop 2022-01-31 19:20:02 +01:00
Ozzie Isaacs 95e0255aa1 Code cosmetics, removed scholarly from about section 2022-01-31 19:19:25 +01:00
Ozzie Isaacs 23e47ba4e6 Fix for #2299 (scholarly requires Internet connection at startup) 2022-01-31 18:09:23 +01:00
Ozzie Isaacs 4dcc44803c Update teststatus 2022-01-31 18:03:28 +01:00
Ozzie Isaacs 111ab121b1 Bugfix upload file with existing author 2022-01-30 21:27:06 +01:00
Ozzie Isaacs 1e04b51148 Renaming of co-authors which are authors in another book 2022-01-30 15:16:42 +01:00
Ozzie Isaacs 3ae1b97d72 Fix renaming title and author in the same request 2022-01-30 13:44:53 +01:00
Ozzie Isaacs 3123a914a4 Updated test results
Fix updater
Added comment regarding code taken from calibre source
2022-01-30 11:15:14 +01:00
Ozzie Isaacs f6b46bb170 Code cosmetics 2022-01-29 21:22:39 +01:00
Ozzie Isaacs bb7f4cf74e Added optional requirements for metadata amazon
Better logging of errors in metadata source files
2022-01-29 21:03:06 +01:00
Ozzie Isaacs 39ac37861f Added option to enable reconnect
Added option to perform dry run of updater
Added possibility to exclude files from updater
2022-01-29 14:47:45 +01:00
mmonkey 62ff6f7e8a Fixed tasks not running if scheduled time starts and ends on different days. 2022-01-28 23:48:44 -06:00
mmonkey 032fced9c7 Merge branch 'develop' into thumbnails 2022-01-28 23:15:50 -06:00
Ozzie Isaacs ae9c5da777 Merge branch 'master' into Develop:
Access to shelfs
2022-01-28 20:04:04 +01:00
Ozzie Isaacs 42f8209a4a Fixed access to shelfs 2022-01-28 20:01:33 +01:00
Ozzie Isaacs e757be6953 Merge remote-tracking branch 'amazon/master' into Develop 2022-01-27 19:13:59 +01:00
Ozzie Isaacs 4f3c396450 Merge remote-tracking branch 'lubimyczytac/add_lubimyczytac.pl_meta_provider' into Develop
# Conflicts:
#	optional-requirements.txt
2022-01-27 18:37:02 +01:00
mmonkey 50bb74d748 Add CSRF support for schedule task settings, fixed details page not loading 2022-01-27 00:35:45 -06:00
mmonkey 3416323767 Removed title tags from cover images 2022-01-26 23:56:10 -06:00
mmonkey 18ce310b30 Merge branch Develop into thumbnails 2022-01-26 23:51:50 -06:00
Ozzie Isaacs 6339d25af0 Bugfixes from testrun 2022-01-26 18:38:39 +01:00
quarz12 477b202c38 import try catch 2022-01-26 10:41:42 +01:00
quarz12 326d6e7b9d
Merge branch 'janeczku:master' into master 2022-01-26 10:38:39 +01:00
Ozzie Isaacs baf32f9045 Update Teststatus 2022-01-26 07:31:01 +01:00
Ozzie Isaacs 3c4cd22d9e Renaming files on gdrive seem to work 2022-01-25 21:14:21 +01:00
Ozzie Isaacs d9d6fb33ba Merge branch 'master' into Develop
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2022-01-25 19:33:21 +01:00
Ozzie Isaacs 17b4643b7c fix #2285 (Fix for shelf handling in caliblur theme) 2022-01-25 19:31:52 +01:00
Daniel 239f389c5c Merge remote-tracking branch 'origin/master' 2022-01-25 14:42:37 +01:00
Daniel 8362c82d54 amazon metadata 2022-01-25 14:42:28 +01:00
Daniel 62e7aca0fb amazon metadata 2022-01-25 14:33:34 +01:00
Ozzie Isaacs 6a37c7ca9d Version bump 2022-01-24 19:27:09 +01:00
Ozzie Isaacs e0e0422010 Upates for new release 2022-01-24 19:18:40 +01:00
Ozzie Isaacs 128db26301 Resolved merge conflicts 2022-01-24 18:49:21 +01:00
Ozzie Isaacs 01ab75a158 Updated requirements for gdrive and gmail
Updated teststatus
2022-01-24 18:47:34 +01:00
Ozzie Isaacs d9c10b830a Added variable to allow loading cover from localhost 2022-01-24 18:47:34 +01:00
Ozzie Isaacs 35f6f4c727 Deleted book formats remove book from synced to kobo table
updated teststatus
2022-01-24 18:47:34 +01:00
Ozzie Isaacs 3b216bfa07 Kobo sync token is now also created if accessed from localhost(fixes #1990)
Create kobo sync token button is now "unclicked" after closing dialog
Additional localhost route is catched
If book format is deleted this also deletes the book synced to kobo status
2022-01-24 18:47:34 +01:00
Ozzieisaacs e8e2f789e5 Fix #2287 (books can't be added to shelf from search) 2022-01-24 12:37:15 +01:00
Ozzie Isaacs d8f5bdea6d Refactor rename author/title on gdrive 2022-01-23 19:31:56 +01:00
Ozzie Isaacs 127bf98aac Merge branch 'master' into Develop
# Conflicts:
#	cps/templates/detail.html
#	test/Calibre-Web TestSummary_Linux.html
2022-01-23 17:51:54 +01:00
Ozzie Isaacs ede273a8f9 Added variable to allow loading cover from localhost 2022-01-23 13:43:35 +01:00
Ozzie Isaacs bc7a305285 Deleted book formats remove book from synced to kobo table
updated teststatus
2022-01-23 13:11:02 +01:00
Ozzie Isaacs d759df0df6 Kobo sync token is now also created if accessed from localhost(fixes #1990)
Create kobo sync token button is now "unclicked" after closing dialog
Additional localhost route is catched
If book format is deleted this also deletes the book synced to kobo status
2022-01-22 18:23:43 +01:00
Ozzie Isaacs bbef41290f Fix delete book format wasn't working 2022-01-22 14:01:32 +01:00
Ozzie Isaacs 81b85445d8 Added missing unique marker on comments table (#2278) 2022-01-22 11:51:34 +01:00
Ozzie Isaacs 35209ede67 Update cover extraction with comicapi for webp files (fixes #2280) 2022-01-22 10:31:18 +01:00
Ozzie Isaacs 0c0313f375 Prevent creating a public shelf without permission 2022-01-18 17:55:10 +01:00
Ozzie Isaacs 6bf0753978 Prevent wrong use of safe statement 2022-01-18 17:39:54 +01:00
Ozzie Isaacs a02f621f08 Added id for testability 2022-01-17 18:38:37 +01:00
Ozzie Isaacs de1bc3f9af Fix #2265 (add book to shelf on popup for book details)
Updated testresults
2022-01-17 17:46:57 +01:00
Ozzie Isaacs 01090169a7 Version bump
update dependencies in setup.cfg
Update security bug list
2022-01-16 12:55:15 +01:00
Ozzie Isaacs b564a97cdf Update version
Update testresult
2022-01-16 12:06:02 +01:00
Ozzie Isaacs a118fffc99 Added missing chardet (used by requests in older versions) 2022-01-15 19:58:13 +01:00
Ozzie Isaacs 5b59aab81a Udpate requirements and config.cfg 2022-01-15 18:34:21 +01:00
Ozzie Isaacs 7d3d0c661e Merge remote-tracking branch 'fr/master' 2022-01-15 09:19:55 +01:00
Ozzie Isaacs f6f20ebc77 Update teststatus 2022-01-15 09:18:51 +01:00
Thomas 58cb54c76f
small typo 2022-01-13 22:47:47 +01:00
Thomas 3fc326fa48
Update French translation 2022-01-13 22:45:16 +01:00
collerek 20b5a9a2c0
Merge branch 'master' into add_lubimyczytac.pl_meta_provider 2022-01-13 10:49:51 +01:00
Evan Peterson 4eaa9413f9
Kobo metadata return correct layout format for fixed layout 2022-01-10 15:15:19 -05:00
Ozzie Isaacs a50aff67a2 Merge remote-tracking branch 'korean/master' 2022-01-10 17:38:09 +01:00
Ozzie Isaacs 3c1f5fd37f Update Test results 2022-01-10 17:35:18 +01:00
byword77 8ae066c387
Add files via upload 2022-01-10 11:59:16 +09:00
Ozzie Isaacs 0feb62c142 Improvements delete user (delete also depending entries in tables)
Fixes kobo sync with sync only selected shelfs
2022-01-09 17:43:20 +01:00
Ozzie Isaacs 96b1e8960b Bugfix send to kindle with multiple formats 2022-01-09 12:55:38 +01:00
Ozzie Isaacs df67079573 Fixes for kobosync with multiple users (#2230) 2022-01-08 19:03:59 +01:00
Ozzie Isaacs e3dbf7a88d Bugfixes load metadata
Improvements for testing load metadata
2022-01-07 12:40:03 +01:00
byword77 8dd0585919
Add files via upload 2022-01-07 11:07:19 +09:00
Ozzie Isaacs c830a5936e Added dse to supported languages 2022-01-06 14:10:06 +01:00
Ozzie Isaacs 405f3c181f Added korean locale 2022-01-06 14:04:49 +01:00
Ozzie Isaacs 6d839d5cc7 Bugfixes from testrun 2022-01-04 21:12:59 +01:00
Ozzieisaacs bbadfa2251 bugfixes load metadata 2022-01-04 21:11:52 +01:00
Ozzieisaacs 7b8b2f93a0 Merge remote-tracking branch 'scholary/master' 2021-12-30 14:55:39 +01:00
Ozzieisaacs c1030dfd13 Update dependency scholary 2021-12-30 14:45:31 +01:00
Ozzieisaacs a90177afa0 Better version output in about page (exe file, pyPi, git commit string removed if empty) 2021-12-30 14:45:31 +01:00
Ozzieisaacs c095ee3c14 Fix #2243 (whitespaces are trimmed also for normal search) 2021-12-30 14:45:31 +01:00
Ozzieisaacs ae1f515446 Bugfix uncheck all ekements in books list and user list
Improved testability for books list
2021-12-30 14:45:31 +01:00
Ozzieisaacs 0548fbb685 Bugfix post commands without updater 2021-12-30 14:45:31 +01:00
Ozzieisaacs f22e4d996c Proxy kobo library sync at the end of local sync 2021-12-30 14:45:31 +01:00
Ozzieisaacs 3e0d8763c3 Prevent 2 public shelfs with same names due to changing public property 2021-12-30 14:45:31 +01:00
Ozzieisaacs 47f5e2ffb4 Remove python2 urllib imports
Fix for "javascript:" script links in identifier
2021-12-30 14:45:31 +01:00
Ozzieisaacs f39dc100b4 Migrated some routes to POST
- shelf massadd
- resetpassword
- delete shelf
- send to kindle
2021-12-30 14:45:31 +01:00
Ozzieisaacs 573c9f9fb4 Improved logging (right stacklevel on mail exceptions)
Updated jsonschema requirements
2021-12-30 14:45:31 +01:00
Ozzieisaacs 785726deee Migrated some routes to POST
- delete shelf, import ldap users
- delete_kobo token, kobo force full sync
- shutdown, reconnect, shutdown
2021-12-30 14:45:30 +01:00
Ozzieisaacs 7eb875f388 Improvement for gdrive rename authors 2021-12-28 17:13:18 +01:00
cbartondock 4edd1914b4 Fixed google scholar issues 2021-12-23 23:16:41 -05:00
cbartondock 222929e741 Fixed extra s in scholar metadata 2021-12-23 18:05:20 -05:00
cbartondock 70b67077cc Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-12-23 15:58:45 -05:00
Ozzie Isaacs ec73558b03 Bugfix advanced search for language
Update results from testrun
2021-12-23 19:18:09 +01:00
Ozzieisaacs bdedec90dd Catch more Gdrive errors (#2233) 2021-12-23 11:13:08 +01:00
Ozzieisaacs d45085215f Update Translation 2021-12-22 19:08:15 +01:00
Ozzie Isaacs 1a6579312f Add monkey.patch for gevent 2021-12-20 20:43:28 +01:00
Ozzie Isaacs b85627da5c Fix for adding/deleting visibility restrictions on custom columns/tags 2021-12-19 11:29:54 +01:00
Ozzie Isaacs 2e815147fb Merge branch 'master' into Develop
# Conflicts:
#	cps/kobo_sync_status.py
#	test/Calibre-Web TestSummary_Linux.html
2021-12-19 10:29:56 +01:00
Ozzie Isaacs 592288cb22 Fix inverted "convert to English characters" setting 2021-12-19 08:04:13 +01:00
Ozzie Isaacs 2e3a3ee460 Update dependencies in setup.cfg 2021-12-19 07:28:46 +01:00
Ozzie Isaacs b7927a0df1 Bugfix handling of stacktrace from calibre 2021-12-18 18:38:17 +01:00
Ozzie Isaacs 021298374e Improved debug output for task added
Improved handling of calibre output on windows
2021-12-18 17:31:33 +01:00
Ozzie Isaacs 92f65882b2
Added log4j statement 2021-12-16 06:21:16 +01:00
Bharat KNV 0693cb1ddb Added basic theming to the epub reader 2021-12-15 21:35:10 +05:30
collerek bea14d1784 fix locale for lubimyczytac languages 2021-12-15 15:20:01 +01:00
Ozzie Isaacs f0399d04b7 Merge remote-tracking branch 'bookmark_csrf/master' 2021-12-14 17:59:32 +01:00
Ozzie Isaacs 9b57fa25de Merge remote-tracking branch 'zh/master' 2021-12-14 17:52:12 +01:00
Ozzie Isaacs afbe77de3d Merge remote-tracking branch 'border/patch-1' 2021-12-14 17:50:02 +01:00
xlivevil d26d357151
Merge branch 'master' into master 2021-12-15 00:17:26 +08:00
Laurin Neff 4db9691cfc
Remove white border in full-screen cover preview 2021-12-13 19:36:21 +01:00
Ozzie Isaacs 45c433caab Added "hmj" to supported languages. Fix for "bit" language support (Fix #2217) 2021-12-13 18:26:47 +01:00
collerek 51bf35c2e4 unify scholar 2021-12-13 17:21:41 +01:00
collerek d64589914f add series, languages and isbn to google provider 2021-12-13 15:14:19 +01:00
collerek 362fdc5716 run lubimyczytac detail pages in threadpool 2021-12-13 02:14:53 +01:00
collerek d55626d445 refactor and cleaning 2021-12-13 01:23:03 +01:00
Ozzie Isaacs 25422b3411 Fix for #2195 Sync token only updated after complete library sync and sync token content is discarded on first sync to enable real forced full sync 2021-12-12 20:31:45 +01:00
Ozzie Isaacs 42bf40d7bb Change 2 timestamps to utctime 2021-12-12 19:54:17 +01:00
collerek 920acaca99 everything working to refactor 2021-12-11 01:06:04 +01:00
xlivevil a184f4e71a
Merge branch 'master' into master 2021-12-08 22:58:30 +08:00
cbartondock 4569188008 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-12-07 08:37:27 -05:00
Ozzie Isaacs 9d9acb058d Add button to force full kobo sync 2021-12-06 21:02:06 +01:00
Ozzie Isaacs 7d67168a4a Update test result 2021-12-06 20:27:25 +01:00
cbartondock 09751d8b87 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-12-05 19:00:15 -05:00
Ozzie Isaacs 6e15280fac Start renaming author names on gdrive 2021-12-05 19:01:23 +01:00
Ozzie Isaacs f78d2245aa Fixes from testrun 2021-12-05 18:48:21 +01:00
Ozzie Isaacs fd5ab0ef53 Bugfix handle archive bit 2021-12-05 18:01:56 +01:00
Ozzie Isaacs d217676350 Upated testresult
Bugfix book table
2021-12-05 13:09:41 +01:00
Ozzie Isaacs cd5711e651 Merge branch 'master' into Develop
# Conflicts:
#	cps/web.py
2021-12-04 20:56:04 +01:00
Ozzie Isaacs 3bf173d958 Added response for kobo-benefits route and kobo-gettest route 2021-12-04 15:44:41 +01:00
cbartondock 98d630d453 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-12-04 09:21:01 -05:00
Ozzie Isaacs eb2e816bfd Switch encoding in kobo metadata to ensure utf-8 characters to show up properly (finally) 2021-12-04 14:58:28 +01:00
Ozzie Isaacs bd01e840ca Delete books in shelfs, downloaded books, kobo sync status, etc on database change (fixes #620) 2021-12-04 11:50:25 +01:00
Ozzie Isaacs 91a21ababe Allow download of archived books 2021-12-04 11:16:33 +01:00
Ozzie Isaacs f4096b136e Added chinese sign language (csl) to supported languages 2021-12-04 10:57:53 +01:00
GarcaMan e2eab808c0 Merge branch 'long_strip_cbrreader' of github.com:GarckaMan/calibre-web into long_strip_cbrreader 2021-12-02 18:20:27 +00:00
GarcaMan 3ac08a8c0d After toggling fullscreen, focus on main container 2021-12-02 18:20:14 +00:00
cbartondock 7598dfe952 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-12-01 16:17:14 -05:00
Ozzie Isaacs 5ed3b1cf53 On master: Order of language count in /language (fixes #2200) 2021-12-01 21:38:43 +01:00
Ozzie Isaacs 7640ac1b3b Books are removed from synced books upon archiving (from kobo or calibre-web side)
unicode texts (title, author) are showing up right on kobo reader
Added some missing kobo routes (prevents 404 response)
Added a lot of debug output on kobo sync requests
2021-12-01 20:29:51 +01:00
Jonathan Fenske 66874f8163
Update read.html
include the CSR token input
2021-11-30 22:25:45 -06:00
Jonathan Fenske 3f91313303
Update epub.js
send the CSRF token when adding bookmarks
2021-11-30 22:24:34 -06:00
xlivevil 8438b2a07b
Update Simplified Chinese translation 2021-12-01 12:14:57 +08:00
xlivevil 67e3721530
fix(tinymce Simplified Chinese locale):rename zh_CN to zh_Hans_CN 2021-12-01 11:28:03 +08:00
cbartondock 2252d661c0 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-27 14:06:36 -05:00
Ozzie Isaacs 87e526642c Bugfix edit series_index
Bugfix invalid languages
2021-11-27 18:23:06 +01:00
Ozzie Isaacs 7f9da94a18 Tie visibility of upload buttons to upload right only 2021-11-27 17:43:51 +01:00
Ozzie Isaacs ec7c2db971 Added package variable for generating "exe" file with pyinstaller 2021-11-27 12:26:35 +01:00
Denis Rodríguez 3f56f0dca7
Removed parameter that was wrongly added 2021-11-25 01:30:20 -03:00
GarcaMan 7fc04b353b Selecting Position will not scroll the current image up 2021-11-24 20:22:10 +00:00
GarcaMan a8689ae26b first commit 2021-11-24 19:41:07 +00:00
cbartondock fcd2b68359 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-23 13:59:43 -05:00
Ozzie Isaacs a1d372630d Added missing language bit (fixes #2187)
Added handling of wrong .jpg cover file content
Guest sorting options are now stored in the session
Updated teststatus
2021-11-23 19:32:48 +01:00
cbartondock fc859afb92 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-22 09:59:36 -05:00
Ozzie Isaacs 2e0d0a2429 Update requirements 2021-11-21 18:31:35 +01:00
Ozzie Isaacs d084a06e63 Bugfix create shelf for users not allowed to create public shelfs 2021-11-21 16:21:27 +01:00
Ozzie Isaacs e880238cb9 Add missing filter for current user in KoboSyncedBooks queries 2021-11-21 16:19:32 +01:00
cbartondock f58c5bee1c Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-21 09:23:52 -05:00
Ozzie Isaacs cbb9edac19 Bugfix search in books list
Fix renaming upper to lowercase letters
Update test results
2021-11-21 13:23:34 +01:00
Ozzie Isaacs 1b8bd27b3c Added cve number for csrf bug 2021-11-21 12:35:53 +01:00
Ozzieisaacs 1e9d88fa98 Merge branch 'master' into Develop 2021-11-21 10:22:44 +01:00
Ozzieisaacs 6cb713d62c Added filtering of languages
Bugfix show all allowed languages in user settings in case restrictions currently apply
2021-11-21 10:21:45 +01:00
Ozzieisaacs 642af2f973 Added support for missing locale Enu 2021-11-21 09:28:03 +01:00
Ozzieisaacs 6deb527769 Merge branch 'master' into Develop 2021-11-21 09:14:36 +01:00
Ozzieisaacs 9273843062 Removed double declared functions 2021-11-21 09:14:16 +01:00
cbartondock 2989586c6d Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-20 18:54:38 -05:00
Ozzie Isaacs 5ede079401 Handling of invalid cover files on upload 2021-11-20 13:45:41 +01:00
Ozzie Isaacs 7ad419dc8c Fix upload of cover and book formats containing html characters 2021-11-20 13:40:23 +01:00
Ozzie Isaacs bcdc976414 Added missing check for creating public shelfs 2021-11-20 13:00:54 +01:00
Ozzie Isaacs 6aad9378b8 Fix visiblility upload right on enabled upload feature 2021-11-20 12:44:34 +01:00
Ozzie Isaacs 6f5390ead5 Changed error message in case of trying to delete a shelf unauthorized
Removed outcommented text
2021-11-20 12:17:03 +01:00
Ozzie Isaacs d624b67e93 Fix #2174 (default sorting order now is timestamp again) 2021-11-20 11:57:51 +01:00
Ozzie Isaacs 01cc97c1b2 Added langugae support for Cholón (fixes #2183) 2021-11-20 11:32:51 +01:00
Ozzieisaacs 8e5bb02a28 Merge author rename 2021-11-20 13:28:45 +04:00
Ozzieisaacs 4fd4cf4355 Merge branch 'master' into Develop
# Conflicts:
#	cps/static/css/style.css
#	cps/web.py
2021-11-13 17:41:16 +04:00
Ozzieisaacs baba205bce Rename everything on rename authors 2021-11-11 18:46:32 +04:00
cbartondock 7c016265d2 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-10 08:59:23 -05:00
Ozzie Isaacs 974549b1af
Removed technosoft2000 docker container 2021-11-08 20:36:41 +04:00
Ozzieisaacs add502d236 Fix opds search and opds list of read books 2021-11-07 20:18:33 +04:00
cbartondock 294c594cbb Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-06 14:19:37 -04:00
Ozzieisaacs 60aa016734 Handling of missing required dependency during dependency check 2021-11-06 21:17:48 +04:00
Ozzieisaacs 27e8fbd248 Show dependencies in about section from automatic dependency check
Bugfix and refactored dependency check
Added output of googledrive dependencies as fallback option
2021-11-06 20:58:51 +04:00
cbartondock d856c4d78e Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-04 14:00:51 -04:00
Ozzieisaacs 25b09a532f Fixed missing handle_error in convert calibre task (database readonly case) 2021-11-04 21:23:02 +04:00
Ozzieisaacs c1f4ca36b6 Current sorting order visible in all sidebar selectors, and search results
Sorting "hot" books only ascending and descending according to download numbers
Downloaded books sorting according to authors name working
2021-11-04 20:51:48 +04:00
Ozzieisaacs 58379159fb Fix shown cover in series grid view (#979) 2021-11-04 17:32:31 +04:00
Ozzieisaacs 17470b3b56 Check versions of dependencies at startup and generate logfile output if not fitting (#2157) 2021-11-04 16:38:55 +04:00
Ozzieisaacs 42cc13d1e2 Mark which functions are selected on list pages 2021-11-03 21:07:16 +04:00
Ozzieisaacs ecc5cb167e Upload setting in user template only visible if upload enabled
Delete book setting only visible if edit book setting is ticked
2021-11-03 20:32:17 +04:00
Ozzieisaacs d72210c6ae Exclude upload rights visibility if upload is not activated 2021-11-03 19:05:24 +04:00
Ozzieisaacs 61deda1076 Updated security history 2021-11-03 18:29:30 +04:00
Ozzieisaacs 1e0ff0f9c2 Fix #2045 ("fetch metadata" update appends to the existing tags instead or replacing them) 2021-11-03 18:16:15 +04:00
cbartondock 00bf1f5ec9 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-02 14:25:46 -04:00
Ozzieisaacs 2b6f5b1565 Fix csrf check in list pages 2021-11-02 21:32:29 +04:00
cbartondock e5abc5f281 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-02 13:09:59 -04:00
Ozzieisaacs 95371d0d7f Fix shelf grid ordering for inverted order at page load
Ordering buttons now visible on medium size screens
2021-11-02 20:27:50 +04:00
Ozzieisaacs c7df8a1a34 Fix missing csrf token in series grid view 2021-11-02 18:57:28 +04:00
Ozzieisaacs b414d91964 Fix for #2162 (Epub viewer isn't displaying images) 2021-11-02 18:55:56 +04:00
cbartondock 82164fc8e7 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-11-01 10:00:18 -04:00
Ozzieisaacs a5415e00d5 Fix grid to list in series view
Fix sort asc, desc in author and series list
2021-11-01 13:11:49 +01:00
cbartondock 434029270b Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-31 20:42:21 -04:00
Ozzie Isaacs b3b85bf692 Fix position read mark in standard theme 2021-10-31 16:33:35 +01:00
Ozzie Isaacs a36c6da3ae Fix position read mark in standard theme 2021-10-31 16:30:51 +01:00
Ozzie Isaacs 9e72c3b40d Fix position read mark in standard theme 2021-10-31 16:18:27 +01:00
cbartondock a0cebfbfb1 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-31 08:29:27 -04:00
Ozzie Isaacs 64e833f5d6 Updated readme
Version Bump
2021-10-31 12:00:20 +01:00
Ozzie Isaacs 4da64ceb23 Update to version 0.6.14 2021-10-31 11:31:53 +01:00
cbartondock 99ec99b539 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-30 13:28:56 -04:00
Ozzie Isaacs 3077b854d7 Merge remote-tracking branch 'de/patch-1' 2021-10-30 16:37:53 +02:00
Ozzie Isaacs a8317d900b Bugfix for edit custom ratings in list edit mode
Bugfix for deleting custom enum in list edit mode
2021-10-30 15:50:17 +02:00
KN4CK3R 668bf3a15e
Fix typo in german translation 2021-10-30 13:41:33 +02:00
Ozzie Isaacs 481e52b503 Removed technosoft2000 docker reference 2021-10-30 09:56:39 +02:00
Ozzie Isaacs bbb65ec804 Merge remote-tracking branch 'trustedhost/master' 2021-10-30 09:40:04 +02:00
Ozzie Isaacs 4b7b646692 Merge remote-tracking branch 'autocap/patch-1' 2021-10-30 09:36:48 +02:00
Ozzie Isaacs 65cfb1ccbc Merge remote-tracking branch 'it/patch-26' 2021-10-30 09:34:56 +02:00
Ozzie Isaacs 9e9d7b3642 Merge remote-tracking branch 'mime/fix_mime_type_not_executable' 2021-10-30 09:33:37 +02:00
Ozzie Isaacs 1294672809 Bugfix search with excluded shelfs 2021-10-30 07:31:12 +02:00
i7-8700 857584a929 fix "MIME type ('text/plain') is not executable" on windows 2021-10-27 11:33:56 +08:00
cbartondock 75c68d92ec Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-26 09:58:36 -04:00
ElQuimm b4772d9b66
Update italian version of message.po 2021-10-26 11:10:46 +02:00
Ozzie Isaacs 3cfffa1487 Fix for iOS covers are not displayed during infinite scroll on standard theme 2021-10-25 20:06:22 +02:00
Ozzie Isaacs 382cd9458f Fix for #2126 (iOS covers are not displayed during infinite scroll on standard theme) 2021-10-25 20:03:48 +02:00
Ozzie Isaacs be7ac7e163 Update infinite scrolling javascript 2021-10-25 19:17:10 +02:00
Ozzie Isaacs 3a1a32f053 Update infinite scrolling javascript 2021-10-25 19:16:52 +02:00
cbartondock 27f71d910b Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-24 18:59:10 -04:00
Ozzie Isaacs f6a2b8a9ef Read and archive bit visible in book table 2021-10-24 21:32:19 +02:00
Bernat 9f260128cf
Prevent virtual keyboard login auto capitalization
Stops virtual keyboards, such as the ones on mobile devices, to default to uppercase for the first letter of the login user input field.
2021-10-24 20:14:47 +02:00
Ozzie Isaacs cdd38350fe Updated tinymce editor, enabled raw html edit 2021-10-24 17:14:50 +02:00
Ozzie Isaacs 516e76de4f Updated tinymce editor, enabled raw html edit 2021-10-24 17:13:57 +02:00
Ozzie Isaacs 4c7b5999f7 Archived Flag available in book list array 2021-10-24 10:57:29 +02:00
Ozzie Isaacs bb20979c71 Merge branch 'master' into Develop 2021-10-24 09:49:42 +02:00
Ozzie Isaacs 917909cfdb Refactored books detail page 2021-10-24 09:48:29 +02:00
Ozzie Isaacs aefed40a2f Fix for missing message "flask-wtf not installed" 2021-10-23 18:44:29 +02:00
cbartondock 88278672d8 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-23 09:45:11 -04:00
Ozzie Isaacs bd0071354c Remove include subdomwains from hsts protection (#2114) 2021-10-23 09:45:04 +02:00
cbartondock c6bf62a6eb The recent changes to content security policy broke custom theming. I fixed it by adding a trusted hosts field to Server Configuration 2021-10-22 15:35:10 -04:00
cbartondock 95544ef885 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-22 09:20:11 -04:00
Ozzie Isaacs fe4db16a7e html editor in books list 2021-10-21 20:13:04 +02:00
cbartondock 9b127a9f97 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-21 11:09:47 -04:00
Ozzie Isaacs 9e4aeac16d Remove WTF_CSRF_SSL_STRICT workaround for missing referrers 2021-10-17 16:00:02 +02:00
cbartondock 9653308300 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-17 09:50:11 -04:00
Ozzie Isaacs 7671a1d5c8 Fix errormessage after update 2021-10-17 15:36:19 +02:00
Ozzie Isaacs bd6b5ac873 Fix load covers in metadata load screen 2021-10-17 15:06:37 +02:00
Ozzie Isaacs 00dc60da79 Added translation for traditional chinese 2021-10-17 15:02:16 +02:00
Ozzie Isaacs 708861bcd5 Enabed edit of custom texts (including categories) in books list 2021-10-17 14:29:13 +02:00
Ozzie Isaacs 24a2c0a5cf Enable edit of custom text in book table 2021-10-17 14:11:52 +02:00
Ozzie Isaacs 1e1d3a7c81 Enable edit of enum column in books list 2021-10-17 14:05:18 +02:00
Ozzie Isaacs 2ebddcfee3 Lowered version of needed flask-wtf dependency (#2137) 2021-10-17 10:05:50 +02:00
Ozzie Isaacs 4517f5b0cb Fix #2138 (Icons not showing in caliblur theme) 2021-10-17 10:00:04 +02:00
Ozzie Isaacs 666015e867 Fix datepicker localized month names
Removed redundant parenthesis in kobo.py response
2021-10-16 20:53:44 +02:00
Ozzie Isaacs 9d5e9b28ae Enabled editing of "number" custom_columns in books list 2021-10-16 20:46:16 +02:00
Ozzie Isaacs 6f1e78b9a3 Bugfix book list with language restriction or archived books 2021-10-16 20:43:22 +02:00
cbartondock d5aa345da6 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-16 14:40:56 -04:00
Ozzie Isaacs e060c62742 Fix exit on missing flask-wtf 2021-10-16 18:42:26 +02:00
cbartondock 5695268d1b Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-16 09:27:39 -04:00
Ozzie Isaacs cea10d3945 Merge remote-tracking branch 'comic_sort/comic_reader_sort' 2021-10-16 11:50:46 +02:00
Ozzie Isaacs fe21d15194 Merge remote-tracking branch 'cn/fix/bootstrap-table-locale'
# Conflicts:
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-af.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ar.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-bg.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ca.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-cs.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-da.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-de.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-el.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-et.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-eu.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fa.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fi.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-he.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-hr.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-hu.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-id.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-it.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ja.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ka.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ko.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nl.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pl.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pt_BR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ro.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ru.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sk.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sv.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-tr.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-uk.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-zh_Hans_CN.min.js
2021-10-16 11:48:00 +02:00
Ozzie Isaacs 369d5059c3 Merge remote-tracking branch 'br/patch-2' 2021-10-16 11:43:27 +02:00
Ozzie Isaacs 56a9c62421 Merge remote-tracking branch 'cn/chinese/master'
# Conflicts:
#	cps/templates/search_form.html
2021-10-16 11:41:09 +02:00
Ozzie Isaacs b4262b1317 Merge branch 'master' into Develop 2021-10-16 11:37:57 +02:00
Ozzie Isaacs 50d703e2d8 Chunked reading status on kobo sync
Bugfix loading text on shelf delete
Bugfix sort books list according to selection without selection
2021-10-16 11:28:35 +02:00
cbartondock 5aefc893de Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-15 15:58:11 -04:00
Ozzie Isaacs 6e5d9d7657 Bugfix toggle readstatus in modal dialog 2021-10-15 19:26:20 +02:00
Ozzie Isaacs 1be7dfcdca Merge remote-tracking branch 'origin/master' 2021-10-15 18:57:18 +02:00
Ozzie Isaacs e58eb8dac1 Show checkbox from boolean custom columns on details page with caliblur theme 2021-10-15 18:57:00 +02:00
Ozzie Isaacs d02eb842c7 Update testresults 2021-10-12 18:40:04 +02:00
Ozzie Isaacs f3efef1f60 Fix stored css bug in all typeahead functions (update typeahead -> bugfix typeahead) 2021-10-11 19:56:54 +02:00
cbartondock 659481c83b Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-10-11 09:55:09 -04:00
Ozzie Isaacs bad4c01474 Fix stored css bug in all typeahead functions (update typeahead -> bugfix typeahead) 2021-10-10 18:02:18 +02:00
Ozzie Isaacs cd53d57516 Fix for remote login 2021-10-10 10:26:01 +02:00
Ozzie Isaacs ac54899415 Bugfixes kobo sync 2021-10-10 10:23:58 +02:00
Ozzie Isaacs abe46e1862 Show checkbox from boolean custom columns on details page with caliblur theme 2021-10-09 15:01:38 +02:00
Ozzie Isaacs 3be47d6e57 edit_books prepared for kobo sync 2021-10-09 14:57:23 +02:00
Ozzie Isaacs 25f608d109 Bugfixes from testrun (load images from gdrive)
Fix locale for new users
2021-10-09 09:37:10 +02:00
Ozzie Isaacs aca5324914 Bugfix arrange shelf
Bugfix remote login
Bugfix perform Update
2021-10-06 22:06:33 +02:00
Ozzie Isaacs d8f9e2feb2 Bugfixes for user import with default locale and default language
Bugfixes from testrun
2021-10-06 18:41:01 +02:00
Ozzie Isaacs ed26d34961 Code cleaning (remove python2) 2021-10-04 19:23:24 +02:00
Ozzie Isaacs 50919d4721 Added handling for missing flask-wtf dependency
Added CSRF protection (via flask-wtf)
Moved upload function to js file
Fixed error page in case of csrf failure
2021-10-04 19:23:20 +02:00
Ozzie Isaacs 5edde53fed Improved sync for kobo with additional table 2021-10-03 09:58:45 +02:00
Ozzie Isaacs 1c15e10ac0 Improved csrf protection for remote login 2021-10-03 09:58:45 +02:00
Ozzie Isaacs 52be2ad4a2 Improved DJVU Reader 2021-10-03 09:32:29 +02:00
Ozzie Isaacs 43fdef5e53 Improved textreader 2021-10-03 09:31:24 +02:00
Ozzie Isaacs b699796236 Improved CSRF protection 2021-10-03 08:03:14 +02:00
Ozzie Isaacs b82d03c12c Removed js from search_form, tasks
Added translation of bootstrap-select in user table
2021-10-03 08:01:58 +02:00
Ozzie Isaacs b8eb557761 Corrected translation german -> Anzeigesprache 2021-10-03 08:00:53 +02:00
Ozzie Isaacs ba40c6693e Merge remote-tracking branch 'filepicker/fix-filemodal' 2021-10-02 08:32:44 +02:00
Ozzie Isaacs e064a3ec2b Removed unnecessary spaces in book convert texts 2021-10-02 07:53:36 +02:00
GarcaMan f6561456f7 New sort for Comic Reader 2021-10-01 05:47:52 +00:00
xlivevil deb91996a8
fix:bootstrap-table locale
Add data-locale in table tag
Add bootstrap-table-locale-all-min-js
Remove bootstrap-table locale dir
2021-09-30 20:09:02 +08:00
mmonkey cd3791f5f4 Always use full-sized image for book edit and details pages 2021-09-30 01:43:31 -05:00
Ozzie Isaacs cd1fe6dde0 Fix #2085 (Misaligned shelf names after glyphicon) 2021-09-29 19:26:21 +02:00
Ozzie Isaacs 3f6a466ca7 Further language support fixes (displaying "non locale" languages translated) 2021-09-29 19:00:02 +02:00
cbartondock 50f4fe6546 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-09-29 09:34:11 -04:00
mmonkey 9e7f69e38a Updated series cache timeout to one day 2021-09-29 03:01:28 -05:00
mmonkey 46205a1f83 Made long running tasks cancellable. Added cancel button to cancellable tasks in the task list. Added APP_MODE env variable for determining if the app is running in development, test, or production. 2021-09-29 02:40:12 -05:00
Ozzie Isaacs 861277460d Merge remote-tracking branch 'origin/master' 2021-09-28 18:50:11 +02:00
Fernando Mesquita 83babf88fc
msgid "Read Books" --> msgstr "Livros Lidos" 2021-09-28 12:03:07 -03:00
Ozzieisaacs 58735caff3 Enhancements for displaying languages on non english locale 2021-09-26 17:04:53 +02:00
mmonkey 26071d4e7a Added Scheduled Tasks Settings 2021-09-26 02:02:48 -05:00
cbartondock 844eb6c379 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-09-25 15:33:56 -04:00
xlivevil 1b8410e786
Update Simplified Chinese translation 2021-09-25 23:15:44 +08:00
xlivevil fed9eff7b8
Fix the publishstart option in advsearch 2021-09-25 22:10:46 +08:00
xlivevil bf5de95fdc
Update Simplified Chinese translation 2021-09-25 22:08:05 +08:00
Ozzie Isaacs 2e25e797dd Fix #2002 (Added missing default locale and default language view upon importing ldap user) 2021-09-25 14:08:49 +02:00
Ozzie Isaacs c1ac68e2ae Fix #2053 (Hovering on cover, now shows tooltip also in Caliblur! Theme) 2021-09-25 14:01:17 +02:00
Ozzie Isaacs 623a92ebec Version Bump
Merge branch 'Develop'
2021-09-25 10:49:20 +02:00
mmonkey 0bd544704d Added series cover thumbnail generation. Better cache file handling. 2021-09-25 03:04:38 -05:00
Ozzie Isaacs 2edcd16119 Update version to 0.6.13 for release 2021-09-25 08:34:20 +02:00
Ozzie Isaacs af202bd6d1 Merge remote-tracking branch 'pt_br/patch-1' 2021-09-25 08:25:06 +02:00
Ozzie Isaacs d5a332a84e Update test results 2021-09-25 08:23:14 +02:00
Fernando Mesquita d6884164a5
Update messages.po
Read = Leia > Lido
2021-09-25 01:07:31 -03:00
mmonkey be28a91315 Simplified all of the thumbnail generation and loading. 2021-09-24 03:11:14 -05:00
cbartondock 707556a36d Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-09-23 09:14:51 -04:00
Ozzie Isaacs 356a4f588e Merge remote-tracking branch 'nl/master' 2021-09-22 20:43:29 +02:00
Ozzie Isaacs 241b31458d Added ancient and modern Greek translation to greek language 2021-09-22 20:34:18 +02:00
Ozzie Isaacs efb04ddd8f Fix #2061 (Defective utf-16 txt files) 2021-09-22 19:58:20 +02:00
mmonkey 524ed07a6c Handle read only access to cache dir gracefully. minor cleanup 2021-09-21 23:39:00 -05:00
mmonkey 8bee2b9552 Added CACHE_DIR env variable, graceful handling when APScheduler is not installed 2021-09-19 22:45:19 -05:00
Anatolii Fetisov 781ca7a3f3 Fix filemodal file selection dialog 2021-09-18 09:49:28 +03:00
mmonkey d648785471 Review feedback fixes 2021-09-17 01:42:56 -05:00
mmonkey 9a08bcd2bc Started addressing some PR comments 2021-09-16 23:20:11 -05:00
mmonkey 04a5db5c1d Resolve merge conflicts 2021-09-16 22:58:54 -05:00
Jeroen Hellingman 6f6d8df431
Update messages.po
Review of Dutch translations (native speaker); improving consistency in vocabulary still needed.
2021-09-02 11:25:58 +02:00
cbartondock 9ebde57fc3 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-31 18:44:18 -04:00
Ozzie Isaacs 8dc1e9bfa4 Updated test result 2021-08-31 08:33:09 +02:00
Ozzie Isaacs e3db2796c9 Merge branch 'master' into Develop
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2021-08-30 20:18:21 +02:00
Ozzie Isaacs 42ef049b63 Catch error on ldap import 2021-08-30 20:17:56 +02:00
cbartondock 8930426f2a Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-30 11:35:10 -04:00
Ozzie Isaacs ceffa3a108 Removed xss on shelf add/remove action 2021-08-30 17:06:11 +02:00
Ozzie Isaacs c0a06eec46 Removed xss on shelf add/remove action 2021-08-30 17:05:53 +02:00
Ozzie Isaacs 86ef1d47e8 Bugfixes from testrun 2021-08-30 08:02:21 +02:00
cbartondock b835aa660a Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-29 14:05:21 -04:00
Ozzie Isaacs 4d92d7da3a Removed timelogging on metadata search 2021-08-29 14:37:15 +02:00
Ozzie Isaacs d1e6a85803 Parallel requests of metadata provider 2021-08-29 14:36:05 +02:00
Ozzie Isaacs d8bad7394a Merge remote-tracking branch 'caliblur/master' 2021-08-29 13:31:46 +02:00
Ozzie Isaacs f5062d1354 Merge remote-tracking branch 'it/patch-1' 2021-08-29 13:31:21 +02:00
Ozzie Isaacs 1d79d9ded2 Bugfix from tests (displaying of book languages in user list) 2021-08-29 11:31:10 +02:00
Ozzieisaacs 10e212fcde Merge branch 'master' into Develop 2021-08-29 10:44:13 +02:00
Ozzie Isaacs 1fa267ce1b Final fix for escaping html special chars in tables 2021-08-28 15:47:57 +02:00
cbartondock abcf9a1808 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-28 09:35:12 -04:00
Ozzie Isaacs d4cfad6363 Fixed several text problems from tasks
Fixed task update
2021-08-28 11:32:13 +02:00
Ozzie Isaacs 3a24561ca2 Removed additional " from convert message 2021-08-28 10:32:40 +02:00
Ozzie Isaacs 5c19a8aacc Bugfix edit comments
Testupdate
2021-08-28 08:24:38 +02:00
Ozzie Isaacs 3946ef8f0d Merge branch 'master' into Develop
# Conflicts:
#	cps.py
#	cps/web.py
2021-08-27 16:16:24 +02:00
cbartondock 6a2868c68d Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-27 10:13:05 -04:00
Ozzie Isaacs 7ae3255ea9 Revert Content-Security-Policy header 2021-08-27 14:28:30 +02:00
Ozzie Isaacs 91e6d94c83 Improved displaying of username and task title in tasks 2021-08-27 14:27:35 +02:00
Ozzie Isaacs e615073893 Add all html special characters to the escaped characters in bootstrap table 2021-08-27 12:56:08 +02:00
Ozzie Isaacs 32e27712f0 Added lxml to needed requirements
Improved displaying of series title, book of series, comments and custom comments
2021-08-27 09:43:32 +02:00
cbartondock ff39fac50f Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-26 17:58:53 -04:00
Daniela Mazza 80d3ba42b4
Update messages.po
Changed translate of "Read Books": the meaning is exactly "Libri letti", not "Libri da leggere"
2021-08-26 19:16:38 +02:00
Ozzie Isaacs d25cfb7499 Fix for #2097 (Quotes are now handled properly in UI-editable tables) 2021-08-26 18:03:59 +02:00
cbartondock 24ad15be11 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-19 08:30:13 -04:00
Ozzie Isaacs a35c635987 Update python metadata search 2021-08-18 21:38:20 +02:00
Ozzie Isaacs aa9fdd2ada Merge branch 'master' into Develop 2021-08-18 20:32:33 +02:00
Ozzie Isaacs afa585eb65 Added -f flag for compatibility reasons 2021-08-18 20:32:13 +02:00
cbartondock 03acb77162 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-08-15 12:06:55 -04:00
Ozzie Isaacs 28ca39ca13 Add logging of user sessions 2021-08-15 12:43:19 +02:00
cbartondock b05c17b8bb Fixed book covers being too wide in search/shelves/discover on mobile 2021-08-14 21:50:05 -04:00
cbartondock 3839af65c4 add python-version to gitignore for managed pyenv compatibility 2021-08-14 15:57:09 -04:00
Ozzie Isaacs 275e073c42 Fix #2085 (Missing spaces between glyphicon and text on sidebar) 2021-08-10 20:17:30 +02:00
Ozzie Isaacs c4876010e9 Merge remote-tracking branch 'pdf/master' 2021-08-09 16:46:19 +02:00
xlivevil bce69b2dfc Add pdf.js font file 2021-08-07 20:51:10 +08:00
xlivevil fb97e39d9f Merge branch 'master' of https://github.com/xlivevil/calibre-web 2021-08-05 21:39:04 +08:00
xlivevil 913690df78 Fix #1913(set lazyload in pdf reader)
Add favicon.ico in pdf reader
2021-08-05 21:37:39 +08:00
Ozzie Isaacs e68a3f18fa Merge branch 'master' into Develop 2021-08-01 20:23:19 +02:00
Ozzie Isaacs 1534827ad7 With merge button disabled it's no longer possible to open merge dialog 2021-08-01 20:23:04 +02:00
Ozzie Isaacs b36422bc05 Update list/grid button action (reverse proxy problem) 2021-08-01 20:06:48 +02:00
Ozzie Isaacs 1e2335dea0 Merge remote-tracking branch 'caliblur/master' 2021-08-01 17:35:30 +02:00
Ozzie Isaacs e052590270 Merge remote-tracking branch 'chinese/master'
# Conflicts:
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
#	messages.pot
2021-08-01 17:31:47 +02:00
Ozzie Isaacs 41ca85268f Update translation files 2021-08-01 17:27:18 +02:00
Ozzie Isaacs 0e9709f304 Make Book-No. of book-range to translatable text 2021-08-01 17:09:29 +02:00
Ozzie Isaacs ceec1051d5 Added option to save books with no nenglish characters
Imporvements on metadata search
2021-08-01 13:50:17 +02:00
cbartondock 81ccc11c9c fixed dropdowns going off screen in caliblur 2021-07-31 12:51:51 -04:00
Ozzie Isaacs 702e96ddd6 Update load metadata 2021-07-31 09:18:05 +02:00
Ozzie Isaacs 53603f79bd Get_meta button unfocused on return to edit books 2021-07-31 09:00:34 +02:00
Ozzie Isaacs 250cafe814 Merge branch 'master' into Develop 2021-07-30 21:00:01 +02:00
Ozzie Isaacs 16633ef1d3 Fix #2029 (Import LDAP User with "." in the name) 2021-07-30 20:45:33 +02:00
Ozzie Isaacs f0a5225524 Merge branch 'master' into Develop 2021-07-30 16:58:30 +02:00
Ozzie Isaacs a32b36bf81 Fixed missing joins for sorting according to series in read/unread and rated views 2021-07-30 16:58:20 +02:00
Ozzie Isaacs 302679719d Merge branch 'master' into Develop
# Conflicts:
#	cps/admin.py
#	cps/converter.py
#	cps/subproc_wrapper.py
#	test/Calibre-Web TestSummary_Linux.html
2021-07-30 16:33:06 +02:00
Ozzie Isaacs a63baa1758 better logged in session protection 2021-07-30 16:28:37 +02:00
cbartondock 752192a057 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-07-30 09:34:50 -04:00
Ozzie Isaacs e245a147d9 Revert accidentally committed store user session 2021-07-30 10:16:52 +02:00
Ozzie Isaacs 0ec2bcd897 Fixes from testrun 2021-07-30 09:25:19 +02:00
xlivevil 19c75d6790 Update Simplified Chinese translation 2021-07-29 14:00:02 +08:00
cbartondock 0654156dd6 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-07-27 11:24:23 -04:00
Ziding Zhang e4b0434733 Create SECURITY.md
A simple instruction for security researchers in future.
2021-07-27 13:22:24 +02:00
cbartondock b32721c293 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-07-27 06:39:29 -04:00
Ozzie Isaacs c5e39a7523 Fix divs in user edit page 2021-07-27 08:09:57 +02:00
cbartondock 0db837c0ce Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-07-26 14:44:16 -04:00
Ozzie Isaacs 53dae32897 Fix multiple messages on windows after change config with reboot 2021-07-26 16:50:21 +02:00
Ozzie Isaacs 018f3ca250 Sort authors additionally to series and series_index (Fix #2001)
Sqlalchemy version2 is now a global flag
2021-07-26 07:52:01 +02:00
Ozzie Isaacs a1a8a0cf29 Logout if logged out and don't allow to get logged in afterwards 2021-07-25 05:24:03 +02:00
Ozzie Isaacs f9c3e751f6 Fixes for handling shelf requests without title 2021-07-24 05:49:16 +02:00
Ozzie Isaacs c7b057ec51 Merge remote-tracking branch 'shelf_edit/security_fixes' into master 2021-07-24 05:34:24 +02:00
Ozzie Isaacs 85ea762054 Handle shelf request without title 2021-07-24 05:33:51 +02:00
Ozzie Isaacs 56cd62ed90 Fix show edit user after exception 2021-07-23 20:12:37 +02:00
Ozzie Isaacs 9a8c342e61 Fix deleting user (deleting shelfs and so on failed before) 2021-07-23 20:03:20 +02:00
Ozzie Isaacs 3b81ea37f4 Fix entries of user table are visible if database has no tags 2021-07-23 19:46:01 +02:00
Ozzie Isaacs 3c8bfc31e4 fix change name allowd as non admin 2021-07-23 19:34:46 +02:00
Ileana Maricel Barrionuevo 59881367fe Security fixes: Report 85176e1f-7920-4824-87ea-8eb5b5e505e0: Exposure of Private Personal Information to an Unauthorized Actor in janeczku/calibre-web 2021-07-22 01:05:11 -03:00
Ileana Maricel Barrionuevo c8ebaee0f7 Security fix improved: user should not edit other shelve's titles 2021-07-22 00:41:07 -03:00
Ileana Maricel Barrionuevo d5d0ad50fa Fixed security issue: a user could edit others' shelves. 2021-07-21 22:08:41 -03:00
cbartondock 6ef792d65d Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-07-12 12:08:55 -04:00
Ozzie Isaacs 20fa9f5523 Fix encoding errors on windows while downloading logbooks 2021-07-12 17:33:35 +02:00
Ozzie Isaacs 616cc2018a Fix show cover
Update more debug output for kobo sync
2021-07-12 14:58:03 +02:00
Ozzie Isaacs e69b1adccd Fix #2053 (Add tooltip for complete title on hover over cover and title) 2021-07-12 14:17:28 +02:00
Ozzie Isaacs 280efad939 #2052 (wrong series index shown for series_index >=100) 2021-07-12 14:04:23 +02:00
Ozzie Isaacs 15ec6bec95 fix #2014 (User menu dropdown in caliblur is tiny and presents scrollbars)
Fix display of nonexistent series_index
Fix caliblur add-to-shelf
2021-07-11 13:15:13 +02:00
Ozzie Isaacs aae81c3d24 Fix #2048 (Display book title in reader) 2021-07-11 12:52:46 +02:00
Ozzie Isaacs 259ac94b93 Fix error unclosed IO on external binary version query 2021-07-11 09:19:27 +02:00
Ozzie Isaacs a27314464a Merge branch 'master' into Develop 2021-07-11 08:50:14 +02:00
Ozzie Isaacs 87f07003f4 Removed invalid code
Sqlalchemy 2.0 compatibility for kobo sync
2021-07-11 08:49:47 +02:00
Ozzie Isaacs 1bf065fd04 Bugfix with encoding errors windows 2021-07-11 07:38:15 +02:00
Ozzie Isaacs f8de7e75cc Fix error unclosed IO on external binary version query 2021-07-11 09:19:46 +02:00
cbartondock 7d586b3745 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-07-10 13:21:27 -04:00
Ozzie Isaacs a56e071a19 Fix #2043 (Multiuser kobo sync with restrict to shelfs working)
Sync only selected shelfs is stored correct on creating user
2021-07-10 17:09:04 +02:00
Ozzie Isaacs 480aecb16c Fix #2046 (Deleting book with additional "/" in database path is working) 2021-07-10 08:27:29 +02:00
Ozzie Isaacs ec7803fa76 Update python search Metadata 2021-07-10 07:38:16 +02:00
cbartondock 91938fd18a Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-07-08 15:52:14 -04:00
Ozzie Isaacs aa2d3d2b36 Update python search Metadata 2021-07-07 21:24:29 +02:00
Ozzie Isaacs d5e9cdc5b7 Search Metadata improvements 2021-07-07 21:10:38 +02:00
Ozzie Isaacs 305e75c0ae Clarification for pip command 2021-07-07 16:42:05 +02:00
Ozzie Isaacs 0d247fef6a Fixes for grab metadata in python 2021-07-06 20:24:27 +02:00
Ozzie Isaacs 94da61c57e Basic Metadata mechanism in python 2021-07-05 18:55:54 +02:00
Ozzie Isaacs 430ccd9ab1 Merge branch 'master' into Develop 2021-06-29 18:52:02 +02:00
Ozzie Isaacs 47d94d9bd6 Search metadata without installed google scholar working (fix #2024) 2021-06-29 18:38:02 +02:00
Ozzie Isaacs a6d1f6039d Merge remote-tracking branch 'es/spanish-translation' into master
# Conflicts:
#	cps/translations/es/LC_MESSAGES/messages.po
2021-06-29 18:30:37 +02:00
Ozzie Isaacs 31234a4b98 Merge remote-tracking branch 'fr/Update-French-transations' into master
# Conflicts:
#	cps/translations/fr/LC_MESSAGES/messages.po
2021-06-29 18:25:57 +02:00
Ozzie Isaacs 476275ea53 Merge remote-tracking branch 'po/master' into master
# Conflicts:
#	cps/translations/pl/LC_MESSAGES/messages.po
2021-06-29 18:25:25 +02:00
Ozzie Isaacs 792d4a65bc Fix typo 2021-06-29 18:24:35 +02:00
Ozzie Isaacs 0e2dca5f4d Fix upload of books uppercase extensions (#2038) 2021-06-26 20:14:52 +02:00
Ozzie Isaacs 557296b7be Fix upload of books uppercase extensions 2021-06-26 20:13:56 +02:00
JFernando122 2236191263 Fixing typos on spanish translation 2021-06-22 23:37:19 -05:00
JFernando122 1138c86868 improved spanish translation with adrocampo's review 2021-06-22 14:22:28 -05:00
Thomas 08500c66a8
Update French translations
The French translation is normally completely now
2021-06-19 16:01:25 +02:00
Ozzie Isaacs 67836006c5 Successfull testrun 2021-06-19 14:44:57 +02:00
JFernando122 fa03a9ee25 Updated spanish translation 2021-06-17 21:49:04 -05:00
cbartondock bf4564e365 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-06-13 21:38:25 -04:00
Radoslaw Kierznowski 6a96664381 Update translations 2021-06-12 15:41:48 +02:00
Ozzie Isaacs e6e3032f02 Merge remote-tracking branch 'pl/master' into master 2021-06-12 08:52:14 +02:00
Ozzie Isaacs 6d424f0a30 Merge remote-tracking branch 'nl/patch-1' into master 2021-06-12 08:50:51 +02:00
Ozzie Isaacs a6f0375db3 Merge remote-tracking branch 'it/patch-25' into master 2021-06-12 08:50:13 +02:00
Ozzie Isaacs 1833e8fdb4 Success message after database change 2021-06-12 08:48:55 +02:00
Radoslaw Kierznowski 70151c2e11 Update Translations 2021-06-10 15:23:12 +02:00
JVT038 ab69962e8a
Completed Translation for Dutch (NL) 2021-06-09 20:26:09 +02:00
ElQuimm 075fe994af
Update italian message.po
Updated version
2021-06-08 21:11:36 +02:00
Ozzie Isaacs 1aca1b9fdd Fixed duplicate ids in logviewer 2021-06-06 16:14:30 +02:00
Ozzie Isaacs 9fea5a55f4 Merge branch 'master' into Develop 2021-06-06 12:18:04 +02:00
Ozzie Isaacs 1a0bf45c34 Check file/folder permissions before update 2021-06-06 12:16:47 +02:00
Ozzie Isaacs 67874e07b6 Fix routes for reverse proxy 2021-06-05 18:41:52 +02:00
Ozzie Isaacs ced0bcfe33 Fix missing " in books table 2021-06-05 18:41:52 +02:00
Ozzie Isaacs 8c0aa79f78 Fix #1915 (more than 10 books at a time are displayed in books table) 2021-06-05 18:41:52 +02:00
Ozzie Isaacs 93e8c5be32 Fixes for flask version 2.1
Fixes for compatibility with sqlalchemy 2.0
2021-06-05 18:41:42 +02:00
Ozzie Isaacs d9f86aecd2 Fix change_permission 2021-06-05 13:51:16 +02:00
Ozzie Isaacs e9552fedef Merge branch 'master' into Development 2021-06-05 10:23:06 +02:00
Ozzie Isaacs 84e1c6e809 Fix for #2004 (pdf viewer buttons missing in safari) 2021-06-05 08:08:08 +02:00
Ozzie Isaacs aadd6fd7e0 Possible fix for #2003 (Calibre theme download icon broken) 2021-06-03 12:35:09 +02:00
Ozzie Isaacs 59987ed359 Merge branch 'master' into Develop 2021-05-28 18:22:43 +02:00
Ozzie Isaacs a79600c81f Mass change book title and author (fix #1996) 2021-05-28 18:22:29 +02:00
Ozzie Isaacs e8a4c3c6b9 Merge remote-tracking branch 'shields/patch-3' into master 2021-05-28 17:46:53 +02:00
Ozzie Isaacs 62fce26651 Bugfix extended search term with excluded series/shelfs 2021-05-28 14:57:35 +02:00
Ozzie Isaacs 25add6511f Catch error on search for new custom column (created after start of calibre-web) 2021-05-28 14:54:18 +02:00
Ozzie Isaacs b2a28cd39a Merge branch 'Develop' into master 2021-05-28 14:23:47 +02:00
Ozzie Isaacs 6de3aebf3a Fix for #1998 (Error 500 with configured oauth on user setup page accessed by admins) 2021-05-28 14:23:30 +02:00
Ozzie Isaacs 1b7e422772 Changed error page to display logout route in case of unconfigured 2021-05-28 13:56:07 +02:00
Ozzie Isaacs b0f48b7f00 Merge branch 'master' into Develop 2021-05-26 19:58:10 +02:00
Ozzie Isaacs 94b07d05c1 First half of #1996 (editing single books) 2021-05-26 19:57:58 +02:00
Ozzie Isaacs 4392fec7f5 Added fullscreen cover viewer 2021-05-26 19:40:41 +02:00
flying-sausages c1d0ec076b
Shield cleanup 2021-05-26 17:20:54 +02:00
Ozzie Isaacs a47d6cd937 Fix confirm dialog database change
Gdrive setup basically working again
Moved basicconfig behind login
Database setup separated from other setup
Config page is using ajax (flask >2 and slow computers)
2021-05-26 14:50:44 +02:00
Ozzie Isaacs dcdb5e2a9e Merge branch 'master' into Develop 2021-05-22 19:52:53 +02:00
Ozzie Isaacs 240325dc18 Update installation instructions 2021-05-22 19:52:20 +02:00
Ozzie Isaacs e599d2ec05 Merge remote-tracking branch 'scholar/master' into master 2021-05-22 19:30:57 +02:00
Ozzie Isaacs c62a417cbf Merge branch 'Develop' into master 2021-05-22 19:29:58 +02:00
Ozzie Isaacs 98fc1ee0a7 Comic reader code cleaning 2021-05-22 19:28:30 +02:00
Ozzie Isaacs 78d0fd811b Version bump 2021-05-22 14:57:55 +02:00
Ozzie Isaacs 54d06e580d Release version 0.6.12 2021-05-22 14:08:46 +02:00
Ozzie Isaacs a62fca1e55 Merge branch 'master' into Develop 2021-05-22 11:28:59 +02:00
Ozzie Isaacs 7b1d23eba4 Restored Discord Widget 2021-05-22 10:03:48 +02:00
Ozzie Isaacs 2502c279fc Update discord 2021-05-22 09:57:47 +02:00
Ozzie Isaacs 878fc8c2fd Added download stat badge 2021-05-21 20:58:10 +02:00
Ozzie Isaacs 64902eebcb Merge remote-tracking branch 'batches/patch-2' into master 2021-05-21 20:54:06 +02:00
flying-sausages e520f6afc4
Add Shields to README.md 2021-05-20 22:48:51 +02:00
Ozzie Isaacs 0cc1ae9324 Updated Testresult for Linux 2021-05-20 17:54:25 +02:00
cbartondock 1b2124aa35 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-05-19 16:47:19 -04:00
Ozzie Isaacs bd4fde9e63 Fix #1992 handle invalid numbers of books seriesindex 2021-05-19 19:54:44 +02:00
Ozzie Isaacs c85cfa90a4 Update testresults on windows
Added encoding on fb2 upload
2021-05-19 19:21:09 +02:00
Ozzie Isaacs a0449b50c8 Downgrade flask -> to slow during reboot 2021-05-17 17:54:43 +02:00
Ozzie Isaacs 010c0bfc7d Improved error handling for content too long 2021-05-16 14:07:16 +02:00
Ozzie Isaacs 394b063b8c Fixes for caliblur theme 2021-05-16 13:25:29 +02:00
Ozzie Isaacs 251780bed6 Added google scholar as metadata provider 2021-05-16 13:24:42 +02:00
Ozzie Isaacs decc2a9c79 Merge branch 'master' into Develop 2021-05-16 13:19:38 +02:00
Ozzie Isaacs b62d84424e Merge remote-tracking branch 'comic/comic_viewer_changes' into master 2021-05-16 13:19:28 +02:00
Ozzie Isaacs e15324d2cd Merge branch 'master' into Develop 2021-05-16 09:38:00 +02:00
Ozzie Isaacs 20b84a9459 Unified translations
Update translations for release
2021-05-16 09:37:45 +02:00
Ozzie Isaacs 109198a374 Merge branch 'master' into Develop 2021-05-16 09:03:58 +02:00
Ozzie Isaacs dafc68f049 Updated requirements 2021-05-16 09:03:47 +02:00
Ozzie Isaacs 3e5c944365 Changed backend for comic reader, now supports rar5 2021-05-16 08:35:20 +02:00
Ozzie Isaacs d95838309e Added config option for shelf sync behavior 2021-05-15 10:45:51 +02:00
Ozzie Isaacs 4745fc0db1 Bugfix search for publish dates and custom column dates
Bugfix save umplauts in comments unescaped (as calibre does)
Improved testability
2021-05-15 07:51:32 +02:00
Ozzie Isaacs b3648187ff Bugfix search for publishdates and custom column dates
Bugfix save umplauts in comments unescaped (as calibre does)
Improved testability
2021-05-15 07:51:12 +02:00
cbartondock b35483edf8 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-05-14 23:31:05 -04:00
Ozzie Isaacs f29088e854 Merge branch 'master' into Develop
# Conflicts:
#	cps/kobo.py
2021-05-14 19:59:35 +02:00
Ozzie Isaacs b009dfe4ee Always use bootstrap datepicker 2021-05-14 19:58:06 +02:00
Ozzie Isaacs eba94f430c Updated js libs 2021-05-14 09:29:24 +02:00
Ozzie Isaacs 06347b7e3c Bugfixes from testrun 2021-05-14 08:26:56 +02:00
Ozzie Isaacs 6bc426b21d Fix edit_books.js 2021-05-14 07:29:48 +02:00
cbartondock e0fac8d2c0 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-05-13 11:25:59 -04:00
Ozzie Isaacs 4a849aab7f Merge remote-tracking branch 'requirements/patch-1' into master 2021-05-13 16:28:54 +02:00
Ozzie Isaacs ad2d0c84e4 Update swedish translation 2021-05-13 16:28:02 +02:00
Ozzie Isaacs 6bf360fbfb Added "comments" type to supported custom columns 2021-05-13 14:00:01 +02:00
Ozzie Isaacs 380292a8aa Custom column datetime now searchable (#1984) 2021-05-13 13:31:36 +02:00
jonyxx-alt f9949da745
Update Swedish translation
Upload files that has been updated
2021-05-13 11:04:57 +00:00
Ozzie Isaacs b0cc52e0aa Enable custom column datetime (adv. search not working yet) #1984 2021-05-13 10:39:36 +02:00
Ozzie Isaacs 9ef705650b Access pages with stored order per default (#1987)
Fix for toggle-text of enable-sort button on shelf page
2021-05-13 09:41:27 +02:00
Ozzie Isaacs c6dadbe75e restrictions are now applied to kobo sync requests (Fix #1938) 2021-05-13 09:17:01 +02:00
cbartondock 0a65c05083 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-05-07 09:05:27 -04:00
Robert Schütz 21026340ad remove singledispatch from requirements
It's not used anywhere.
2021-05-05 14:30:00 +02:00
Ozzieisaacs eb2273247f Changed texts in edit shelf page for Kobo shelf sync 2021-05-02 15:59:40 +02:00
Ozzieisaacs 02fc698f1c Some little code refactoring 2021-05-02 10:05:25 +02:00
Ozzieisaacs 8dc11e89bd Merge remote-tracking branch 'koko_sync/feature/kobo-shelf' into Develop 2021-05-02 09:43:47 +02:00
cbartondock 12c3264000 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-05-01 21:55:09 -04:00
Ozzieisaacs b34672ed19 Merge branch 'master' into Develop 2021-05-01 20:54:01 +02:00
Ozzieisaacs 541c8c4b93 Improved error handling for disapearing custom column linked to visiblility restrictions 2021-05-01 20:52:48 +02:00
Ozzieisaacs b97373bf37 Improved error handling for disapearing custom column linked to read status 2021-05-01 18:42:57 +02:00
Ozzieisaacs c0b561cb5a Better input check for custom_columns 2021-05-01 17:10:29 +02:00
Ozzieisaacs bd3ccfd0a9 Merge remote-tracking branch 'cn/master' into master 2021-05-01 16:33:47 +02:00
Ozzieisaacs 5470acd3af Fix #1964 (RefreshError with unconfigured gdrive) 2021-05-01 12:45:28 +02:00
Ozzie Isaacs 64696fe973 Bugfixes edit user list (Fix #1938) 2021-05-01 08:36:39 +02:00
cbartondock f2cd93dc54 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-29 10:01:18 -04:00
Ozzie Isaacs ed2fa4cdd8 Update error handling for user list (#1938) 2021-04-28 20:49:16 +02:00
cbartondock c2c4636961 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-28 08:43:44 -04:00
dalin 03cca1d1c0 update Simplified Chinese 2021-04-28 16:15:21 +08:00
dalin 354b075885 Merge remote-tracking branch 'upstream/master' 2021-04-28 14:15:42 +08:00
Ozzie Isaacs de7f039b99 Update list user editor (#1938) 2021-04-27 20:01:17 +02:00
cbartondock c2e530af17 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-26 13:49:25 -04:00
Ozzie Isaacs 19797d5d23 Merge remote-tracking branch 'it/patch-24' into master 2021-04-26 19:05:25 +02:00
Ozzie Isaacs 144c2b5fc7 Renaming ipadress - ip_address
Bugfix user table
Result testrun
Updated cn translation
2021-04-26 19:03:01 +02:00
cbartondock 577b525508 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-26 10:23:24 -04:00
GarcaMan 7da40d1c2e Added option to remove Y-Scrollbar and reset page scroll 2021-04-25 19:59:53 +00:00
Ozzie Isaacs 4e3a5ca33b Added additional debug messages, catch additional errors in updater 2021-04-25 11:30:53 +02:00
Ozzie Isaacs 97e4707f72 user list column value and tags editor (#1938)
Bugfixes for massedit in user list (#1938)
Changed no. of debug messages
2021-04-25 10:43:01 +02:00
cbartondock 541dd6b579 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-22 18:12:19 -04:00
Ozzie Isaacs 450ee43677 Additional logging for emails 2021-04-22 19:14:56 +02:00
cbartondock e57229e670 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-22 12:22:45 -04:00
Ozzie Isaacs c0b2e886d2 bugfix books list with selected books and stored on state 2021-04-21 19:28:22 +02:00
Ozzie Isaacs bb4749c65b Result for testrun
Added mass delete of users
refactores user table refresh
Bugfix for sorting with selected users
Bugfix delete books #1938
2021-04-21 19:23:56 +02:00
cbartondock 1ef2a96465 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-19 12:20:54 -04:00
ElQuimm 5aa37c68a2
Updated version of italian.po
Thank you.
2021-04-19 10:11:26 +02:00
Ozzie Isaacs 6e5a1a1f4d Merge remote-tracking branch 'add_Babelio/patch-1' into master 2021-04-18 12:05:00 +02:00
Ozzie Isaacs b624ce16c3 Merge remote-tracking branch 'it/patch-23' into master 2021-04-18 12:04:08 +02:00
Ozzie Isaacs 3be5b5f919 Merge remote-tracking branch 'comic_reader/master' into master 2021-04-18 12:02:21 +02:00
Ozzie Isaacs 04ac5b69ac Further improvements on user list #1938 2021-04-18 12:01:11 +02:00
Ozzie Isaacs 9cc14ac5c7 Fix for #1905 prevent invalid json data in gmail_token 2021-04-18 11:33:14 +02:00
BuildTools 755eb1405b Fix progress bar direction 2021-04-18 04:25:45 +09:00
subdiox 0138294b36 Fix an issue that space key doesn't work intentionally when inverting reading direction 2021-04-18 03:20:41 +09:00
Ozzie Isaacs c0a4addf30 Cancel button in User edit now leads to the right page back #1938 2021-04-17 18:30:55 +02:00
Ozzie Isaacs 39bbee0eeb Books sort with non Books table column working #1938 2021-04-17 10:27:30 +02:00
Ozzie Isaacs 39dda3f534 Fix opds login with colon in password #1952 2021-04-15 18:02:52 +02:00
Ozzie Isaacs 1cb8dbe795 Update migration routine 2021-04-15 17:42:39 +02:00
cbartondock 85f1ca6101 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-15 08:43:28 -04:00
Ozzie Isaacs e13820bbf0
Update exception upon migration of database #1935 2021-04-15 12:05:03 +02:00
malletfils 3973362457
Update db.py
Just adding support for Babelio (french website about books) in the link section
2021-04-14 19:57:02 +02:00
cbartondock 2f3f13afb9 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-14 09:30:05 -04:00
Ozzie Isaacs b38877e193 Document change 2021-04-13 19:47:55 +02:00
Ozzie Isaacs 0e1dbb5377 Copy author names for displaying (#1935) 2021-04-13 19:41:44 +02:00
Ozzie Isaacs f07cc8b103 Update optional-requirements: flask-dance
Catch error for invalid oauth tokens
Fixes for displaying error messages on deleting books from list
Fixes for displaying error messages on deleting bookformats
Removed non working sorting in books list
2021-04-13 19:26:10 +02:00
Ozzie Isaacs 67775bc797 Update requirements
Catch error for invalid oauth tokens
Fixes for displaying error messages on deleting books from list
Fixes for displaying error messages on deleting bookformats
2021-04-13 19:08:02 +02:00
ElQuimm 05933a5f0c
Updated italian message.po
I have not removed the #, fuzzy lines, but modified the corresponding values.
2021-04-13 18:51:50 +02:00
cbartondock e15ebd5aac Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-12 19:02:26 -04:00
Ozzie Isaacs d32b2ca524 Prevent traceback after delete user
flash message in case last admin role is removed #1938
2021-04-12 19:04:27 +02:00
Ozzie Isaacs d0a895628e Prevent delete of Guest user #1938 2021-04-12 18:45:44 +02:00
Ozzie Isaacs 90f2b3fb21 Refactored list checkbox sort 2021-04-12 18:39:09 +02:00
Ozzie Isaacs 0f95800dde Update sqlalchemy-utils dependency for oauth
Sort for state checkbox in user list and books list working
2021-04-12 18:23:25 +02:00
cbartondock ff99cd2456 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-11 16:26:55 -04:00
Ozzieisaacs 04971f8672 Bugfix wrong js file in user list 2021-04-11 20:01:40 +02:00
Ozzieisaacs b6177b27f4 Sorting of users in table according to selection possible 2021-04-11 19:59:20 +02:00
Ozzieisaacs ae97e87506 Delete user working from user table (#1938)
Comment in helper
2021-04-10 11:32:25 +02:00
cbartondock df91ca500f Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-08 20:25:02 -04:00
Ozzie Isaacs 2d73f541c0 Bugfix sort books list and user list
Prevent transferring password hash to client
2021-04-08 19:37:08 +02:00
Ozzie Isaacs 7561eabe52 Implement Backend to deny editing Guest rights restriction #1938 2021-04-07 18:56:17 +02:00
Ozzie Isaacs 067fb1b0b7 Prevent delete Guest user and redirect to admin page after user delete 2021-04-07 18:47:48 +02:00
Ozzie Isaacs 78071841cc After Deleting a book the list page is still displayed #1938 2021-04-07 18:19:48 +02:00
Ozzie Isaacs fac232229e Added missing ead/unread category in user list #1938 2021-04-07 17:49:19 +02:00
Ozzie Isaacs a43021e87c Fix for #1938 2021-04-07 17:46:17 +02:00
cbartondock eb599373ee prevented dropdowns from going off screen in caliblur 2021-04-06 13:21:36 -04:00
cbartondock 7b529b5f9e merge remote 2021-04-06 13:05:55 -04:00
Ozzie Isaacs 1a0de3b3cf Merge remote-tracking branch 'de_translation/patch-1' into master 2021-04-06 18:08:32 +02:00
Ozzie Isaacs 947154dc9c Merge branch 'development' into master 2021-04-06 18:06:25 +02:00
Ozzie Isaacs 8acd1f1fe4 Code refactoring and improved error handling for edit user list
Update teststatus
2021-04-06 17:29:42 +02:00
Ozzie Isaacs 665210e506 Fixes for book edit with title sort and author sort 2021-04-04 14:01:06 +02:00
Ozzie Isaacs 91b9370a21 Merge branch 'master' into development
# Conflicts:
#	cps/static/css/libs/bootstrap-table.min.css
#	cps/static/js/libs/bootstrap-table/bootstrap-table-editable.min.js
#	cps/static/js/libs/bootstrap-table/bootstrap-table.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-af-ZA.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ar-SA.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-bg-BG.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ca-ES.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-cs-CZ.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-da-DK.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-de-DE.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-el-GR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-en-US.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-AR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-CL.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-CR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-ES.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-MX.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-NI.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-SP.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-et-EE.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-eu-EU.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fa-IR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fi-FI.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-BE.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-CH.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-FR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-LU.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-he-IL.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-hr-HR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-hu-HU.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-id-ID.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-it-IT.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ja-JP.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ka-GE.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ko-KR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ms-MY.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nb-NO.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nl-BE.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nl-NL.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pl-PL.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pt-BR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pt-PT.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ro-RO.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ru-RU.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sk-SK.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sv-SE.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-th-TH.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-tr-TR.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-uk-UA.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ur-PK.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-vi-VN.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js
#	cps/static/js/libs/bootstrap-table/locale/bootstrap-table-zh-TW.min.js
2021-04-02 17:13:22 +02:00
Ozzie Isaacs ca0aa600b4 Bugfix german translation 2021-04-02 17:12:26 +02:00
Ozzie Isaacs 1c42c4c969 Update bootstrap-table
Fixes for book edit
2021-04-02 17:11:16 +02:00
cbartondock 389f0ae452 Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-04-02 10:41:25 -04:00
Ozzie Isaacs 6e406311c3 Fix #1928 (ldap_import_user_filter missing in to_save) 2021-04-02 08:40:29 +02:00
cbartondock 00a24756f4 get rid of ugly outline on hover over book 2021-04-01 14:06:24 -04:00
cbartondock 9025f312cc Fixed read in browser button in caliblur theme 2021-04-01 13:53:53 -04:00
cbartondock d5e453edd3 added scholarly to libraries in about page 2021-03-31 22:43:23 -04:00
cbartondock 26cc64bdd6 Use google scholar to fetch metadata 2021-03-31 22:16:00 -04:00
robochud 87884c1af2
Update messages.po
very little typo
2021-03-31 00:56:12 +02:00
Ozzie Isaacs c0623a949c Merge remote-tracking branch 'caliblur/master' into master 2021-03-29 20:54:04 +02:00
cbartondock 42a23ea23c removed some dumb graphical inconsistencies 2021-03-29 14:35:48 -04:00
cbartondock 710c31d1ca Fixed book details not loading after infinite scroll 2021-03-29 14:13:22 -04:00
cbartondock f637ba4dad Fixed border display in book details 2021-03-29 13:52:09 -04:00
Ozzie Isaacs 80d2c60cef Update testresults 2021-03-29 18:03:09 +02:00
Ozzie Isaacs b17d71e4c3 Update optional-requirements.txt
Bugfix Mail task after convert task
2021-03-28 20:36:08 +02:00
Ozzie Isaacs 3c5bd3a605 Added gmail.json file to excluded file, added file also to excluded file during update 2021-03-28 15:01:56 +02:00
Ozzie Isaacs 7cc8d1e693 remove file 2021-03-28 14:58:07 +02:00
Ozzie Isaacs 99520d54a5 Added ability to send emails via gmail (#1905)
Gmail email sending
2021-03-28 14:51:01 +02:00
Ozzie Isaacs e10a8c078b Merge branch 'master' into development
# Conflicts:
#	cps/templates/email_edit.html
2021-03-27 18:36:11 +01:00
Ozzie Isaacs 7a196fed7c Prevent empty email port and server address(#1906) 2021-03-27 18:34:57 +01:00
Ozzie Isaacs c418c7e725 Prevent empty email from field (#1906) 2021-03-27 18:31:49 +01:00
Ozzie Isaacs e35748deff Fix wording and tabs 2021-03-27 17:30:54 +01:00
Ozzie Isaacs b57efbe31c Fix wording and tabs 2021-03-27 17:30:10 +01:00
Ozzie Isaacs 8f91437701 Implementation for gmail server with OAuth2 started 2021-03-27 16:36:24 +01:00
Ozzie Isaacs a7eb547ca4 Renamed brazilian datepicker file 2021-03-27 12:40:23 +01:00
Ozzie Isaacs 0ceb12f74f Renamed brazilian datepicker file 2021-03-27 12:40:01 +01:00
Ozzie Isaacs 4960624de7 Merge branch 'master' into development 2021-03-27 12:20:28 +01:00
Ozzie Isaacs 2c92f24d89 Added Brazilian translation 2021-03-27 12:20:07 +01:00
Ozzie Isaacs 0b7c679dba Changed test email message (fix #657) 2021-03-27 09:48:43 +01:00
Ozzie Isaacs aab3cdc58a Changed test email message 2021-03-27 09:47:43 +01:00
Ozzie Isaacs 3c63f5b204 Merge branch 'master' into development 2021-03-27 09:46:12 +01:00
Ozzie Isaacs 0b97bbf827 Merge remote-tracking branch 'div_a/use-kobo-for-download-link' into master 2021-03-27 09:39:44 +01:00
Ozzie Isaacs 970dbb0c59 Merge branch 'master' into development
# Conflicts:
#	cps/opds.py
#	cps/templates/admin.html
2021-03-27 09:38:12 +01:00
Ozzie Isaacs d21d3c2ceb Merge remote-tracking branch 'div_a/use-btn-anchors' into master 2021-03-27 09:33:28 +01:00
Ozzie Isaacs 0f6493b8ce Update Teststatus 2021-03-27 09:30:59 +01:00
Ozzie Isaacs f26beec1d3 Updated pdf reader 2021-03-25 18:57:40 +01:00
Ozzie Isaacs c4225e29ed Updated pdf reader 2021-03-25 18:57:25 +01:00
Ozzie Isaacs 9243326cd3 Updated testresult 2021-03-25 18:30:31 +01:00
Ozzie Isaacs 86beb8023a Downgrade sqlachemy, as it breaks oauth 2021-03-24 18:47:59 +01:00
Ozzie Isaacs f4e134742b Fix updater
Bugfixes from testruns
Update Testresults
2021-03-24 18:46:03 +01:00
Ozzie Isaacs 2b17bf4114 Update tests
Fixes upload book
2021-03-23 18:57:04 +01:00
Ozzie Isaacs c4f0fc8f7b Update tests
Fixes upload book
2021-03-23 17:57:49 +01:00
Ozzie Isaacs 3d6c836e7d Update tests 2021-03-23 17:39:51 +01:00
Gavin Mogan c279055af4 Use the kobo auth'd version for download link when proxied -- Fixes #1908 2021-03-22 18:08:41 -07:00
Gavin Mogan 657cba042a Use btn classes on anchors not div so the entire button is clickable 2021-03-22 17:25:38 -07:00
Ozzie Isaacs 7a58e48cae Bugfixes opds feed 2021-03-22 19:01:18 +01:00
Ozzie Isaacs 670eab62bf Update opds feed with letters for all titles, authors, categories and series 2021-03-22 17:46:15 +01:00
Ozzie Isaacs fc85586809 Bugfixes for sqlalchemy 1.4.0 2021-03-22 16:33:21 +01:00
Ozzie Isaacs 837fc4988d Letterize authors 2021-03-21 20:21:10 +01:00
Ozzie Isaacs 4664b47851 Fixed alphabetical order in list and grid view
Completed download section
2021-03-21 19:31:32 +01:00
Ozzie Isaacs 9864d932e0 Changed user.nickname to user.name
Added function to view downloads of all users for admins
2021-03-21 18:55:02 +01:00
Ozzie Isaacs 436f60caa9 refactored some functions 2021-03-21 14:17:07 +01:00
Ozzie Isaacs e9530eda9d Bugfix from refactoring 2021-03-21 13:46:13 +01:00
Ozzie Isaacs f4ddac16f9 Improved error logging for #1905 2021-03-21 11:58:51 +01:00
Ozzie Isaacs 33bdc07f55 Fix for #1845 (ods not working in Moonreader an Librera)
Fix opds search with wrong parameter no longer causes error 500
2021-03-21 11:57:42 +01:00
Ozzie Isaacs 130a4ed2d3 Fix opds and error logging in mail 2021-03-21 11:54:39 +01:00
Ozzie Isaacs 59ebc1af8a Code refactoring 2021-03-21 08:20:04 +01:00
Ozzie Isaacs 10731696df Merge branch 'development' into cover_thumb
# Conflicts:
#	cps/admin.py
2021-03-21 07:29:35 +01:00
Ozzie Isaacs 82e15d2e98 Merge branch 'master' into development
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2021-03-21 07:28:52 +01:00
Ozzie Isaacs 9c842f1895 Bugfixes pdf xmp parsing 2021-03-21 07:28:35 +01:00
Ozzie Isaacs 8cc849488b Code cosmetics 2021-03-21 07:15:38 +01:00
Ozzie Isaacs fcaa232967 Merge remote-tracking branch 'origin/master' into master 2021-03-21 07:11:37 +01:00
Ozzie Isaacs d3f8153b90 Merge branch 'master' into development 2021-03-20 19:34:16 +01:00
Ozzie Isaacs 99ecf22790 Merge remote-tracking branch 'origin/master' into master 2021-03-20 18:10:42 +01:00
Ozzie Isaacs b1b7ee65b4 Refactored advanced search 2021-03-20 18:10:27 +01:00
Ozzie Isaacs 6889456662 Merge remote-tracking branch 'adv_search/master' into master 2021-03-20 17:48:21 +01:00
Ozzie Isaacs 081553dc9f
Disable blank issue templates 2021-03-20 16:27:47 +01:00
Ozzie Isaacs 1e7a2c400b Fixed misstyping 2021-03-20 14:06:15 +01:00
Ozzie Isaacs 30e897af48 Merge remote-tracking branch 'cover/thumbnails' into cover_thumb
# Conflicts:
#	cps/admin.py
#	cps/templates/author.html
#	cps/templates/layout.html
#	cps/ub.py
#	cps/web.py
#	requirements.txt
2021-03-20 12:52:17 +01:00
Ozzie Isaacs dd30ac4fbd Added thumbnails
Merge remote-tracking branch 'cover/thumbnails' into development

# Conflicts:
#	cps/admin.py
#	cps/templates/layout.html
#	cps/ub.py
#	cps/web.py
Update join for sqlalchemy 1.4
2021-03-20 11:32:50 +01:00
Ozzie Isaacs 5d8d796807 Compatibility for sqlalchemy 2.0 2021-03-20 10:09:08 +01:00
Ozzie Isaacs f3d88fc746 Update sqlalchemy 1.4 working 2021-03-20 09:31:29 +01:00
Ozzie Isaacs d87ccae6c9 Merge branch 'master' into development
# Conflicts:
#	cps/server.py
#	test/Calibre-Web TestSummary_Linux.html
2021-03-19 20:33:38 +01:00
Ozzie Isaacs 2760a7816d Fix metadata recognition fb2 files 2021-03-19 20:32:15 +01:00
Ozzie Isaacs 8f5c649d0f Updated dependency comicapi (removed pypdf2)
Updated dependency pyPDF2 ->pyPDF3
Fixed broken updater in case of http error
Bugfixes from testrun
Bugfix load cover for BasicMetadata
2021-03-19 13:35:52 +01:00
Ozzie Isaacs fcf9e7a1ef Upload pdf fixes:
Handle no title
Handle no author
Fix import of more than one language
Add missing pdf upload publisher handling
2021-03-17 19:06:51 +01:00
Ozzie Isaacs 2be7b6480a Merge remote-tracking branch 'pdf/XMP_Metadata3' into master 2021-03-17 19:05:26 +01:00
cbartondock f5ded86c02 removed extraneous logs 2021-03-16 19:18:57 -04:00
rra 8abfaf0ffd Parse XMP metadata in separate function, add exception, try multiple metadata formats 2021-03-16 17:53:33 +01:00
Ozzie Isaacs b070ba142f Selects are working in user management with generic confirm dialog 2021-03-16 15:52:31 +01:00
Ozzie Isaacs bd7c6828bf Selects are working in user management 2021-03-16 15:03:38 +01:00
cbartondock d0671ec58c Merge branch 'master' of https://github.com/janeczku/calibre-web 2021-03-15 21:09:51 -04:00
cbartondock 1e40ffd1cc merge changes 2021-03-15 21:08:41 -04:00
Ozzie Isaacs da2c3e9ed7 Edit user mass change checkbox working 2021-03-15 16:46:27 +01:00
Ozzie Isaacs f62d6abb69 Merge branch 'master' into development
# Conflicts:
#	cps/server.py
#	test/Calibre-Web TestSummary_Linux.html
2021-03-15 13:53:23 +01:00
Ozzie Isaacs 12ad7a6322 Suppress some errors 2021-03-15 13:52:44 +01:00
Ozzie Isaacs b75247ea3a Suppress some errors 2021-03-15 13:48:05 +01:00
Ozzie Isaacs 9a963bbe79 Refactored code
Testrun
2021-03-15 13:10:17 +01:00
Ozzie Isaacs 994bc8b0e4 Removed dropdown button on single file listen/read (Fix #1840) 2021-03-15 09:06:40 +01:00
Ozzie Isaacs 2451605033 Merge remote-tracking branch 'djvu/read-djvu' into master 2021-03-15 08:43:25 +01:00
Ozzie Isaacs 10942527f3 Merge branch 'master' into development
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2021-03-15 08:22:12 +01:00
Ozzie Isaacs 4909ed5ccd Merge remote-tracking branch 'cliblur/master' into development
# Conflicts:
#	cps/static/css/style.css
2021-03-15 08:21:44 +01:00
Ozzie Isaacs 5cf5df68dc Merge remote-tracking branch 'cliblur/master' into master 2021-03-15 08:19:56 +01:00
Ozzie Isaacs dd32cc99ea Merge remote-tracking branch 'es/patch-1' into master 2021-03-15 08:17:14 +01:00
Ozzie Isaacs 79092dc8eb Merge remote-tracking branch 'it/patch-21' into master 2021-03-15 08:11:41 +01:00
Ozzie Isaacs 6229e4610a Updated teststatus and bugfix convert ebooks 2021-03-15 08:10:42 +01:00
Northguy bfe36d3f4a
change in color definition
Making color the same as in:
.container-fluid .book .meta .author, .container-fluid .book .meta .author > a {
    color: hsla(0, 0%, 100%, .45)
}
2021-03-15 00:12:02 +01:00
Northguy d42bf44fad
Added same color for series name and series number 2021-03-14 23:46:33 +01:00
rra 33e352819c Merge remote-tracking branch 'upstream/master' into XMP_Metadata3 2021-03-14 19:58:26 +01:00
Ozzie Isaacs 53ee0aaee1 Some functions refactored 2021-03-14 17:34:47 +01:00
Ozzie Isaacs 42707a19bd Code cosmetics 2021-03-14 16:57:33 +01:00
Ozzie Isaacs 0888706790 Code cosmetics 2021-03-14 16:53:01 +01:00
Ozzie Isaacs 16453a05f8 Code cosmetics 2021-03-14 16:02:37 +01:00
Ozzie Isaacs 2fbb7466d3 Code cosmetics 2021-03-14 15:44:40 +01:00
Ozzie Isaacs f29f94f45f Code cosmetics 2021-03-14 15:41:36 +01:00
Ozzie Isaacs cd973868fc Code cosmetics 2021-03-14 15:29:34 +01:00
Ozzie Isaacs 3c35f02cac Code cosmetics 2021-03-14 15:18:45 +01:00
Ozzie Isaacs 22c93e2389 Merge branch 'master' into development 2021-03-14 15:06:20 +01:00
Ozzie Isaacs 8c751eb532 Some code cosmetics 2021-03-14 15:06:09 +01:00
Ozzie Isaacs 4df443e007 Some code cosmetics 2021-03-14 14:40:04 +01:00
Ozzie Isaacs f52fa41439 Fix restart server
Some code cosmetics
2021-03-14 14:29:40 +01:00
Ozzie Isaacs f77d72fd86 Merge branch 'master' into development
# Conflicts:
#	cps/static/css/style.css
2021-03-14 14:06:33 +01:00
Ozzie Isaacs 9b80c84794 Some code cosmetics 2021-03-14 14:05:36 +01:00
Ozzie Isaacs 725fc658f8 Some code cosmetics 2021-03-14 13:28:52 +01:00
alfred82santa 24bbf226a1 Sync reading state only for books on kobo shelves 2021-03-14 11:29:23 +01:00
Ozzie Isaacs e4e27662f5 Merge remote-tracking branch 'url/patch-1' into master 2021-03-14 08:35:37 +01:00
cbartondock 83474da7b5 fixed being able to click through dropdown in advanced search results 2021-03-07 22:54:34 -05:00
cbartondock 9146e5f287 fixed advanced search mass add to shelves in caliblur 2021-03-07 19:53:54 -05:00
cbartondock ff4502c63a Made shelf search user specific 2021-03-07 15:23:05 -05:00
cbartondock 9711bd8fe1 added actions boxes to drop downs 2021-03-06 22:34:39 -05:00
cbartondock 05139e53be advanced shelf search is working 2021-03-06 22:15:18 -05:00
cbartondock 870b2642a9 advanced shelf search is almost working 2021-03-06 21:54:39 -05:00
ElQuimm d31b26ae7d
Updated italian message.po
Have a nice day.
2021-03-04 14:26:36 +01:00
Zaroz 5511925ba2
Removed elif "url" identifier format type
Removed elif "url" identifier format type, since else output is identical
2021-03-03 21:18:08 -06:00
Angel Docampo f96b20717d
Updated spanish messages.po
Corrected a grammatical error
2021-03-04 00:01:03 +01:00
Zaroz 940c9c45d7
Updated db.py
changed __repr__ else statement to allow for custom id entries
2021-03-02 23:46:02 -06:00
Ozzie Isaacs 87d6008dfc Fix for #1870 (png was missing in supported picture formats for comic viewer) 2021-02-27 09:23:34 +01:00
Ozzie Isaacs b9c0c8d2dc Update bootstrap table to 1.18.2 2021-02-20 20:03:39 +01:00
Ozzie Isaacs 81c30d5fd5 Add missing files from bootstrap editable
Added user-table single-select header for locale and default-language
2021-02-20 19:55:51 +01:00
Ozzie Isaacs 0aa33d88a5 Merge branch 'master' into development 2021-02-20 14:19:39 +01:00
Ozzie Isaacs e64a504bb1 Working Locale and default language selection in user table edit 2021-02-20 14:18:27 +01:00
jvoisin bc876a159e Declare variables before using them
It should fix the following stacktrace:

```
[2021-02-18 14:46:14,771] ERROR {cps:1891} Exception on / [GET]
Traceback (most recent call last):
  File "/opt/calibre/vendor/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/calibre/vendor/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/calibre/vendor/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/calibre/vendor/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/calibre/vendor/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/calibre/vendor/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/calibre/cps/usermanagement.py", line 38, in decorated_view
    return login_required(func)(*args, **kwargs)
  File "/opt/calibre/vendor/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/opt/calibre/cps/web.py", line 719, in index
    return render_books_list("newest", sort_param, 1, page)
  File "/opt/calibre/cps/web.py", line 422, in render_books_list
    entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, True, order)
  File "/opt/calibre/cps/db.py", line 610, in fill_indexpage
    return self.fill_indexpage_with_archived_books(page, pagesize, database, db_filter, order, False, *join)
  File "/opt/calibre/cps/db.py", line 635, in fill_indexpage_with_archived_books
    #    book = self.order_authors(book)
UnboundLocalError: local variable 'entries' referenced before assignment
```
2021-02-18 17:02:58 +01:00
Ozzieisaacs 4aa1a838ed Removed f-strings, making it compatible with python 3.5 2021-02-15 14:17:05 +01:00
Ozzieisaacs 095a51edd0 Convert tabs to spaces in server.py (related to #1862) 2021-02-15 13:33:42 +01:00
Ozzie Isaacs a3a11bdf3f Changed checkbox states are saved on server 2021-02-14 17:49:40 +01:00
Ozzie Isaacs 70b503f3d4 Merge branch 'master' into development
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2021-02-13 14:36:42 +01:00
Ozzie Isaacs bbf609b880 Fix #1859 (Upload of jpg files without installed imagemagick doesn't work) 2021-02-13 14:34:41 +01:00
Ozzie Isaacs 0992bafe30 Bulk User management 2021-02-13 13:17:02 +01:00
Ozzie Isaacs c810c5275a Merge branch 'master' into development 2021-02-09 18:05:32 +01:00
Ozzie Isaacs 3c1b06872d Updated testresults
Changed optional-requirements
Prevent redirect 308 on /<data> routes (#1854)
2021-02-09 18:04:56 +01:00
Ozzie Isaacs cefdd2f66c suppress asyncio message always on restart or shutdown 2021-02-08 20:39:21 +01:00
Ozzie Isaacs 5dac13b1da Revert change in ub.py 2021-02-08 20:17:02 +01:00
alfred82santa 6014b04b2a Use BookShelf added_date as date reference 2021-02-08 20:10:12 +01:00
Ozzie Isaacs 8aebf48193 Update handling for package data 2021-02-08 20:09:36 +01:00
Ozzie Isaacs fbb905957b Prevent redirect 308 on /<data> routes 2021-02-08 20:09:36 +01:00
Ozzie Isaacs e0ce135838 Move "create_engine" call 2021-02-08 20:09:36 +01:00
Ozzie Isaacs 60497c60c1 Update creating Home_Config variable for packaging support, added .HOMEDIR to ignored filename during update 2021-02-07 09:20:37 +01:00
Ozzie Isaacs 251a77c8b4 Merge branch 'master' into Development
Improved packaging support
2021-02-07 08:54:29 +01:00
alfred82santa 2b7c1345ee Fix disable shelf kobo sync 2021-02-07 00:21:51 +01:00
alfred82santa 69b7d94774 Fixes and remove shelf kobo sync flag when kobo sync disabled 2021-02-07 00:19:24 +01:00
Ozzie Isaacs 7b7494b8a4 Added executable folder to gitignore 2021-02-06 21:42:29 +01:00
alfred82santa 8fe762709b Fix mistake 2021-02-06 21:15:36 +01:00
alfred82santa a3f17deb17 Added options in order to synchronize only selected shelf on Kobo device 2021-02-06 20:29:43 +01:00
Ozzie Isaacs 9390dcdd43 Update optional requirements 2021-02-06 11:33:20 +01:00
Ozzie Isaacs e6fb460071 New restart routine for executable files
Fix log in updater
New source option updater available
2021-02-06 09:42:27 +01:00
Ozzie Isaacs 6137fdeb33 Version bump 2021-02-02 19:11:02 +01:00
Ozzie Isaacs 4a4d02ea6a Added translations 2021-02-02 19:04:55 +01:00
Ozzie Isaacs be26e5f152 Update Teststatus
Update Version
2021-02-02 18:52:31 +01:00
Ozzie Isaacs 127bfba135 fix wrong path in get_update_status js function 2021-02-01 19:00:10 +01:00
Ozzie Isaacs 7efae3c125 Renamed "Recently Added" to "Books" 2021-01-31 19:20:43 +01:00
Ozzie Isaacs 1e5af21000 Fix #1843 (get path to script via html file and known js file instead of randomly picking last one) 2021-01-31 19:01:34 +01:00
Ozzie Isaacs 33a0a4c173 Changed function for getting path in js file 2021-01-31 18:55:32 +01:00
Ozzie Isaacs eeb7974e05 User table:
Added button for single user edit
Added delete-trash-icon (not working)
Roles are displayed correct per user
Guest user is not visible if anonymous browsing is disabled
2021-01-31 14:54:45 +01:00
Ozzie Isaacs f45ea1a31c Merge branch 'master' into development 2021-01-31 13:21:47 +01:00
Ozzie Isaacs a866dbaa80 Fix mimetype in comic reader 2021-01-31 11:21:09 +01:00
Ozzie Isaacs 62447d6b89 Basic User edit in tables 2021-01-31 10:17:57 +01:00
Ozzie Isaacs 93f0724b83 Merge branch 'development' into master 2021-01-31 09:11:35 +01:00
Ozzie Isaacs 724762843d Update Teststatus 2021-01-31 09:10:42 +01:00
Ozzie Isaacs ff16afbf0b Merge branch 'master' into development 2021-01-30 17:55:45 +01:00
Ozzie Isaacs 9d7ef25062 Fix Kobo sync & Update Teststatus 2021-01-30 17:55:17 +01:00
Ozzie Isaacs 88078d65e9 Fix #1482 (do not shorten title in book detail page) 2021-01-30 14:57:59 +01:00
Ozzie Isaacs b07a97c17e Merge remote-tracking branch 'webp/comic-webp' into master 2021-01-30 14:56:26 +01:00
Ozzie Isaacs 41e7d65e2a Merge remote-tracking branch 'caliblur/master' into master 2021-01-30 14:54:16 +01:00
Ozzie Isaacs 7fa5865cf6 Merge remote-tracking branch 'autoconv/kepub_autoconv' into development
# Conflicts:
#	cps/kobo.py
#	cps/kobo_auth.py
2021-01-30 14:47:18 +01:00
Ozzie Isaacs e0b8fe3b1a Merge branch 'master' into development 2021-01-30 14:41:46 +01:00
Ozzie Isaacs 4a11dd1e16 Fix mistyping "option" 2021-01-28 20:20:59 +01:00
Ozzie Isaacs 34a474101f Fix #1838 (Log message on failed OPDS login) 2021-01-28 20:05:58 +01:00
Ozzie Isaacs e6799e7a04 Improved detection of invalid email addresses (#1831) upon registering 2021-01-27 19:18:40 +01:00
Ozzie Isaacs 0f83f9992c Added swipe support for epub reader (fixes #925)
Cleaned reader js include files
2021-01-24 14:19:46 +01:00
Ozzie Isaacs d2ad78eb40 Added swipe support for comic reader and txt reader (#925)
Bugfix for txt file not present on serving file
2021-01-24 11:28:17 +01:00
Ozzie Isaacs 0b32738f4e Fix Store UI settings in flask session for guest user (#1820)
Updated testresults
Fix Filepicker (absolute instead of abs)
2021-01-24 07:31:40 +01:00
Ozzie Isaacs a9cedb3fca Add logger to db.py 2021-01-23 13:35:30 +01:00
Ozzie Isaacs 51f9cd4bb4 Fix english language names 2021-01-18 21:24:13 +01:00
Ozzie Isaacs a1668e2411 Version Bump 2021-01-17 16:37:54 +01:00
Ozzie Isaacs 9418045a2c Updated Translation
Version bump
Fixed errors in requirements file(s)
2021-01-17 16:28:28 +01:00
Ozzie Isaacs a7da6d210a Added hint for python 2 2021-01-17 10:30:56 +01:00
chbmb 59a41dc844 Correct name for LinuxServer
Nothing important, but it's LinuxServer not Linuxuser.
2021-01-17 09:54:16 +01:00
Ozzie Isaacs e09f2c9beb Added Password change on cli 2021-01-17 09:17:46 +01:00
Ozzie Isaacs 4bc3c8d9ac Added missing mimetype (fix #1811) 2021-01-17 07:54:28 +01:00
Ozzie Isaacs 9acea8adf4 Fixed logging of exception in debug_or_exception handler for python version <3.8 2021-01-12 20:51:49 +01:00
Ozzie Isaacs e5f754ed0e improved session handling 2021-01-11 14:18:01 +01:00
Ozzie Isaacs 263a8f9048 Added catching of missing invalid_request 2021-01-10 14:57:54 +01:00
Ozzie Isaacs 6f9e52792a No autoflush on metadata.db change 2021-01-10 11:01:54 +01:00
Ozzie Isaacs 4a9b01e93b Added IntegrityError to catched error 2021-01-10 10:23:14 +01:00
Ozzie Isaacs b7de23e895 Merge remote-tracking branch 'fix/unused_imports' into master 2021-01-10 10:18:01 +01:00
Ozzie Isaacs f358f78da8 Merge remove duplicate ids 2021-01-10 10:16:58 +01:00
jvoisin b8ab66369e Remove some unused imports 2021-01-07 17:59:08 +01:00
jvoisin 54a78d5565 Remove duplicate id from the search form 2021-01-07 17:40:18 +01:00
mmonkey 2c8d055ca4 support python2.7 for the mean time 2021-01-04 12:36:40 -06:00
mmonkey 8cc06683df only python3 supported now 2021-01-04 12:28:05 -06:00
mmonkey 774799f316 resolved merge conflicts 2021-01-04 12:26:46 -06:00
mmonkey b4324cd685 Merge remote-tracking branch 'upstream/master' into master 2021-01-04 12:24:11 -06:00
Ozzieisaacs ca212c8737 Kobo sync limit set to 100
Remove python2 support from readme
2021-01-04 18:45:47 +01:00
Ozzieisaacs 6fe4ed3e24 Merge branch 'master' into Develop 2021-01-03 19:28:12 +01:00
Ozzieisaacs a659f2e49d Improved logging for emails
Removed private data from debug export
2021-01-03 19:27:34 +01:00
OzzieIsaacs 760fbbb357 Fix shelf time_created vs. time_last_modified 2021-01-03 16:41:38 +01:00
OzzieIsaacs 56388145b5 Fixes from testrun 2021-01-03 15:40:17 +01:00
Ozzieisaacs cd60db417c Code refactor shelf handling 2021-01-03 11:53:06 +01:00
Ozzieisaacs 5cce01215f Code refactoring ub.session.commit()
Code cosmentics admin.py
2021-01-03 09:53:34 +01:00
mmonkey d53daaa387 Merge branch 'Develop' into thumbnails 2021-01-02 20:21:47 -06:00
mmonkey bc8bdfe385 Merge remote-tracking branch 'upstream/master' into master 2021-01-02 20:21:15 -06:00
Ozzieisaacs 4578af7a6d Fix export of logfiles (#1794) 2021-01-02 20:38:11 +01:00
Ozzieisaacs 9e1cdd8f57 Merge remote-tracking branch 'it/patch-20' into master
# Conflicts:
#	cps/translations/it/LC_MESSAGES/messages.po
2021-01-02 19:37:59 +01:00
OzzieIsaacs 682c3b834f Revert unrar5 experiment 2021-01-02 15:32:06 +01:00
OzzieIsaacs e269bab186 Merge branch 'Develop' into master 2021-01-02 14:54:43 +01:00
OzzieIsaacs 33a89c5d89 Updated test status on Linux 2021-01-02 14:54:10 +01:00
Ozzie Isaacs 139047b22b Updated test status on windows 2021-01-02 14:16:33 +01:00
OzzieIsaacs 9b50114852 Fixes from testrun 2021-01-02 07:51:55 +01:00
Ozzieisaacs b100d198e8 Merge branch 'master' into Develop
Remove relate to referrer for tag/custom column allow / deny dialog
2020-12-31 15:12:37 +01:00
Ozzieisaacs 7849f2fb4b Remove relate to referrer for tag/custom column allow / deny dialog 2020-12-31 15:08:56 +01:00
Ozzieisaacs b35ecddde3 Added Id on Filechooser dialog for testability 2020-12-31 09:54:40 +01:00
Ozzieisaacs bde7921016 Fix modal path id for calibre db filepicker
Fix SyncToken last-Book-id missing
2020-12-30 10:05:15 +01:00
mmonkey 35c60eaee5 Merged develop, fixed merged conflicts 2020-12-28 23:41:49 -06:00
Ethan Lin ee28e3346b
Merge pull request #21 from janeczku/master
merge from janeczku/master
2020-12-29 10:31:41 +08:00
Ozzieisaacs d33b0587cb Advanced search tags are now multiselects (#1240) 2020-12-28 13:44:17 +01:00
Ozzieisaacs 7e0ed537b7 irst steps Advanced search with mulitselects 2020-12-27 19:12:27 +01:00
Ozzieisaacs 1e351eb01d Search for read status 2020-12-27 18:59:33 +01:00
Ozzieisaacs 1a83bddf8c Merge bubble read status 2020-12-27 13:53:21 +01:00
Ozzieisaacs 2a63c35743 Activate serverside filepicker with parameter in unconfigured state 2020-12-27 11:27:15 +01:00
Ozzieisaacs 27dcbcd7e1 paged and orderable shelfs
Fix for non writable settings db with non configured calibre-web
2020-12-27 10:24:51 +01:00
mmonkey af24d4edbe resolved merge conflicts 2020-12-24 03:04:32 -06:00
mmonkey 0cf4c7b7b7 Merge remote-tracking branch 'upstream/master' into master 2020-12-24 03:01:55 -06:00
mmonkey eef21759cd Fix generate thumbnail task messages, don't load thumbnails when the cache file has been deleted 2020-12-24 03:00:26 -06:00
mmonkey 242a2767a1 Added thumbnail urls to book cover srcsets with cache busting ids 2020-12-24 02:35:32 -06:00
ElQuimm 623372387d
Update italian message.po
Merry Christmas and Happy Holidays :-)
2020-12-23 13:45:19 +01:00
mmonkey 626051e489 Added clear cache button to admin settings, updated cache busting for book cover images 2020-12-23 03:25:25 -06:00
OzzieIsaacs abf0f4d699 Updated Testresult
Fixed delete book call
2020-12-23 10:08:54 +01:00
Ozzieisaacs 2bea447de5 Fix show archived books 2020-12-23 09:07:49 +01:00
mmonkey 541fc7e14e fixed thumbnail generate tasks, added thumbnail cleanup task, added reconnect db scheduled job 2020-12-22 17:49:21 -06:00
Ozzieisaacs f6538b6110 New delete user button
refactored confirm dialogs
2020-12-21 19:50:12 +01:00
Ozzieisaacs 2d3ae71a3d Fixed button for email config (Fix #1766) 2020-12-21 19:13:55 +01:00
mmonkey e48bdf9d5a Display thumbnails on the frontend, generate thumbnails from google drive 2020-12-20 03:11:21 -06:00
mmonkey 21fce9a5b5 Added background scheduler and scheduled thumbnail generation job 2020-12-19 02:58:40 -06:00
mmonkey 774b9ae12d Added thumbnail task and database table 2020-12-19 00:49:36 -06:00
Ozzieisaacs 9a20faf640 Revert accidentally deleted lines in caliblur! theme 2020-12-17 19:10:02 +01:00
andylizi 123493ee59
Fix #1255 (support webp in comic viewer) 2020-12-17 23:54:06 +08:00
mmonkey 2d498dd138 Preserve publisher links, and fix formatting in custom columns for CaliBlur theme. 2020-12-16 00:58:45 -06:00
Ozzieisaacs 376214e2d2 Pinned greenlet to 0.4.16 max 2020-12-13 18:33:20 +01:00
Ozzieisaacs 62da469fd1 Shelfs are now paginated (sorting buttons are disabled)
Changed gevent dependencys
2020-12-13 18:32:44 +01:00
Ozzieisaacs d64009e23e preparation for filtered and ordered shelfs 2020-12-13 13:54:09 +01:00
Ozzieisaacs fd8b642d64 Code cosmetics css
Code cosmetics js
Fixes for links with remote_login
2020-12-13 09:53:18 +01:00
OzzieIsaacs d5ed5cd665 Fixes from tests 2020-12-12 15:16:22 +01:00
OzzieIsaacs fa95d064ff Fix get_sidebar_config 2020-12-12 12:03:11 +01:00
Ozzieisaacs 1905e0ee6f refactoring to prevent web.py being the middle of the universe 2020-12-12 11:23:17 +01:00
Ozzieisaacs 96b18faea1 Merge remote-tracking branch 'nl/master' into master 2020-12-12 10:06:16 +01:00
Ozzieisaacs 0d7f2e157a Update Download Debug package
- include config
- bugfix for stream logger
2020-12-12 10:02:11 +01:00
Marcel 2d66936d8b NL translation update
NL translation update
2020-12-12 09:24:01 +01:00
Ozzieisaacs b637a63e71 Refactored exception logging 2020-12-12 08:11:00 +01:00
Ozzieisaacs 1ae778d81e Fix #1753 (errorhandling on route serve_book) 2020-12-12 06:49:44 +01:00
Ozzieisaacs f4412ee96b Fix #1753 (errorhandling on route serve_book) 2020-12-12 06:41:12 +01:00
Ozzieisaacs 9130aceb5a Changed admin page 2020-12-11 20:55:09 +01:00
Ozzieisaacs b8336c03c3 Changed admin page 2020-12-11 20:54:24 +01:00
Ozzieisaacs 76c3ade394 Changed logging in worker thread 2020-12-11 17:03:18 +01:00
Ozzieisaacs d9b22fd513 log exceptions only in debug mode 2020-12-11 16:46:02 +01:00
Ozzieisaacs 88ea998f8b Only register gdrive callback if gdrive is enabled
With enabled gdrive return on change if no watch callback is configured, instead of send request to google drive
2020-12-11 15:56:42 +01:00
Ozzieisaacs 8b605aeaa8 Only register gdrive callback if gdrive is enabled 2020-12-11 15:53:10 +01:00
Ozzie Isaacs db91577485 Use calibre-web folder in tempdir on upload cover and metadata backup
fix upload cover on windows (slash vs. backslash)
2020-12-11 13:34:29 +01:00
Ozzie Isaacs 5d9404863d Fix detection and removal of metadata.db ending in calibre-directory
Update requirements
2020-12-11 09:11:17 +01:00
Ozzieisaacs d3986ca14a Server side file browser 2020-12-11 08:37:37 +01:00
Ozzieisaacs 2508c1abb2 Started implement server side filechooser 2020-12-10 14:41:45 +01:00
OzzieIsaacs 983e3b2274 Bugfix allowed formats for comics
Bugfix editing archived books
2020-12-09 19:02:10 +01:00
Ozzieisaacs 72a02e087c Update optional pydrive requirement
Bugfix cover url download for Wand insted of Pillow
Fix for gdrive with unknown certificates
2020-12-09 15:14:08 +01:00
Ozzieisaacs 352b4a0b73 Remove Pillow as dependency 2020-12-09 14:18:39 +01:00
Ozzieisaacs d957b2d20f Fix detect correct encoding for txt-reader 2020-12-09 11:04:29 +01:00
Ozzieisaacs dcab8af8ab Fixes for kobo sync 2020-12-09 09:41:23 +01:00
OzzieIsaacs e1987c34d9 Revert expire on commit 2020-12-09 08:49:18 +01:00
OzzieIsaacs a80a8aab1c Fix LDAP import user 2020-12-08 20:13:36 +01:00
OzzieIsaacs d6fbcdb09d Fix merge problem (ub prefix in ub.py) 2020-12-08 13:56:17 +01:00
OzzieIsaacs d39b28b011 Fix for existing book format with gdrive 2020-12-08 13:34:15 +01:00
OzzieIsaacs 8f36128fe3 Merge branch 'session' into Develop 2020-12-08 11:49:39 +01:00
OzzieIsaacs 986d4c99bd Fix oauth ub session 2020-12-08 11:24:20 +01:00
Ozzieisaacs f677dcb1f4 Fix missing optional parameter initSession 2020-12-08 08:19:18 +01:00
Ozzieisaacs 1a9b220ec2 Session no longer expires on commit (only in worker thread) 2020-12-08 08:04:46 +01:00
Ozzieisaacs d15d252af7 Session no longer expires on commit 2020-12-08 08:01:42 +01:00
Ozzieisaacs 5e3618716d Fix missing session rollback on commit error 2020-12-07 19:53:34 +01:00
Ozzieisaacs f13522559d Fixed problems on startup with config session 2020-12-07 13:51:52 +01:00
Ozzieisaacs 777c2726d3 Changed session_handing 2020-12-07 08:52:52 +01:00
Ozzieisaacs c25afdc203 Chunked sync 2020-12-06 13:21:25 +01:00
Ozzieisaacs c25f6d7c38 Prefer kepub in kobo sync 2020-12-06 06:01:10 +01:00
Ozzieisaacs 388e46ee81 Merge remote-tracking branch 'prefer_kepub/prefer-kepub' into master (send kepub instead of epub) 2020-12-06 05:57:56 +01:00
Ozzieisaacs 242866948f Merge branch 'master' into Develop 2020-12-05 08:34:12 +01:00
Ozzieisaacs 15bb0ce990 Fix for #1439 (send kepub file instead of epub for kobo epub3 request)
Fix archived books are editable
2020-12-04 19:23:36 +01:00
Ozzieisaacs a82911ea5d Fixed missing variable exception 2020-12-04 14:50:34 +01:00
Ozzieisaacs 9a8f20317b Update ldap import user -> improve error messages 2020-12-04 11:13:39 +01:00
Ozzieisaacs b605a0f622 Update error message LDAP import user 2020-12-03 21:25:02 +01:00
Ozzieisaacs 046a074c3a Catch attribute error on ldap import user
Fixes for Login with Windows AD
2020-12-03 20:15:31 +01:00
Ozzieisaacs 7c96fac95c Removed unnecessary parameters 2020-12-03 17:33:30 +01:00
Ozzieisaacs a3ef53102d Fix warning message on ldap import 2020-12-03 17:08:51 +01:00
Ozzieisaacs 68513b775b Wording 2020-12-03 16:20:31 +01:00
Ozzieisaacs a79dcc93f6 Fixed description for LDAP filter 2020-12-03 16:19:42 +01:00
Ozzieisaacs 7aabfc573b Merge branch 'master' into Develop
# Conflicts:
#	cps/admin.py
#	cps/config_sql.py
#	cps/templates/config_edit.html
#	cps/web.py
2020-12-03 16:03:37 +01:00
Ozzieisaacs 22dde5d18e Merge remote-tracking branch 'ldap_import/feat/ldap-import-user-identifier' into Develop
# Conflicts:
#	cps/admin.py
2020-12-03 16:02:38 +01:00
Ozzieisaacs 56505457eb Merge remote-tracking branch 'ldap_import/feat/ldap-import-user-identifier' into master
# Conflicts:
#	cps/admin.py
2020-12-03 16:01:15 +01:00
Ozzieisaacs 5930c6d5fb remove parenthesis in LDAP Message 2020-12-03 14:22:37 +01:00
Ozzie Isaacs 6b162a4e49 Updated windows testresult 2020-12-03 11:36:40 +01:00
Ozzieisaacs c3b9888b31 Fix #1739 (opds download with anonymous browsing enabled) -> download rights of guest user are now respected again 2020-12-03 09:42:41 +01:00
Ozzieisaacs cb8dfdde4c Fix #1739 (opds download with anonymous browsing enabled) 2020-12-03 08:25:36 +01:00
OzzieIsaacs ff5d333fc8 Updated testresult 2020-12-02 18:23:28 +01:00
Ozzieisaacs 8eb4b6288a Added id's for testablility 2020-12-02 18:19:30 +01:00
Ozzieisaacs f18836be90 Fix for #1435 (download not allowed with for opds links, with ldap login and a cookie in the download request) 2020-12-02 14:19:49 +01:00
Ozzieisaacs 3372070a58 Fix change title regex
Merge branch 'Develop' into master
2020-12-02 11:09:55 +01:00
Ozzieisaacs f99e2ebd13 Changed wording for tooltips 2020-12-02 09:08:56 +01:00
Ozzieisaacs 4feb26eefb Added series order option (#1715)
Added authors order option (#1301)
Added tooltips for ordering options
Fixed ratings, formats, languages order option
2020-12-01 14:51:25 +01:00
Ozzieisaacs 2da7cd2064 Merge remote-tracking branch 'it/patch-18' into master 2020-12-01 14:11:25 +01:00
Ozzieisaacs 9d7daf7afd Kobo links to /v1/products/books/external are responded
Merge remote-tracking branch 'kobo/patch-1' into master
2020-12-01 14:03:03 +01:00
Ozzieisaacs cb1ebc1cd0 Drag 'n drop for files 2020-12-01 13:52:41 +01:00
Ozzieisaacs 6ad56a0859 Merge branch 'master' into Develop 2020-11-30 18:37:14 +01:00
Ozzieisaacs 8515781564 Fix #1727 (import rarfile 4.0 fails on python3.5) 2020-11-30 18:36:45 +01:00
ElQuimm 7e2bfbd255
update italian message.po
some minors changes.
2020-11-26 14:35:15 +01:00
Jennifer Thakar e2325f7ba4
Forward Overdrive requests to Kobo Store
When loading books from OverDrive, Kobo readers make requests to `/v1/products/books/external/<overdrive ids>`.
This adds a route to forward these requests to the Kobo Store, so that OverDrive still works when using Calibre-Web's Kobo sync server.
2020-11-22 15:06:37 -08:00
OzzieIsaacs 9afdab8c52 Fix from merge convert_from _to 2020-11-22 11:57:10 +01:00
Ozzieisaacs f620d4a9ca Fix LDAP errors 2020-11-22 11:19:14 +01:00
Ozzieisaacs fb1e763bbe Fix browser caching problem on change cover 2020-11-22 10:07:25 +01:00
Ozzieisaacs ecea7e7493 Revert "Fix browser caching problem on change cover"
This reverts commit b9536812f4.
2020-11-22 10:06:54 +01:00
Ozzieisaacs 560ade00b4 Fix browser caching problem on change cover 2020-11-22 10:03:10 +01:00
Ozzieisaacs 81ea24ad54 Merge branch 'master' into df 2020-11-22 09:34:11 +01:00
Ozzieisaacs 747b25046a Merge branch 'master' into Develop 2020-11-22 09:16:27 +01:00
Ozzieisaacs b9536812f4 Fix browser caching problem on change cover 2020-11-22 09:09:41 +01:00
Ozzieisaacs eed2f0a430 Merge remote-tracking branch 'comic/master' into master 2020-11-22 08:45:02 +01:00
Ozzieisaacs 31fe8cd263 Improvement for #1721 (shrinked generic cover) 2020-11-22 08:28:52 +01:00
Ozzieisaacs a3fadbaa1a Shrinked size of generic cover 2020-11-22 08:28:10 +01:00
Ozzieisaacs e2be655d74 Update LDAP, fix Windows AD login (#1697) 2020-11-22 08:17:00 +01:00
Ozzieisaacs 2cd653c773 Merge remote-tracking branch 'origin/Develop' into Develop 2020-11-22 08:08:57 +01:00
Ozzieisaacs 6538aff02f Merge branch 'master' into Develop 2020-11-22 08:08:27 +01:00
OzzieIsaacs c1e3dec9be Limit max requests version to 2.25 (testing problem) 2020-11-21 17:21:18 +01:00
Ozzieisaacs 42c13ae135 Fix for #1718 (fetch of metadata from google without cover leads to exception) 2020-11-20 20:35:07 +01:00
Ozzieisaacs 9bd51c650b Add config options for client certificate authentication 2020-11-20 19:47:50 +01:00
Ozzieisaacs ba1c1c87c4 Merge remote-tracking branch 'kobo/feature/use-kobo-specific-download-urls' into Develop 2020-11-20 19:47:25 +01:00
Ozzieisaacs ceefba2743 Fix for #1550 (password prompt for LDAP and anonymous browsing) 2020-11-15 17:16:01 +01:00
Ozzieisaacs 70da46b05e Merge branch 'master' into Develop 2020-11-15 16:15:02 +01:00
Ozzieisaacs 32b7b39223 Added function to download debug information 2020-11-15 14:25:27 +01:00
verglor 2343c79126 Use djvu_html5 to read djvu format in browser 2020-11-15 13:19:37 +01:00
verglor 09a5a69f86 djvu_html5 0.3.0-beta1 static assets 2020-11-15 13:09:32 +01:00
Ozzieisaacs 4081895a78 exclude _pysqlite.so from being overwritten 2020-11-14 15:53:56 +01:00
Ozzieisaacs a522566a0c Merge remote-tracking branch 'kepubify/patch-1' into master 2020-11-14 13:24:58 +01:00
Ozzieisaacs 013c4e9c35 Merge remote-tracking branch 'epub/recompute_epub' into master 2020-11-14 13:22:42 +01:00
Ozzieisaacs 067f289050 Merge remote-tracking branch 'comic/comic' into master 2020-11-14 13:21:56 +01:00
Ozzieisaacs 06511b92aa Merge remote-tracking branch 'epub/GruberMarkus-patch-1' into master 2020-11-14 13:20:26 +01:00
Ozzieisaacs 32f4c9eabf Merge remote-tracking branch 'fr/master' into master 2020-11-14 13:16:08 +01:00
Ozzieisaacs 14bc345883 Merge remote-tracking branch 'audio/fix-audio-icon' into master 2020-11-14 13:14:21 +01:00
Ozzieisaacs d76b4fd7ea Merge remote-tracking branch 'it/patch-17' into master 2020-11-14 13:12:36 +01:00
ElQuimm 83cdd7e9fb
update italian message.po
some minor update to the translation.
2020-11-13 11:17:46 +01:00
verglor 50441bae62 Fix missing audio icon for other audio formats than mp3 2020-11-10 18:08:22 +01:00
Martin 5b0766a9b0
Correct spelling 2020-11-10 10:06:37 +01:00
Martin d979fe8e5f
fix fr translation : sed cryptage/chiffrement 2020-11-10 10:04:47 +01:00
Markus Gruber f2c52fd278
Update jszip to 3.5.0. Update epub.js to 0.3.88.
Fixes several problems when viewing EPUBs in a browser, for example when jumping to a certain chapter in the table of contents does not work.
2020-11-09 15:47:27 +01:00
Ozzieisaacs 87d60308f2 Merge remote-tracking branch 'caliblur/issue/caliblur-981' into master 2020-11-08 19:29:10 +01:00
L0garithmic 64ebc56c87
Kepubify
the current link sends you to a specific version. The link I suggest, sends you to the "latest" version.
2020-11-08 09:31:53 -06:00
Ozzieisaacs 58d485cbb5 Fix #1702 (invalid timestamps during kobo sync caused by malformed database) 2020-11-07 12:49:39 +01:00
Ozzieisaacs e99dd3310c Exchanged douban apikey 2020-11-07 12:18:33 +01:00
Ozzieisaacs 400f6e02a5 Fix #1668 (upload of books with language set to different than UI language and not showing all books)
Fix for only showing external port if kobo is really activated in admin menu
2020-11-07 11:44:02 +01:00
jvoisin 700b0609df Don't recompute metadata for epubs 2020-11-06 21:36:49 +01:00
cbartondock bc52f90ed4 Merge remote-tracking branch 'upstream/master' 2020-11-02 11:36:45 -05:00
Ozzieisaacs 0771546dad Log exception on user import 2020-11-01 18:25:38 +01:00
jvoisin 95a1a71a66 Minor refactor of comic.py 2020-10-31 22:28:24 +01:00
OzzieIsaacs b9b8e3f632 Update testresults 2020-10-31 20:12:22 +01:00
Ozzieisaacs 1e03a2ae40 Merge branch 'master' into Develop 2020-10-31 20:07:41 +01:00
Ozzieisaacs 25da6aeeca Merge remote-tracking branch 'sec_fixes/space' into master 2020-10-31 20:04:42 +01:00
Ozzieisaacs 00b422807b Merge remote-tracking branch 'sec_fixes/edit_auth' into master 2020-10-31 20:04:12 +01:00
Ozzieisaacs 130701a7bb Merge remote-tracking branch 'sec_fixes/admin_update' into master 2020-10-31 20:02:42 +01:00
Ozzieisaacs ff88e68904 Add missing locale files 2020-10-31 19:58:22 +01:00
Ozzieisaacs 55fcf23d2b Merge remote-tracking branch 'sec_fixes/negate' into master 2020-10-31 19:37:47 +01:00
Ozzieisaacs 1b0b4c4cc5 Merge remote-tracking branch 'sec_fixes/ldap' into master 2020-10-31 19:29:17 +01:00
Ozzieisaacs cd57731593 Merge remote-tracking branch 'sec_fixes/unused_imports' into master 2020-10-31 19:24:46 +01:00
Ozzieisaacs 37a80b935d Added greek translation 2020-10-31 19:20:00 +01:00
Ozzieisaacs 4d61aec153 Merge remote-tracking branch 'zh/trans' into master 2020-10-31 19:07:10 +01:00
Ozzieisaacs 1adf25d50b Update Italian translation 2020-10-31 19:06:09 +01:00
Julian Naydichev ae33aee3f6 When serving a download URL via KoboSync, use a URL that is specific to Kobo 2020-10-31 14:50:08 +01:00
jvoisin 2c99e71626 Remove a superfluous space 2020-10-29 18:17:32 +01:00
jvoisin e7f7775efa Require edit permissions to edit books, even via ajax 2020-10-29 14:52:20 +01:00
jvoisin 8b60a19577 Don't leak to non-admin users the current installed version 2020-10-29 14:03:18 +01:00
Ozzieisaacs 5701e08db9 Fix for #1668 2020-10-28 20:37:52 +01:00
Ozzie Isaacs 72a2fc49f8 Update Windows testresults 2020-10-28 20:23:19 +01:00
jvoisin d2617322c6 Negate a condition
- removes two levels of indentation
- makes it clear that if the wrong tokens are provided nothing will happen
- remove a useless nested function
2020-10-27 19:41:05 +01:00
jvoisin fa82745f64 Put import_ldap_users behind a login 2020-10-27 19:26:04 +01:00
jvoisin 19b2a334e4 Remove unused imports 2020-10-27 11:06:43 +01:00
vagra 627c2adf08 SImple Chinese translation updated. 2020-10-26 22:56:58 +08:00
ElQuimm e3e137ca50
updated italian message.po 2020-10-22 16:31:25 +02:00
cbartondock 0978be580f Merge remote-tracking branch 'upstream/master' 2020-10-21 13:01:25 -04:00
Ozzieisaacs 5792838333 Add OSError to catched Gevent Error 2020-10-20 17:38:37 +02:00
Ozzieisaacs f9995583a5 Merge remote-tracking branch 'translate/patch-1' into master 2020-10-20 17:12:25 +02:00
KN4CK3R 4cc68bd139
Fixed typo. 2020-10-20 13:45:01 +02:00
cbartondock d2510ad1bc Merge remote-tracking branch 'upstream/master' 2020-10-17 21:46:26 -04:00
celogeek 4d81d3613c
display the check when books are read 2020-10-17 16:49:57 +02:00
celogeek 7d28963a32
connect read books to all render 2020-10-17 16:49:38 +02:00
celogeek b2594468b4
add helper to get all read books 2020-10-17 16:49:06 +02:00
celogeek 754b9832e9
fix height container 2020-10-17 13:30:19 +02:00
celogeek 097ac879ea
render read 2020-10-17 13:24:46 +02:00
Ozzieisaacs bc0416cbb4 Fix for #1660 (advanced search for custom columns working, headline for advanced search working) 2020-10-16 20:24:15 +02:00
Ozzieisaacs 2814617e4b Fix for #1660 (Pagination in advanced search not working, error 500 for no filter in advanced search)
Fix #1666 (Pagination in search not working)
2020-10-16 19:56:24 +02:00
cbartondock da9dfd166d fixed incorrect cover widths 2020-10-16 13:51:48 -04:00
cbartondock 1be07a42df Flex display to fix columns issue 2020-10-16 13:41:48 -04:00
cbartondock 1d83a6a898 distinguish convert from and convert to extensions 2020-10-16 11:51:59 -04:00
Ghighi 2ff286b672 natural solution, pagination is changing on new page 2020-10-16 00:43:57 +03:00
Ozzie Isaacs e8620a0986 Fix logging error on windows with invalid goodreads key/secret 2020-10-14 20:48:01 +02:00
Ozzie Isaacs 7fb18bbdc7 Update Testresults on windows 2020-10-14 19:54:58 +02:00
Ozzieisaacs 5b67b687d3 Removed remaining code from view downloaded books in user section
Fixes for #1661
2020-10-13 19:45:27 +02:00
Ghighi Eftimie 9adcfa99f4 trigger infinite scroll script only on templates where .load-more class is present 2020-10-11 22:35:56 +03:00
Ghighi Eftimie e723aaa5f6 fix for history state (+1 not needed) 2020-10-11 21:56:49 +03:00
Ozzie Isaacs d128b037a5 Fix for editing files on windows 2020-10-11 18:01:26 +02:00
Ozzieisaacs 99fda00442 Merge remote-tracking branch 'caliblur/issue/caliblur-1560' into master 2020-10-11 12:43:21 +02:00
Ghighi Eftimie f574f8faf0 better js check 2020-10-10 18:34:55 +03:00
Ghighi Eftimie cedfa90d76 fix for #981 2020-10-10 17:51:46 +03:00
Ghighi Eftimie f1e6f6e505 fixes for #1560 2020-10-10 14:58:06 +03:00
Ghighi Eftimie b4f95cced7 Merge remote-tracking branch 'upstream/master' 2020-10-10 14:51:55 +03:00
Ozzieisaacs e16c0caebb Fix opds search 2020-10-10 12:53:10 +02:00
Ozzieisaacs 52489a484a Merge remote-tracking branch 'Knepherbird/master' into master
# Conflicts:
#	cps/jinjia.py
#	cps/templates/detail.html
#	cps/templates/discover.html
#	cps/templates/index.html
#	cps/web.py
2020-10-10 12:47:49 +02:00
Ozzieisaacs e1d5c2c578 Merge remote-tracking branch 'caliblur/issue/caliblur-1594' into master 2020-10-10 12:29:30 +02:00
Ozzieisaacs 49f49632ad Renamed CalibLur.css 2020-10-10 12:22:52 +02:00
Ghighi Eftimie 6dadc6fb1e same fix but hopefully better 2020-10-10 13:15:02 +03:00
Ozzieisaacs a58a2f5fe4 Added missing file for tr locale of datepicker 2020-10-10 11:53:15 +02:00
Ghighi Eftimie c33c6bbff0 fix for #1594 2020-10-10 12:39:52 +03:00
Ozzieisaacs 093f90d4c1 Update translation files 2020-10-10 11:38:40 +02:00
Ozzieisaacs 20ffa325d3 Fix #1642 2020-10-10 10:53:08 +02:00
Ghighi Eftimie 5027304801 Merge remote-tracking branch 'upstream/master' 2020-10-10 11:50:19 +03:00
Ozzieisaacs 85d5afd6d9 Merge branch 'Develop' into master 2020-10-10 10:38:11 +02:00
OzzieIsaacs df295e92ee Merge remote-tracking branch 'origin/Develop' into Develop 2020-10-10 10:33:12 +02:00
Ozzieisaacs 2e67bd2407 Fix add to shelf from search 2020-10-10 10:32:53 +02:00
OzzieIsaacs 9aa01ee8cf Merge branch 'master' into Develop 2020-10-10 10:14:33 +02:00
OzzieIsaacs 6b993ad329 Update test results 2020-10-10 10:14:09 +02:00
OzzieIsaacs d70ded0993 Fix for search 2020-10-10 07:47:27 +02:00
OzzieIsaacs 3dacdcc8bb Merge remote-tracking branch 'worker/db' into Develop 2020-10-10 07:31:08 +02:00
OzzieIsaacs bb03026589 Fixes from merge problems 2020-10-10 07:30:03 +02:00
Ghighi Eftimie 2f69e3141e Merge remote-tracking branch 'upstream/master' 2020-10-07 09:16:34 +03:00
Ozzieisaacs 1f4564da76 Merge remote-tracking branch 'es/patch-1' into master 2020-10-06 21:48:42 +02:00
OzzieIsaacs 3b8e5ddfb3 Merge remote-tracking branch 'worker/db' into Develop
# Conflicts:
#	cps/tasks/convert.py
2020-10-06 21:40:47 +02:00
Nacho Soler edc293f96a
Update
Add some missings translations
2020-10-06 16:43:00 +02:00
blitzmann 3fa4149bb0 Fix reference issue 2020-10-05 23:15:42 -04:00
OzzieIsaacs 4b68a6ff23 Updates tests 2020-10-04 19:25:06 +02:00
Ozzieisaacs 28116c49dc Merge branch 'worker_task' into Develop 2020-10-04 19:23:32 +02:00
Ozzieisaacs 6e6f144b7a Paginated search and advanced search
Wraparound on books list deactivated
2020-10-04 19:23:06 +02:00
Ozzieisaacs e3f4f24c3e Fixes for failed email and conversions with gdrive 2020-10-04 13:59:33 +02:00
Ozzieisaacs eb37e3a52b Fix UI Deelete Buttons in Edit Books page
Fix Conversion of multiple formats of one book in the queue with gdrive
2020-10-04 12:09:52 +02:00
Ozzieisaacs 95d540630e Change ldap_certpath to file 2020-10-04 06:15:35 +02:00
Ozzieisaacs 23d66a0d68 Fix 2020-10-03 21:43:48 +02:00
Ozzieisaacs 0d64692c84 Fix for convert + email task with gdrive 2020-09-30 19:29:57 +02:00
Ozzieisaacs 1cb640e51e Update minimum required version of SQLAlchemy (Fix #1641) 2020-09-29 18:19:00 +02:00
Ozzieisaacs 2d98285545 Update minimum required version of SQLAlchemy 2020-09-29 18:16:56 +02:00
OzzieIsaacs 376001100a Bugfixes from last testrun 2020-09-28 21:24:47 +02:00
Ozzieisaacs e2954249f8 Update chinese translation 2020-09-27 19:22:41 +02:00
Ozzieisaacs cc0b0196f4 Store UI settings in flask session for guest user 2020-09-27 19:12:10 +02:00
Ozzieisaacs 6dfa171b4e Added id's for testing
moved downloaded books section
2020-09-27 16:00:17 +02:00
Ozzieisaacs b140073988 Merge branch 'master' into Develop
Fix #1629 (Gevent Tracebacks with SSL encryption)
2020-09-27 13:02:25 +02:00
Ozzieisaacs c22bc857b0 Fix #1629 (Gevent Tracebacks with SSL encryption) 2020-09-27 13:00:07 +02:00
Ozzieisaacs 497fbdcdfc Save view settings 2020-09-27 12:37:41 +02:00
Ozzieisaacs 861f1b2ca3 Merge branch 'master' into Develop
# Conflicts:
#	test/Calibre-Web TestSummary_Linux.html
2020-09-27 08:54:32 +02:00
Ozzieisaacs 6108ef4c89 Version update to 0.6.10 Beta 2020-09-27 07:43:56 +02:00
OzzieIsaacs a9c0bcb4a2 Updated testresults
Version bump for release
2020-09-27 07:15:03 +02:00
Ozzie Isaacs 8f9de05768 Update Test results windows 2020-09-27 06:33:41 +02:00
Ozzieisaacs e61e94f0fa Merge remote-tracking branch 'it/patch-15' into master
Updated Translations
2020-09-26 16:19:34 +02:00
Ozzieisaacs 85aac02593 Merge remote-tracking branch 'css/master' into master 2020-09-26 16:13:53 +02:00
Ozzieisaacs 9a678c41fe Fix error from merge 2020-09-26 09:42:40 +02:00
Ozzieisaacs 7c8f6ce62f Merge branch 'master' into Develop
# Conflicts:
#	cps/comic.py
#	cps/editbooks.py
#	cps/isoLanguages.py
2020-09-26 07:54:38 +02:00
Ozzieisaacs 9a896ea81e Removed logging of headers as it caused trouble while showing logfile in UI 2020-09-26 07:51:29 +02:00
Ozzieisaacs 422c1893c0 Fix for the fix cover_url 2020-09-24 11:02:12 +02:00
ElQuimm f1cb5276d7
Update italian message.po
removed typo line 127
2020-09-24 10:54:06 +02:00
Ozzieisaacs bed1b24340 Fixes from test of upload restrictions 2020-09-24 10:54:02 +02:00
Ozzieisaacs da909ff084 Fixes from test of upload restrictions 2020-09-23 20:50:34 +02:00
Ozzieisaacs 8f743b70a4 Revert the tolino stuff 2020-09-22 20:25:58 +02:00
Ozzieisaacs a761017116 Additional debug output for #1527 2020-09-21 19:09:02 +02:00
Ozzieisaacs f06cc25a99 Fix for immediate logout with next="/logout"
Fix tolino per default with deactivated Strict-Transport-Security
2020-09-21 18:34:39 +02:00
Ozzieisaacs eff8480d5c Show listen in browser formats in lowercase 2020-09-21 18:24:50 +02:00
Ozzieisaacs eec303de49 Fix #1621 (Link to contributing.md file wrong) 2020-09-21 14:18:23 +02:00
ElQuimm 07a936c5e8
italian version of messages.po updated 2020-09-21 10:53:29 +02:00
Ryan Long a6002a2c6c 1622_updated_css 2020-09-20 23:41:20 -04:00
Ozzieisaacs 7ba014ba49 Fix "is not a valid language" on upload of comic books
Fix metadata excration of comic books
updated bootstrap table
updated handling of upload formats restrictions
2020-09-20 15:05:52 +02:00
Ozzieisaacs 165c649f31 Fix "is not a valid language" on upload 2020-09-20 11:44:03 +02:00
Ozzieisaacs 4cf71dd336 Fix "is not a valid language" on upload 2020-09-20 11:41:44 +02:00
Ozzieisaacs c0a401216b Add links to contribution guidelines 2020-09-20 10:10:58 +02:00
Ozzieisaacs 2d712a3841 Fix #1612 2020-09-20 10:03:05 +02:00
Ozzieisaacs a2b5b4dd17 Merge remote-tracking branch 'identifier/master' into master 2020-09-20 10:01:46 +02:00
blitzmann 0480edce2a Clarify need for WeakSet 2020-09-18 21:52:45 -04:00
Alexander Yakovlev 4eded82102
Add ISFDB 2020-09-15 17:39:13 +07:00
Alexander Yakovlev ec4ff83465
Add ISSN tags 2020-09-15 13:50:34 +07:00
Alexander Yakovlev 8745b8b051
nice title for Litres tags 2020-09-15 13:47:57 +07:00
Alexander Yakovlev 4e28c3cadb
add Litres references 2020-09-15 13:41:01 +07:00
blitzmann 76c724c783 Remove global session object, this is now wrapped in the CalibreDB class 2020-09-13 21:37:47 -04:00
blitzmann 032cb59388 Fix resetting the session when first configuring the calibre-db on first boot up 2020-09-13 13:16:11 -04:00
OzzieIsaacs e29247774c Bugfixes for uploading books to GDrive with new worker 2020-09-12 13:55:36 +02:00
blitzmann 18d16f9a8b Initial attempt at setting up CalibreDB as a class that carries the engine and DB connection, and the instance being the session 2020-09-11 22:52:40 -04:00
OzzieIsaacs d137735be1 Fix #805 (First request to gdrive fails) 2020-09-11 20:56:54 +02:00
dickreckard 65929c02bc isolanguage parsing of xmp data 2020-09-11 10:49:45 +00:00
root 22466d6b98 xmp data processing added to the uploader 2020-09-11 10:08:55 +00:00
dickreckard 23fe79c618
Update uploader.py 2020-09-11 03:42:19 +02:00
OzzieIsaacs b202ca5619 Updated test result 2020-09-09 07:00:09 +02:00
OzzieIsaacs 7929711fea Improvements for file uploading format restriction 2020-09-08 20:57:39 +02:00
OzzieIsaacs 49a028a599 Bugfix not unlink generic cover on upload 2020-09-08 19:04:04 +02:00
OzzieIsaacs 670cbcd336 Merge branch 'master' into Develop 2020-09-07 21:33:11 +02:00
Ozzieisaacs 449d31e8a1 Refactored update_dir_structure_file 2020-09-07 21:26:59 +02:00
Ozzieisaacs fe82583813 Merge branch 'database_fix' into Develop 2020-09-07 21:23:35 +02:00
Ozzieisaacs 1450a21d00 Fix links to amazon (#1461) 2020-09-07 18:27:43 +02:00
Ozzieisaacs ae15544aed Merge branch 'master' into database_fix
# Conflicts:
#	cps/editbooks.py
2020-09-07 18:21:33 +02:00
Ozzieisaacs 4b7a37cf7d Bugfix empty email attachment size 2020-09-07 18:19:54 +02:00
dickreckard cb7727900c
Update uploader.py
default cover changed from none to pdf_preview when metadata parsing fails
2020-09-07 13:30:03 +02:00
Ozzieisaacs e012726cd4 Fix #1461 (parse Amazon_* identifiers) 2020-09-06 19:31:31 +02:00
Ozzieisaacs f49688fdb9 Fix #1461 (parse Amazon_* identifiers) 2020-09-06 19:31:03 +02:00
Ozzieisaacs e32b017431 Revert "Test revert global Session"
This reverts commit 393869e538.
2020-09-06 10:59:34 +02:00
Ozzieisaacs 393869e538 Test revert global Session 2020-09-06 10:27:10 +02:00
Ozzieisaacs d3bde0408f Improvederror handling for editing identifier 2020-09-05 18:47:28 +02:00
Ozzieisaacs 34d3225984 Errorhandling edit identifier 2020-09-05 18:46:11 +02:00
Ozzieisaacs eaed53e25b Fix for author edit error (2 same sort_authors lead maybe to choose wrong one) 2020-09-05 18:23:14 +02:00
OzzieIsaacs feacbe8ebd Possible Fix for database crash after adding new format and accessing calibre database afterwards 2020-09-05 10:24:32 +02:00
norangebit bdf6052388
Conversion to kepub when creating a sync token 2020-09-03 21:57:14 +02:00
Ozzieisaacs ec0a0190e7 Merge remote-tracking branch 'polish/master' into master 2020-09-01 20:18:29 +02:00
norangebit 99d653eece
Add automatic conversion in kepub
Automatic conversion from epub to kepub of new book on Kobo sync.
2020-09-01 19:27:14 +02:00
OzzieIsaacs f825c5ae83 Merge branch 'master' into Develop 2020-09-01 19:26:13 +02:00
OzzieIsaacs 173484c30e Fix #1002, #1581 (Public shelfs not accessible as guest user) 2020-09-01 19:25:57 +02:00
OzzieIsaacs 884270093b Merge remote-tracking branch 'worker/tasks' into Develop 2020-08-31 13:00:13 +02:00
Dawid Gliwka 62e7ab8c2b Update polish translation 2020-08-30 21:17:56 +02:00
blitzmann ded480207b Add link to convert task, fixes #1589 2020-08-30 13:54:51 -04:00
blitzmann ef49e2b5b3 Revert daemon in favor of timeout 2020-08-30 13:49:45 -04:00
blitzmann b0a055a870 Rename email.py -> mail.py to avoid shadowing standard email module 2020-08-30 13:31:59 -04:00
blitzmann 9b9e29a3b6 Implement worker thread as a daemon 2020-08-30 13:29:42 -04:00
OzzieIsaacs 1a9a436cbe Fixed wrong translation string
Removed unused variables from callback in server.py
Update Testresults
2020-08-30 17:11:11 +02:00
OzzieIsaacs 62dd29d2f3 Renamed email to mail due to naming conflict in python2 2020-08-30 08:49:53 +02:00
OzzieIsaacs d406d91856 Merge remote-tracking branch 'worker/tasks' into Develop 2020-08-30 08:32:09 +02:00
OzzieIsaacs 98494c610a Merge branch 'master' into Develop 2020-08-30 08:31:35 +02:00
OzzieIsaacs 649a553fa4 Merge remote-tracking branch 'metadata/master' into master 2020-08-30 08:30:32 +02:00
OzzieIsaacs e17a06d7bd Merge remote-tracking branch 'oauth/oauth-typo' into master 2020-08-30 08:28:27 +02:00
OzzieIsaacs 4b14cc6a74 Merge remote-tracking branch 'oauth/oauth-typo' into Develop 2020-08-30 08:28:14 +02:00
OzzieIsaacs 65560ab65e Merge remote-tracking branch 'google_oauth/patch-1' into master 2020-08-30 08:26:48 +02:00
OzzieIsaacs b65095fd0f Merge remote-tracking branch 'google_oauth/patch-1' into Develop 2020-08-30 08:26:34 +02:00
OzzieIsaacs 28733179d2 Merge remote-tracking branch 'caliblur/editMetaFix' into Develop 2020-08-30 08:25:17 +02:00
OzzieIsaacs 960d23ca50 Merge remote-tracking branch 'caliblur/blurPaginationFix' into Develop 2020-08-30 08:23:06 +02:00
Michael Knepher 057f70ea9c Add author sort 2020-08-29 18:53:00 -07:00
blitzmann 3e378bd665 Some more clean up 2020-08-29 21:04:49 -04:00
blitzmann c120138f26 Fixes for pagination ugliness for caliBlur! style 2020-08-29 20:58:30 -04:00
blitzmann 31b20362ec caliBlur! style: Fixes issue with edit metadata button not getting styled correctly 2020-08-29 18:45:23 -04:00
blitzmann e7eb5b6ea6 Improvements to task processing
* Moves clean up to separate function for organization
* moves the `self.dequeued.append(item)` immediately after `self.queue.get()` so that we don't wait for it to show up

(cherry picked from commit bc9372e88f0c8855694431f811702d7fb899a97e)
2020-08-29 12:25:33 -04:00
OzzieIsaacs fe91ed815e Updated testresults with merged new worker 2020-08-29 12:46:12 +02:00
OzzieIsaacs 9e5cad0dc8 Merge new worker thread 2020-08-29 11:14:52 +02:00
OzzieIsaacs 36cbc42363 Better test output html file 2020-08-28 16:51:53 +02:00
blitzmann 4cb82ea9bd Revert testing condition that decreased number of tasks kept 2020-08-27 21:49:55 -04:00
blitzmann 572ac4a17b Fix for deleting old, completed tasks
(cherry picked from commit e066d7a4b0f47d3327696a11795cdc923ff0f6f3)
2020-08-27 21:46:20 -04:00
Ozzie Isaacs 6c552f6b43 Update tests Windows 2020-08-27 22:29:47 +02:00
Ozzie Isaacs 9723129436 Updated dependency comicapi version 2020-08-27 21:03:36 +02:00
Ozzie Isaacs dc5191f8ba Added unrar binary is found on windows 2020-08-27 21:01:45 +02:00
OzzieIsaacs d79726899f Updated testresult linux 2020-08-26 21:44:31 +02:00
Ozzie Isaacs 8ab5710098 Updated testresuts Windows 2020-08-26 21:43:58 +02:00
OzzieIsaacs 61d628d596 oauth problem solved 2020-08-26 18:22:56 +02:00
Sean Leonard 078fc25845
Remove Google+ OAuth scope
The scope is no longer available per https://developers.google.com/+/api-shutdown

Fixes #1472 
Fixes #1573
2020-08-26 08:56:56 -07:00
Marvel Renju 67eb4b317a Fix typo
google oauth provider obtain link was pointing to github
2020-08-26 03:15:39 +01:00
blitzmann 6322919bc7 Merge branch 'Develop' into tasks
# Conflicts:
#	cps/db.py
2020-08-25 00:15:41 -04:00
blitzmann b81b8a1dea Fix registration email 2020-08-25 00:05:20 -04:00
blitzmann f3a3797850 Fail the convert task if the email subtask fails 2020-08-24 21:28:55 -04:00
blitzmann 5ec1283bb1 Remove threading for the calibre DB class 2020-08-24 21:03:59 -04:00
blitzmann 8634b0c6f0 Remove left over placeholder code 2020-08-24 21:00:15 -04:00
Ozzie Isaacs d89830af61 Fix anonymous user has no modified_flag error 2020-08-24 21:00:13 +02:00
Ozzie Isaacs ef1736b571 Fix error on guest user (view settings missing) 2020-08-24 20:38:06 +02:00
Dave Mogle d951ee4b83 Prefer kepub (#1439)
Only offer kepub download URL over Kobo sync API when available
2020-08-24 13:43:54 -04:00
blitzmann 04081f62c4 Delete old worker thread class / logic 2020-08-23 23:34:41 -04:00
blitzmann 0f28dc5e55 Remove the queue stuff for CalibreDB (is no longer used) 2020-08-23 23:17:07 -04:00
blitzmann 508f49df18 Remove completed tasks and sort the tasks by date added when calling `.tasks` 2020-08-23 23:00:23 -04:00
blitzmann bec280c6b1 Add some error handling 2020-08-23 21:51:44 -04:00
blitzmann 6a8ae9c0c4 Merge remote-tracking branch 'upstream/master' into tasks
# Conflicts:
#	cps/helper.py
2020-08-23 21:38:56 -04:00
blitzmann ac22483f98 Add error handling to the email task within the convert task 2020-08-23 21:35:05 -04:00
blitzmann 59d56d5c83 py27 support (I think) and some clean up 2020-08-23 21:21:55 -04:00
OzzieIsaacs cdaad2fb4a Merge branch 'master' into Develop 2020-08-23 21:23:00 +02:00
OzzieIsaacs 843279bacb Merge remote-tracking branch 'jef/jef/download-kobo' into master 2020-08-23 21:22:44 +02:00
blitzmann a000de0270 Some clean up 2020-08-23 13:33:57 -04:00
blitzmann bf41b04cfa Remove convert task from db.py - with the fixed from #1565, this no longer seems to be needed 2020-08-23 13:07:24 -04:00
blitzmann 9ce2e8ea53 Fix progress indication for emails that have been completed. 2020-08-23 12:58:24 -04:00
OzzieIsaacs f066926fc9 Merge branch 'master' into Develop 2020-08-23 10:56:10 +02:00
OzzieIsaacs 4c38b0ab10 Prepare for save name sort order 2020-08-23 10:56:00 +02:00
OzzieIsaacs cf35c9dcef Merge remote-tracking branch 'name/patch-2' into master 2020-08-23 10:53:18 +02:00
OzzieIsaacs 45ff9394f2 Fix comma separated author names during for upload 2020-08-23 09:44:42 +02:00
blitzmann 414043ded1 Remove references to old worker, turn off calibre_db task queue (for now until I can determine if it's needed still), and attempt to re-implement email progress tracking (not working at the moment) 2020-08-22 23:35:48 -04:00
blitzmann 2533c9c14e Continue converting tasks - email and upload tasks 2020-08-22 22:44:28 -04:00
blitzmann f10f0dada6 First working PoC with a new task structure 2020-08-22 16:31:00 -04:00
OzzieIsaacs 282859bc1b Merge remote-tracking branch 'github/master' into master 2020-08-22 15:38:40 +02:00
OzzieIsaacs a3ae97a5a3 Fix #1574 (author name not shown in change book order in shelfs) 2020-08-22 15:37:40 +02:00
OzzieIsaacs ed8275a20b Fix #1574 (author name not shown in change book order in shelfs) 2020-08-22 15:35:21 +02:00
OzzieIsaacs f2add3f788 Migration of view settings working in User database
Book Merge gives now feedback on what is done
2020-08-22 10:27:09 +02:00
OzzieIsaacs ad144922fb Merge with master 2020-08-22 09:23:29 +02:00
OzzieIsaacs b9c0f2a3d3 Merge remote-tracking branch 'origin/master' into master 2020-08-21 19:27:19 +02:00
OzzieIsaacs 0cc07362b8 Fix for #1573 2020-08-21 19:26:58 +02:00
Brandon Ingli 4ee5dcaff3
Elevate Log Messages in web.py
Elevates login failure log messages and register failure log messages from INFO to WARNING, "Unknown Error" to ERROR, and fixes misspelling of "address" in web.py log messages. Misspelling remains in variable names to avoid breaking changes.
2020-08-17 11:29:10 -05:00
Ozzie Isaacs 4d44746a88 Change settings database gdrive watch to JSON 2020-08-15 15:07:03 +02:00
OzzieIsaacs 1535bdbcd8 Merge remote-tracking branch 'memorydatabase/issue/1564' 2020-08-15 12:08:59 +02:00
OzzieIsaacs ecb160b28d Merge remote-tracking branch 'pypy/fix-pypy3-settings-database-error' 2020-08-15 10:58:08 +02:00
OzzieIsaacs 7e9941def0 Updated test results 2020-08-14 21:02:59 +02:00
OzzieIsaacs f9c6fb30bf Excluded series type again, as it causes problems upon reconnect 2020-08-14 19:43:54 +02:00
Ozzie Isaacs 94ad93ebd7 Added series like custom columns #1501 2020-08-11 18:56:34 +02:00
blitzmann 0e1ec5034e Fix for #1564 - using memory database in multiple threads.
See also: https://docs.sqlalchemy.org/en/13/dialects/sqlite.html#using-a-memory-database-in-multiple-threads
2020-08-11 12:44:55 -04:00
Marvel Renju 76b0505bd9 Change all "conn = engine.connect()" statements to "with engine.connect() as conn:" in ub.py
Changed all the statements in ub.py to use python context managers so that conn.close() is called automatically.  (https://docs.sqlalchemy.org/en/13/core/connections.html)
2020-08-10 03:42:36 +01:00
OzzieIsaacs b309c1fc91 Fix filenames (Escape "\") for searching calibre excecutable on windows 2020-08-09 15:11:54 +02:00
OzzieIsaacs b9a802a19c Merge remote-tracking branch 'cover_path/patch-1' 2020-08-09 14:54:36 +02:00
OzzieIsaacs a882ad3e65 Merge remote-tracking branch 'contrib/patch-1' 2020-08-09 14:52:01 +02:00
Ryan Holmes 969105b205
Trim whitespace from filename
This avoids an OSError when the book's metadata has whitespace at the end of it.
2020-08-09 01:08:00 -04:00
Ryan Holmes 28bfb06c67
Revert the deletion of another line
This was done by mistake, whoops!
2020-08-09 00:57:30 -04:00
Ryan Holmes 704dcb3e58
Move assignment of `new_coverpath`
With the assignment originally being within the try, if the try failed, the exception wouldn't have access to the value
2020-08-09 00:55:56 -04:00
Efreak a7e723d8d4
Spelling/grammar in CONTRIBUTING.md 2020-08-08 01:06:19 +00:00
Ren Wei 4c6f5096be get metadata, typo, if no result from google, it will display the noresult msg, regardless of the others results. 2020-08-01 15:12:20 +08:00
Ozzie Isaacs 1a1d105fae Fix #1538 (Floating point numbers showing 2 decimals on details page 2020-07-23 19:31:48 +02:00
Ozzie Isaacs 42a0639bb5 Fix #1533 (Invalid LDAP Cert Path no longer crashes app) 2020-07-23 19:23:57 +02:00
Ozzie Isaacs e27b08203d Fix #1531 (white background on transparent cover instead of black one) 2020-07-23 18:41:38 +02:00
Clément Poissonnier 1ca4583896 feat(ldap): add a field that allows to override LDAP User Object Filter when a user is imported 2020-07-23 12:12:00 +02:00
Ozzie Isaacs 25fc6f1937 Further fixes for #1530 (Handle improper migrated database with config_mature_content_tags, allowed_tags, denied_tags, denied_column_value, allowed_column_value NULL instead of "") 2020-07-22 18:44:11 +02:00
Ozzie Isaacs 0ccc3f7252 Fixes for windows (moving files not allowed -> Close pdf after metadata extracting, add os.path.normcase to path while renaming folders, as thi caused also trouble
Added hint for missing ghostcript on cover extraction
2020-07-21 20:14:08 +02:00
Ozzie Isaacs 66acd1821d Update Gdrive integration (Error Handling on Callback and wording) 2020-07-21 18:01:38 +02:00
Ozzie Isaacs 93a0217d5f Fix for #1530 (Handle improper migrated database with config_mature_content_tags NULL instead of "") 2020-07-20 20:28:10 +02:00
Jef LeCompte 711a697570
Merge remote-tracking branch 'upstream/master' into jef/download-kobo 2020-07-13 01:50:38 -04:00
Ozzieisaacs f8139f3198 Store last selected view for sidebar (not for categories, series, publishers, ..)
Started making search paged
2020-07-11 12:09:34 +02:00
Ozzieisaacs df01022f49 Added save user view settings 2020-07-08 21:18:38 +02:00
Ozzieisaacs 450411a732 #1344 (Support Multiple authors, but not showing up on Kobo reader)
Fix for #1439 (reading progress was not stored, as user login was wrong)
2020-07-05 20:54:36 +02:00
Ozzieisaacs f80c67828b Fix #1500 (Custom ratings of increment 0.5 are allowed) 2020-07-05 14:35:57 +02:00
Ozzieisaacs d1889a5e06 Fix #1502 (program info only visible in about section if user is admin) 2020-07-05 14:00:40 +02:00
Ozzieisaacs 12263ff02f Fix #1423 (OverflowError thrown during sync on some Linux Systems if one of the timestamps is outside range 1970 to 2038) 2020-07-05 13:55:59 +02:00
Ozzieisaacs 76f914cbc2 Fixed logging in SyncToken 2020-07-05 13:52:29 +02:00
Ozzieisaacs c1f5252b3f Fix #1509 (OSError thrown during sync on Windows if one of the timestamps is outside range 1970 to 2038) 2020-07-05 13:40:33 +02:00
Ozzieisaacs 20c6f79a44 Changed behavior delete books with subfolders (additional warning message, but book is deleted) 2020-07-05 10:44:49 +02:00
Ozzieisaacs ee6f1405d4 Fix #1456 (Added route to robots.txt) 2020-07-04 21:22:19 +02:00
Ozzieisaacs ee3541d74e Fix kobo links for reverse proxies with subdomains (and docker?) #1470 2020-07-04 13:35:08 +02:00
Jef LeCompte e048388213
feat(api): include external port option
Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
2020-07-03 12:58:58 -04:00
Ozzieisaacs 3ff3431b17 Merge branch 'master' into Develop 2020-06-30 19:59:38 +02:00
Ozzieisaacs 8608ff11f7 Fix #1507 (Password generation on python2 working again) 2020-06-30 19:58:07 +02:00
Michael Knepher 7e0d9fbace series_index filter to show x.0 as x 2020-06-29 23:34:26 -07:00
Ozzieisaacs c6c9cfea22 Merging books basically working 2020-06-29 20:14:48 +02:00
Ozzieisaacs a758976c69 Merge branch 'master' into Develop 2020-06-29 18:47:16 +02:00
OzzieIsaacs a14192b7e0 Updated testresults 2020-06-28 22:31:18 +02:00
OzzieIsaacs 601464083b Fix for task wrap around 2020-06-28 13:44:21 +02:00
Ozzieisaacs ccca5d4d1c Merge branch 'master' into Develop
# Conflicts:
#	cps/templates/layout.html
2020-06-28 12:11:46 +02:00
Ozzieisaacs ba10657829 Add fix for read only gdrive file 2020-06-28 12:06:27 +02:00
Ozzieisaacs 6315655f93 Re-add missing po files 2020-06-28 12:05:16 +02:00
Ozzieisaacs 533cb23b73 Merge remote-tracking branch 'next/bug/login-next-get-param' 2020-06-28 10:01:41 +02:00
Ozzieisaacs 0b95424a0d Merge remote-tracking branch 'issue_template/patch-1' 2020-06-28 09:50:58 +02:00
Ozzieisaacs 852f252d13 Prevent invalid variable
Make text in kobo_auth_screen consistent
2020-06-28 09:48:05 +02:00
Ozzieisaacs 080042882f Merge remote-tracking branch 'cz/master' 2020-06-28 09:33:18 +02:00
Ozzieisaacs dde5b08c47 Re enabled gevent as dependency
Fix #1399 (Calibre-web starting with installed and not activated gdrive denpendencies without internet connection again)
2020-06-27 13:36:33 +02:00
Ozzieisaacs 88d2c60ee8 Catch some errors related to non writable settings db 2020-06-27 13:22:16 +02:00
Ghighi Eftimie eeff5a5d43 fix for hidden input 'next' on login form 2020-06-27 12:00:08 +03:00
Michael Knepher 67dd4a72b0 Add series info to all book "meta" displays 2020-06-26 12:26:36 -07:00
Ozzieisaacs a0b8cc21cc Fix #1503 (js error on login screen) 2020-06-23 15:07:14 +02:00
Ozzieisaacs 329a7a03a5 Fix for errors editing/uploading books with duplicate tags/authors/language names
Additional parsing of epubs for cover files
Fix for change of database with linked read_column and read column isn't present any more
2020-06-22 19:11:58 +02:00
Ozzieisaacs d0a3503d74 Fix #1493 (stay logged in with enabled remember token, use remember token) 2020-06-20 19:02:23 +02:00
Ozzieisaacs 59b78f9984 enable disabling of remember_me function 2020-06-20 15:41:26 +02:00
Ozzieisaacs bf75f16169 Updated Chinese translation 2020-06-20 13:55:34 +02:00
Ozzieisaacs 2f833dc457 Fix login with remember me token 2020-06-20 13:46:12 +02:00
Ozzieisaacs 22344a3971 Improvements for delete book 2020-06-18 20:39:45 +02:00
Ozzieisaacs 8dde6ba60f UI improvements table buttons 2020-06-12 21:40:09 +02:00
Ozzieisaacs d44f283a05 View status in books table is stored 2020-06-12 16:15:54 +02:00
Ozzieisaacs c18d5786dd Improved validation check 2020-06-12 13:45:07 +02:00
Ozzieisaacs f26ccfe16c Table edit: validator routine to prevent empty fields working 2020-06-11 21:36:12 +02:00
Ozzieisaacs 1c681ee378 Improvements for books table editor 2020-06-11 21:19:09 +02:00
flying-sausages 4c1ae44bbe
Fixed inconsistencies in bug report template, improved examples 2020-06-11 14:59:51 +01:00
Ozzieisaacs 94b5ec91cc Title in table translatable
Edit some elements in table possible
Checkbox state is kept over page change in book table
Fix missing div in layout
2020-06-11 08:48:23 +02:00
Ozzieisaacs 6bfbf3ee41 Update layout 2020-06-11 08:35:23 +02:00
Lukáš Heroudek fc24fa337e
Updated CZ translation 2020-06-09 21:15:09 +01:00
Ozzieisaacs 7b4306b1d6 UI improvements (same colors of buttons, etc.)
Changed Editable default value
2020-06-09 20:46:02 +02:00
Ozzieisaacs 4516cc0d65 Listen button only visible if user has read permissions
Audioformat fix
Table edit functions only available if user has edit rights
2020-06-08 21:57:52 +02:00
Ozzieisaacs 308784c601 Hide listen button if user has no read/listen permissions 2020-06-08 21:56:40 +02:00
Ozzieisaacs 9145c9a52c Fix #1397 (Reenabled m4a, m4b audio playback) 2020-06-08 21:50:11 +02:00
Ozzieisaacs 4038cb5b85 Internal paged Search prepared
Search for table list is working
2020-06-08 17:34:03 +02:00
Ozzieisaacs 628658972c Merge branch 'master' into Develop 2020-06-07 19:39:17 +02:00
Ozzieisaacs db0fe9a755 Fix for #1474 (old comicapi with installed unrar, but missing unrar-lib) 2020-06-07 15:41:53 +02:00
Ozzieisaacs fdf10e3d2e Fix #1473 (reconnect not working via web-route access) 2020-06-07 14:11:41 +02:00
Ozzieisaacs ded3e06a9b Updated french translation 2020-06-07 06:48:51 +02:00
Ozzieisaacs 0dd0605a1f Book list for merging 2020-06-06 21:21:10 +02:00
Ozzieisaacs 827b0c6e50 Changed pubdate to timestamp 2020-06-06 09:52:35 +02:00
Ozzieisaacs d1b533848d Changed pubdate to timestamp 2020-06-05 20:13:39 +02:00
Ozzieisaacs 13ae28edab Fix #1449 (Shelf download menu wasn't working for books with more than one format) 2020-06-04 20:34:31 +02:00
Ozzieisaacs 82253219e8 Fix #1449 (Shelf download menu wasn't working for books with more than one format) 2020-06-04 20:33:14 +02:00
Ozzieisaacs 94592b74a6 Merge branch 'master' into Develop 2020-06-03 20:15:55 +02:00
Ozzieisaacs eef2112e1e #1430 (changed color of rating stars) 2020-06-03 20:14:07 +02:00
Ozzieisaacs b83d56eff2 Version bump 2020-06-03 19:10:36 +02:00
Ozzieisaacs 4c539b6db4 Fix #1448 (Public shelfs are accessible even if not logged in) 2020-06-03 19:10:07 +02:00
OzzieIsaacs 2ad329e64c Preparation for release 2020-06-02 22:12:36 +02:00
Ozzieisaacs 4de89ec6ce Merge remote-tracking branch 'it/patch-14' 2020-06-02 20:58:17 +02:00
Ozzieisaacs fc885c8fa2 Merge remote-tracking branch 'cz/patch-1' 2020-06-02 20:51:31 +02:00
Ozzieisaacs ef2c98ba39 Fix #1453 (error unrar binary not found) 2020-06-02 20:51:08 +02:00
ElQuimm 41d922867e
updated italian version of message.po
Thank you.
2020-06-02 09:02:44 +02:00
Ozzieisaacs 89223760e6 Merge branch 'master' into Develop 2020-06-01 10:58:49 +02:00
Ozzieisaacs 9a8a1f75ca For for error unrar binary not found 2020-06-01 10:54:41 +02:00
flying-sausages 52e8e7e4b0
Some czech translations 2020-05-31 22:51:41 +01:00
OzzieIsaacs 93f65484de Update Teststatus 2020-05-29 09:11:52 +02:00
Ozzieisaacs 7d08cde8b8 Update error handling cover upload 2020-05-29 06:59:40 +02:00
Ozzieisaacs d3c2bf7dd4 Merge remote-tracking branch 'es/patch-1' 2020-05-28 18:50:16 +02:00
Michael Knepher 54cf3652b0 Add series name and index to book cover info 2020-05-27 21:57:59 -07:00
Ozzieisaacs 5607d2086d Added error handling for cover upload 2020-05-27 20:41:16 +02:00
Ozzieisaacs 27ed918896 Enabled search for archived books 2020-05-27 19:19:17 +02:00
Ozzieisaacs 9b2df9cfd9 Fix #1441 (list copy function not available on python2, crashes edit metadata) 2020-05-27 18:38:50 +02:00
Michael Knepher 5dd08e438c Merge remote-tracking branch 'upstream/master' 2020-05-27 09:06:43 -07:00
Ozzieisaacs 2f8c8c3a28 Merge remote-tracking branch '/wolviex' 2020-05-27 10:50:13 +02:00
Wolviex dde7cf18f7 removed extra reference to calibre_db (calibre_db.calibre_db..) typo? 2020-05-27 01:41:15 -07:00
Rafael Roa 48aadbf716
Update messages.po 2020-05-26 23:28:29 +02:00
Ozzieisaacs 5514af60e5 Merge remote-tracking branch 'it/patch-13' 2020-05-26 18:43:12 +02:00
ElQuimm e8449eb02f
Updated version of italian message.po
Thank you.
2020-05-26 18:37:15 +02:00
Ozzieisaacs 9ea21a7ecb Possible fix for #1436 2020-05-26 18:20:32 +02:00
Ozzieisaacs fec86c2862 Update Grid/list view of series 2020-05-26 15:19:32 +02:00
Ozzieisaacs 11e5d4c5b7 Merge remote-tracking branch 'es/patch-2' 2020-05-25 21:57:26 +02:00
Ozzieisaacs b852fb0e26 Merge branch 'Develop' 2020-05-25 21:30:21 +02:00
Ozzieisaacs 0fc18bf3b1 Fix for #1398 (prevent empty series_index field) 2020-05-25 19:34:31 +02:00
Rafael Roa d4be584782
Update messages.po
Here is the whole file traslated
2020-05-25 17:35:46 +02:00
Knepherbird 2120d72901
Merge pull request #3 from janeczku/master
Merging current upstream master
2020-05-24 15:25:49 -07:00
Ozzieisaacs 6f9c08f906 Fix typo RarExecutable 2020-05-24 20:54:23 +02:00
Ozzieisaacs 70c666c380 Upload book without reload complete library 2020-05-24 20:40:58 +02:00
Ozzieisaacs 46197d82b5 Edit and Upload books refactored 2020-05-24 20:19:43 +02:00
Ozzie Isaacs e4eab17595 Fix version detect of binaries on windows 2020-05-24 17:24:54 +02:00
Ozzieisaacs cf10244f20 Fix for failed recovery of config_logfile 2020-05-24 09:59:45 +02:00
Ozzieisaacs 570684d308 Fix custom bool column not visible in adv search if linked to read status 2020-05-23 21:26:39 +02:00
Ozzieisaacs 244db8d894 Fix from tests advanced search for custom columns 2020-05-23 21:17:58 +02:00
Ozzieisaacs 96d6018ecc Added ability to view comicapi version
Changed required comicapi version
Unified "cannot" and "Cannot" texts
Removed annoying "was already removed" string from log
2020-05-23 16:20:19 +02:00
OzzieIsaacs 73ad6dd0c4 Fix kobo sync (sync tags) 2020-05-23 14:40:50 +02:00
OzzieIsaacs d0e15da352 Fix lcase function 2020-05-23 12:51:48 +02:00
Ozzieisaacs b1b293a3ec Fix order_authors 2020-05-23 11:09:50 +02:00
Ozzieisaacs 5f0660a4e5 Refactored helper.py and db.py 2020-05-23 10:16:29 +02:00
Ozzieisaacs ec3a3a73ef Merge branch 'master' into Develop 2020-05-23 08:50:24 +02:00
Ozzieisaacs 087c4c5929 Merge remote-tracking branch 'opds/master' 2020-05-23 08:48:08 +02:00
Ozzieisaacs e0ee2e0801 Merge remote-tracking branch 'typo/master' 2020-05-23 08:47:08 +02:00
Michael Knepher c79a9e9858 Fix typo "Shelfs" to "Shelves" 2020-05-22 11:43:52 -07:00
OzzieIsaacs b3fdce36af Update Testresults 2020-05-22 09:01:39 +02:00
OzzieIsaacs b7535b9526 Merging master branch
- fix title sort function
- fix focus on search
2020-05-21 22:31:29 +02:00
OzzieIsaacs 0cf1cc5587 Fixes from tests 2020-05-21 22:26:19 +02:00
Ozzieisaacs 098dab889a Fixed title sorting routine 2020-05-21 19:37:54 +02:00
Ozzieisaacs cc856c7cd1 Merge remote-tracking branch 'search_focus/activate-search-focus-if-search-in-progress' 2020-05-21 19:18:02 +02:00
Ozzieisaacs a20a155d39 Merge remote-tracking branch 'typo/patch-2' into Develop 2020-05-21 19:14:29 +02:00
Ozzieisaacs 1a458fe39f Fix for #1407 converting books should now be possible again 2020-05-21 18:16:11 +02:00
celogeek 051ffdda35
activate search focus if search in progress 2020-05-21 16:42:02 +02:00
OzzieIsaacs a48418364c Fiexes from tests 2020-05-21 13:54:28 +02:00
Ozzieisaacs b75497231e Additional fix for #1407 (metadata.db is now held in memory, app.db is attached to it -> joins between both databases possible -> book_read_link is joined for getting result) 2020-05-21 09:28:35 +02:00
Knepherbird 5cceeb6ef2
Fix: correct property typo
Correcting 'box-sizeing' to 'box-sizing'
2020-05-19 13:10:25 -07:00
Ozzieisaacs 29b94c5615 Fix for #1407 (to many read books lead to to large sql query) -> only fix for linked calibre-column 2020-05-19 21:36:22 +02:00
Ozzieisaacs 81fc1eccd3 Fix for #1407 (to many read books lead to to large sql query) -> only fix for linked calibre-column 2020-05-19 21:35:56 +02:00
Braincoke 22fae51c9d Fix XML parsing error when using OPDS feeds
Using the OPDS feeds with MoonReader yielded the following error:
"Error parsing XML: unbound prefix".
This was due to a missing namespace in the feed.xml template.
See https://github.com/janeczku/calibre-web/issues/1403 for more
information.
2020-05-18 20:07:02 +02:00
Ozzieisaacs 4332f7a640 Better detection of localhost for kobo sync (possibly related to #1400) 2020-05-17 21:44:12 +02:00
Ozzieisaacs d0e603e62d Better detection of localhost for kobo sync 2020-05-17 21:42:25 +02:00
Ozzieisaacs 38c28f4358 Merge branch 'master' into Develop
# Conflicts:
#	cps/admin.py
#	cps/constants.py
#	cps/static/css/caliBlur.min.css
#	cps/uploader.py
2020-05-17 16:22:58 +02:00
Ozzieisaacs 742799b4ac Added missing float custom column to search form 2020-05-17 16:10:10 +02:00
Ozzieisaacs 5405dc5141 Fix for #1387 (saving settings with enabled gdrive metadata watch led to crash) 2020-05-17 11:15:46 +02:00
Ozzieisaacs 013793f989 Fix for #1391 (Kobo sync not working if series is given, but no series_index) 2020-05-17 10:46:48 +02:00
Ozzieisaacs 2468cf63cc Fix for #1397 (changed supported audio files)
Changed max gevent version
Fix for #1397 (changed supported audio files)
2020-05-17 10:07:36 +02:00
Ozzieisaacs 8e9b5d7e50 Merge remote-tracking branch 'caliblur/master' 2020-05-15 21:01:08 +02:00
Ozzieisaacs a33515d907 Merge remote-tracking branch 'refactor/refactor_uploader' 2020-05-15 20:36:00 +02:00
Ozzieisaacs a276a33081 Merge remote-tracking branch 'nl/master' 2020-05-15 20:34:30 +02:00
h1f0x e325c3dbf6 fixed div selection in caliBlur.js 2020-05-14 12:29:52 +02:00
h1f0x b3fef625a8 Fixed Calibur views: series, authors, publishers, ratings, file formats, detail view 2020-05-14 11:57:38 +02:00
Ozzieisaacs 13994a5f96 Merge branch 'master' into Develop 2020-05-13 20:16:29 +02:00
Ozzieisaacs e8ac62cdd8 Moved password replace to prevent incomplete session 2020-05-13 20:15:35 +02:00
Ozzieisaacs 1bc7134ec2 Fix error 500 on reset password in debug mode 2020-05-13 20:04:43 +02:00
Ozzieisaacs 273572f44c Merge branch 'master' into Develop
# Conflicts:
#	cps/ub.py
2020-05-13 20:03:54 +02:00
Ozzieisaacs ac37483d47 Fix for #1391 (kobo sync errors out if read/unread books had been present in app.db during initial database migration) 2020-05-13 19:43:14 +02:00
Ozzieisaacs 0cc2b49296 Merge branch 'master' into Develop
# Conflicts:
#	cps/templates/book_edit.html
2020-05-12 19:10:19 +02:00
Ozzieisaacs 44d5adc16f Fix #1390 2020-05-12 19:08:51 +02:00
Ozzieisaacs f749fc641b Temporary fix for #1390 2020-05-12 17:42:24 +02:00
Ozzieisaacs 87c76c09e2 temporary fix for #1390 2020-05-12 17:41:49 +02:00
Ozzieisaacs e787f9dd9f Automatic username (#1172) 2020-05-12 17:23:58 +02:00
Ozzieisaacs ec7d5b17ab Added table view for books 2020-05-12 16:32:26 +02:00
Ozzieisaacs 47641eee59 Merge branch 'master' into Develop 2020-05-12 16:16:04 +02:00
Ozzieisaacs 42abe28cc1 Fix for #1389 (import ldap users with whitespaces) 2020-05-12 16:13:56 +02:00
Ozzieisaacs b48afa38ac Fix #1386 (Add asin to recognized identifiers) 2020-05-12 14:44:57 +02:00
Ozzieisaacs f7269d8df2 Fix for #1385 (Private shelves are listed twice in the "Add to shelf" dropdown menu) 2020-05-12 14:39:13 +02:00
Ozzieisaacs ce0fab8d2f Fix duplicate shelf names in "search" 2020-05-12 14:37:13 +02:00
Ozzieisaacs 33472567de Improved Debug output on send email 2020-05-11 19:28:22 +02:00
Ozzieisaacs f5e12328dc Fix for #1382 (Restrictions with "&" in it can't be deleted) 2020-05-11 18:41:34 +02:00
Ozzieisaacs 486c0f2937 Fix for #1382 (Restrictions with "&" in it can't be deleted) 2020-05-11 18:41:16 +02:00
jvoisin e69c4cd1dc Refactor a bit cps/uploader.py 2020-05-11 13:15:30 +02:00
Marcel e0d3ccd8d1
Update messages.po 2020-05-10 21:05:39 +02:00
Ozzieisaacs 16a3deec2c Merge branch 'master' into Develop
# Conflicts:
#	cps/helper.py
2020-05-10 19:24:55 +02:00
OzzieIsaacs 92db00692a Merge all headers to download response
Updated test results
2020-05-10 14:58:18 +02:00
OzzieIsaacs fe88010a72 Merge remote-tracking branch 'sec_fixes/minor_fix_caliblur' 2020-05-10 14:57:19 +02:00
OzzieIsaacs 99ae4be2c2 Merge remote-tracking branch 'sec_fixes/bump_jquery' 2020-05-10 10:43:20 +02:00
OzzieIsaacs a9085752c1 Fix error "email" not in to_save 2020-05-10 10:26:22 +02:00
OzzieIsaacs e1fbc9255c Merge remote-tracking branch 'sec_fixes/bump_underscore' 2020-05-10 10:26:01 +02:00
OzzieIsaacs f33e25ac40 Merge remote-tracking branch 'sec_fixes/cookies_improvement' 2020-05-10 10:22:21 +02:00
OzzieIsaacs 51365ab006 Merge remote-tracking branch 'sec_fixes/strong_session_protection' 2020-05-10 10:21:19 +02:00
OzzieIsaacs d61b7e48d7 Merge remote-tracking branch 'sec_fixes/random_password' 2020-05-10 10:18:40 +02:00
OzzieIsaacs f590b24f85 Merge remote-tracking branch 'sec_fixes/https' 2020-05-10 10:17:36 +02:00
Ozzieisaacs 308fd55483 #1141 (Setting for file size limit on email) 2020-05-09 20:29:17 +02:00
Ozzieisaacs fefb44e612 #1356 (fixes for readonly metadata.db)
Fix remove trailing metadata.db at entering calibre_db_path
2020-05-09 19:54:28 +02:00
jvoisin dd3b562f1a Change some links from http to https 2020-05-09 17:11:56 +02:00
jvoisin 30c9aa3df9 Minor fixes to caliBlur.js
- Add alt attributes to images
- Fix a broken tag
2020-05-09 17:07:22 +02:00
jvoisin 688184e255 Bump jquery 2020-05-09 17:00:03 +02:00
Ozzieisaacs 75fb7c2e95 Allowing upload extensions (#1119) 2020-05-09 16:54:22 +02:00
jvoisin 264b4b669e Bump underscorejs version from 1.9.1 to 1.12.2 2020-05-09 16:54:21 +02:00
Ozzieisaacs 51f12c51ad Fix #1361 (covers of archived books not shown) 2020-05-09 16:37:02 +02:00
Ozzieisaacs 03d134697c Fix #1361 (covers of archived books not shown) 2020-05-09 16:36:08 +02:00
Ozzie Isaacs e706e1a68d
Update CONTRIBUTING.md 2020-05-09 16:15:52 +02:00
Ozzieisaacs ff3f42db95 Fix #1364 (translated format identifier)
Updated french Translation
2020-05-09 16:12:55 +02:00
Ozzieisaacs e8aedeac36 Refactored admin.py 2020-05-09 16:00:31 +02:00
Ozzie Isaacs 2bf6b263ed
correction of contribution guideline 2020-05-09 15:58:10 +02:00
jvoisin bf166b757a Improve a bit the cookie's hardening
- Samesite for session cookies as well as the remember me ones
- Httponly
2020-05-09 14:42:28 +02:00
jvoisin b4165335a7 Use strong sessions protection
See https://flask-login.readthedocs.io/en/latest/#session-protection for
details
2020-05-09 14:34:14 +02:00
jvoisin 2a1bf2fa71 Generate strong random passwords 2020-05-09 14:24:20 +02:00
Ozzieisaacs 718d50a037 Starting again without traceback (moved gdriveutil import) 2020-05-09 12:17:28 +02:00
Ozzieisaacs 41960ada4a Autodetect binaries 2020-05-09 11:04:35 +02:00
Ozzieisaacs 0a02caad04 Improvements 2020-05-09 11:01:00 +02:00
Ozzieisaacs ff75bdba9e Merge branch 'master' into Develop 2020-05-08 19:05:08 +02:00
Ozzieisaacs 189243a9b0 Merge remote-tracking branch 'publisher_sort/patch-1' 2020-05-08 15:04:45 +02:00
Ozzieisaacs 34e339c506 Merge remote-tracking branch 'it/patch-12' 2020-05-08 14:59:51 +02:00
Ozzieisaacs a437c603c6 Merge remote-tracking branch 'kepubify/Develop' into Develop
# Conflicts:
#	cps/admin.py
#	cps/helper.py
#	cps/templates/config_edit.html
#	cps/web.py
2020-05-08 14:53:21 +02:00
Ozzieisaacs 4e940f7fa0 Added response header for improving security 2020-05-08 14:49:12 +02:00
Knepherbird 69fde7dead
Update web.py
Set db.Publishers query to order by name column, because publishers.sort column is empty.
2020-05-07 13:55:59 -07:00
Ozzieisaacs 4368c182a0 Make goodreads compatible for betterreads dependency 2020-05-06 20:57:54 +02:00
Ozzieisaacs 48f4b12c0e Merge branch 'master' into Develop
# Conflicts:
#	cps/editbooks.py
2020-05-06 18:47:33 +02:00
Ozzieisaacs 6a6c1b6b21 Fix for #1358, #1355 2020-05-06 16:25:03 +02:00
Ozzieisaacs 51808d2ad4 Version Bump 2020-05-05 20:31:12 +02:00
Ozzieisaacs 0735fb1e92 Fix #1349 (Fix error on move cover with foreign file systems, e.g. samba shares)
Preparation for release
2020-05-05 20:28:10 +02:00
Ozzieisaacs 850a85915b Fix #1354 (Error on uploading single book, because of missing rarfile) 2020-05-05 18:48:40 +02:00
ElQuimm 148f1109c6
updated messages.po
just a little update for coherence with Read/da leggere -> Archived/da archiviare.
Sorry :-)
2020-05-04 20:56:58 +02:00
Ozzieisaacs fcbeeca305 Merge remote-tracking branch 'it/patch-11' 2020-05-04 20:21:05 +02:00
Ozzieisaacs fb16429867 Randomize flask secret_key 2020-05-04 19:02:03 +02:00
Ozzieisaacs e1439b529b Config Options for limiting email size, change username to e-mail adress, use kepubify
Added work on Unrar5 decompression (breaks comic reader totally)
2020-05-04 18:19:30 +02:00
ElQuimm db38d7ee78
Updated version of italian.po
:-)
2020-05-03 21:30:06 +02:00
Ozzieisaacs 0adcd1b3d9 UI Improvements
Added additional restrictions to Calibre DB interface
2020-05-03 10:55:33 +02:00
OzzieIsaacs 36a984ce3c Revert proxyfix 2020-05-02 18:17:52 +02:00
Ozzieisaacs fcefd8031a Fix #985 (png and webp are extracted as cover files from comic files) 2020-05-02 11:24:30 +02:00
Ozzieisaacs 64bebaa1d1 Update Upload formats 2020-05-02 10:46:00 +02:00
Ozzieisaacs 0138ff9e16 Added additional config options 2020-05-02 10:18:01 +02:00
Ozzieisaacs 9bc085a23e Fixes for comic reader 2020-05-02 09:35:14 +02:00
Ozzieisaacs 1ce432b136 Merge remote-tracking branch 'kobo/fix_covers_merge' 2020-05-02 09:34:24 +02:00
Michael Shavit e0fbfa44a4 Fix issue with cover images introduced during the merge of #1277. 2020-05-02 01:55:14 -04:00
Ozzieisaacs 0a92d79ec0 Merge remote-tracking branch 'cover-series/feature/add-cover-serie-view' into Develop
# Conflicts:
#	cps/static/css/style.css
#	cps/ub.py
#	cps/web.py
2020-05-01 17:25:13 +02:00
Ozzieisaacs b95f6563cc Merge remote-tracking branch 'read-config/remove-duplicate-read-status-without-filter' into Develop 2020-05-01 17:19:13 +02:00
Ozzieisaacs 547bbecef1 Merge branch 'master' into Develop 2020-05-01 17:16:28 +02:00
Ozzieisaacs 700cb3b553 Merge remote-tracking branch 'NL/master'
Updated all strings
2020-05-01 17:15:59 +02:00
Ozzieisaacs 8646f8f23a Merge branch 'Develop'
# Conflicts:
#	cps/__init__.py
2020-05-01 14:51:54 +02:00
OzzieIsaacs 99cc69c67d Update Teststatus 2020-05-01 14:38:54 +02:00
OzzieIsaacs 2c5d76908a Added missing upload format 2020-05-01 13:34:16 +02:00
Ozzieisaacs 832b34fc54 Improved errorhandling for resending password
Improved errorhandling for editing user
2020-05-01 12:00:45 +02:00
Ozzieisaacs 000b85ff81 Fixes for deleting books(error handling and user feedback) 2020-05-01 10:26:35 +02:00
Ozzieisaacs bb317d54f2 Fix reject reset password without configured email server 2020-05-01 08:37:54 +02:00
Ozzieisaacs d6f41d8dc0 Fix error 404 on reset password (Fix #1342) 2020-05-01 08:33:50 +02:00
Marcel 6dff5ed679
NL language update 2020-04-30 21:30:50 +02:00
OzzieIsaacs fb8b6310d5 Fix from tests 2020-04-30 20:58:01 +02:00
Ozzieisaacs 02aaf17ac5 Fix #1339 (Proxyfix import with old werkzeug versions causes traceback) 2020-04-30 19:21:08 +02:00
Ozzieisaacs b160a8de0b Merge branch 'master' into Develop
# Conflicts:
#	cps/__init__.py
#	cps/comic.py
#	cps/editbooks.py
#	cps/helper.py
#	cps/kobo.py
#	cps/translations/nl/LC_MESSAGES/messages.mo
#	cps/translations/nl/LC_MESSAGES/messages.po
#	cps/ub.py
#	cps/uploader.py
#	cps/web.py
2020-04-30 18:08:28 +02:00
Ozzieisaacs e3246fd751 Merge remote-tracking branch 'key' 2020-04-30 17:29:41 +02:00
Ozzieisaacs 91b1775f50 Fix #1225 (Unrar binary added, cover files from cbr files can be extracted) 2020-04-29 19:02:35 +02:00
Ozzieisaacs fb18ab1ca5 Fix #866 (Recent book sidebar element can't be removed anymore) 2020-04-29 18:57:39 +02:00
Ozzieisaacs 01ff55c84e Removed non working filters for search 2020-04-29 17:57:53 +02:00
jvoisin 523aab2e9e Don't use an hardcoded session key
This fixes a trivial authentication bypass,
according to https://flask.palletsprojects.com/en/1.1.x/quickstart/#sessions
2020-04-29 13:59:34 +02:00
Ozzieisaacs 9a7d9da654 Merge remote-tracking branch 'js_caliblur/xss' 2020-04-29 12:08:51 +02:00
Ozzieisaacs e9446556a1 Merge remote-tracking branch 'ru/master' 2020-04-29 12:06:35 +02:00
jvoisin 806a5f209f Fix two minor xss 2020-04-29 11:33:33 +02:00
ZIzA c864b368b0
Russian language update 2020-04-29 01:30:14 +04:00
Ozzieisaacs 27eb09fb19 Add unrar Support 2020-04-28 20:23:39 +02:00
Ozzieisaacs bea7223a0a Renabled cbrimage extraction (via unrar and rarfile) 2020-04-28 16:50:08 +02:00
Ozzieisaacs 0297823bda Merge remote-tracking branch 'codecosmetic/move_var' 2020-04-28 15:33:25 +02:00
Ozzieisaacs d1bce5c2d9 Update nl translation from development branch 2020-04-27 21:15:19 +02:00
Ozzieisaacs 46c0ae3ccc Revert accidently deleted nl translation strings 2020-04-27 21:11:43 +02:00
Ozzieisaacs ce6b689147 Code cosmetics 2020-04-27 20:22:55 +02:00
Ozzieisaacs 2d92818613 Code cosmetics 2020-04-27 20:01:13 +02:00
jvoisin 487878819e Move a few variables around
This should prevent a couple of crashes
due to undeclared variables.
2020-04-27 12:03:54 +02:00
Ozzieisaacs 6682b1ced1 Fix download of book covers with enabled pillow from url 2020-04-26 21:00:29 +02:00
Ozzieisaacs bc89b0658a Fix deletion of books with multiple custom column links
Fix delete of author-folder in case last book of author was deleted (#1269)
2020-04-26 20:44:37 +02:00
Ozzieisaacs d9dde36c74 Merge remote-tracking branch 'improve_read/sort-book-name' search results are ordered according to sort field in book title 2020-04-26 19:00:36 +02:00
Ozzieisaacs 44284ea5fb Merge remote-tracking branch 'opds/master'
# Conflicts:
#	cps/translations/cs/LC_MESSAGES/messages.po
#	cps/translations/de/LC_MESSAGES/messages.po
#	cps/translations/es/LC_MESSAGES/messages.po
#	cps/translations/fi/LC_MESSAGES/messages.po
#	cps/translations/fr/LC_MESSAGES/messages.po
#	cps/translations/hu/LC_MESSAGES/messages.po
#	cps/translations/it/LC_MESSAGES/messages.po
#	cps/translations/ja/LC_MESSAGES/messages.po
#	cps/translations/km/LC_MESSAGES/messages.po
#	cps/translations/nl/LC_MESSAGES/messages.po
#	cps/translations/pl/LC_MESSAGES/messages.po
#	cps/translations/ru/LC_MESSAGES/messages.po
#	cps/translations/sv/LC_MESSAGES/messages.po
#	cps/translations/uk/LC_MESSAGES/messages.po
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
#	messages.pot
2020-04-26 18:55:23 +02:00
Ozzieisaacs 9f0c0b34af Merge remote-tracking branch 'order_category/master' 2020-04-26 18:50:28 +02:00
Ozzieisaacs 87ec44aed5 Merge remote-tracking branch 'improve_reaad/keep-focus-on-search-input' 2020-04-26 18:38:09 +02:00
Ozzieisaacs 898e6b4f80 Calibre-Web is rebooted everytime login type ic shanged (from and to standard authentication and between login methods) 2020-04-26 18:24:22 +02:00
Ozzieisaacs dea2600913 Merge remote-tracking branch 'oauth/patch-2' Fix oauth in combination with nginx reverse proxy 2020-04-26 18:23:16 +02:00
Ozzieisaacs dc46ad16ae Bugfix view shelfs on book detail page 2020-04-26 11:35:47 +02:00
Ozzieisaacs 456550a943 Bugfix view shelfs on detiled page
bugfix datetime in archive mode
2020-04-26 11:34:10 +02:00
Ozzieisaacs 7b789b3701 Fix opds with shelves
Fix errorhandler ldap without ldap
2020-04-26 08:40:53 +02:00
Ozzieisaacs 0480d493cf Fix opds login with ldap, if ldap server is down 2020-04-25 21:12:07 +02:00
Ozzieisaacs b4d7733e0a Merge branch 'master' into Develop
# Conflicts:
#	cps/templates/list.html
#	cps/translations/cs/LC_MESSAGES/messages.po
#	cps/translations/de/LC_MESSAGES/messages.po
#	cps/translations/es/LC_MESSAGES/messages.po
#	cps/translations/fi/LC_MESSAGES/messages.po
#	cps/translations/fr/LC_MESSAGES/messages.po
#	cps/translations/hu/LC_MESSAGES/messages.po
#	cps/translations/it/LC_MESSAGES/messages.po
#	cps/translations/ja/LC_MESSAGES/messages.po
#	cps/translations/km/LC_MESSAGES/messages.po
#	cps/translations/nl/LC_MESSAGES/messages.po
#	cps/translations/pl/LC_MESSAGES/messages.po
#	cps/translations/ru/LC_MESSAGES/messages.po
#	cps/translations/sv/LC_MESSAGES/messages.po
#	cps/translations/uk/LC_MESSAGES/messages.po
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
#	messages.pot
2020-04-25 20:06:25 +02:00
Ozzieisaacs 8b8fe7a0ae bugfix on create shelv via kobo sync protocol
bugfix for totally wrong json requests
prevent empty shelf names on kobo create shelf
Removed errorhandler 404
2020-04-25 20:02:55 +02:00
Ozzie Isaacs 85ffc90f66
Update markup 2020-04-25 08:56:51 +02:00
Ozzieisaacs fa38798066 Added contributing file 2020-04-25 08:55:01 +02:00
Ozzieisaacs d657330584 Fix for removing admin role from last admin user (in addition to prevent delete of last admin user) #1326 2020-04-25 07:13:55 +02:00
Ozzieisaacs 36cb79de62 Merge remote-tracking branch 'turkish/master' 2020-04-24 22:14:57 +02:00
Ozzieisaacs 063ee5e855 Merge remote-tracking branch 'remove_usage_local_var_undeclared'
Code cosmetics
2020-04-24 21:05:56 +02:00
Ozzieisaacs 7393b69757 Fix for #1326 (typo) 2020-04-24 19:25:11 +02:00
Ozzieisaacs 8bd1903d98 Fix for #1326 (opds feed user login not working -> download was not possible) 2020-04-24 18:37:29 +02:00
jvoisin d8bf540db2 Remove an undeclared and useless local variable 2020-04-24 18:04:27 +02:00
Ozzieisaacs e29f17ac46 Merge remote-tracking branch 'kobo/shelves' into Develop
# Conflicts:
#	cps/kobo.py
#	cps/shelf.py
2020-04-24 16:56:08 +02:00
iz 1770f3fd0d Update turkish translation headers 2020-04-23 22:47:24 +03:00
iz 4239f2ed71 Add turkish translation 2020-04-23 22:37:44 +03:00
iz 3939ec28ba Add turkish language names 2020-04-23 22:37:35 +03:00
Michael Shavit 742ec2b38d Fix issue with the delete_book changes introduced in
41a3623
2020-04-22 00:19:33 -04:00
Michael Shavit 9296d35517 Fix bug with shelf deletions for Kobo.
We were incorrectly setting the user_id field in the ShelfArchive table
2020-04-21 23:57:20 -04:00
Michael Shavit 06c15a792e Minor fixes to the Kobo shelves implementation (mostly typos) 2020-04-21 23:36:47 -04:00
Ozzieisaacs 95ca1e6a9d Fix for #1319 2020-04-20 18:56:39 +02:00
Ozzieisaacs 1df82110d1 Update Italian language translation 2020-04-19 19:13:10 +02:00
Ozzieisaacs 24c743d23d Code cosmetics 2020-04-19 19:08:58 +02:00
ElQuimm f1b1ebe29e
Updated italian version of messages.po 2020-04-19 16:38:30 +02:00
Jeff 6384cdc74d
Fix https github oauth
while using https domian and nginx as proxy, a `ProxyFix` is required.
2020-04-19 19:53:41 +08:00
celogeek d093fbb069
Keep previous search value and focus 2020-04-19 13:12:02 +02:00
celogeek f9b4505843
Sort search result by Books sort
It is far easier to search for a
series or anything and see
books in sort order
2020-04-19 13:03:46 +02:00
celogeek ca2bcc647d
Handle read config
Allow advance search
Remove duplicate status on show
2020-04-19 12:50:58 +02:00
pthiben b90048d72e fix badge color on grid view to match list view 2020-04-18 23:41:01 -04:00
pthiben a5fe08e84c Fix button color that now matches HEAD on master
Update name for HTML Series that changed with HEAD
2020-04-18 23:32:15 -04:00
pthiben 2874cf531c Merge remote-tracking branch 'origin/feature/add-cover-serie-view' into feature/add-cover-serie-view
# Conflicts:
#	cps/ub.py
#	cps/web.py
2020-04-18 23:27:56 -04:00
pthiben ea7058e896 Update button lables: it seems strange to click on 'Grid' to get the list view and vice versa 2020-04-18 23:23:56 -04:00
pthiben 38bb10d36b apply suggestion from @OzzieIsaacs that fixes sorting with caliblur theme.
@OzzieIsaacs : I have no idea what the consequences are about this CSS style change. I played around in caliblur and did not notice anything weird, but I'm no calibre-web hardcore user
2020-04-18 23:23:56 -04:00
pthiben 58943bb156 update filtering so that it also uses isotope everywhere.
Fix asc/desc that did not match list view
2020-04-18 23:23:56 -04:00
pthiben 2d66da3cb9 restrict button for grid<->list switch to series lists 2020-04-18 23:23:56 -04:00
pthiben b7efbf9040 resynced grid view with list view
Changed drop-down menu to button, with same style as the other buttons. I'll probably have to make a last sync with master for final approval
2020-04-18 23:23:56 -04:00
pthiben 5222e157cb fix standard theme badges so that they stand on top left corner instead of top right: each element's width in the list seems to be double the size of the image, so right alignment gets tricky. https://github.com/janeczku/calibre-web/pull/986#issuecomment-517999218 suggests top-left alignment which does make a lot of sense. Using this for now. Maintainer might have a better idea to fix it 2020-04-18 23:23:55 -04:00
pthiben 1e3a948977 fix linter errors
Fix the sorting
Save the sorting state
Remove unnecessary filter
Add support for grid view
2020-04-18 23:22:51 -04:00
pthiben 20cc5107da Update button lables: it seems strange to click on 'Grid' to get the list view and vice versa 2020-04-18 22:57:25 -04:00
pthiben a6a4d5f09b apply suggestion from @OzzieIsaacs that fixes sorting with caliblur theme.
@OzzieIsaacs : I have no idea what the consequences are about this CSS style change. I played around in caliblur and did not notice anything weird, but I'm no calibre-web hardcore user
2020-04-18 22:56:24 -04:00
pthiben 028c53287d update filtering so that it also uses isotope everywhere.
Fix asc/desc that did not match list view
2020-04-18 22:54:58 -04:00
pthiben 24a9bea137 restrict button for grid<->list switch to series lists 2020-04-18 22:16:49 -04:00
pthiben ef1a2d1730 resynced grid view with list view
Changed drop-down menu to button, with same style as the other buttons. I'll probably have to make a last sync with master for final approval
2020-04-18 22:10:21 -04:00
pthiben 6abff36e07 fix standard theme badges so that they stand on top left corner instead of top right: each element's width in the list seems to be double the size of the image, so right alignment gets tricky. https://github.com/janeczku/calibre-web/pull/986#issuecomment-517999218 suggests top-left alignment which does make a lot of sense. Using this for now. Maintainer might have a better idea to fix it 2020-04-18 20:36:27 -04:00
Ozzieisaacs 902685a197 Fix text in user config section (random books in Detail View) 2020-04-18 21:30:28 +02:00
Ozzieisaacs c04b146486 Fix #1309 (fix duplicate shelf names in book detail view) 2020-04-18 21:15:02 +02:00
Ozzieisaacs 7bb5afa585 Merge remote-tracking branch 'kobo/shelves' into Develop 2020-04-18 21:12:21 +02:00
Ozzieisaacs 06fde4fcd0 Fix #1311 (Enable LDAP Anonymous Login) 2020-04-18 11:48:34 +02:00
Ozzieisaacs 195845ab0c Fix 2020-04-17 18:17:35 +02:00
Ozzieisaacs 81a329f1e7 Fix for #1087 ( Caliblur! Theme button alignment) 2020-04-17 18:16:28 +02:00
OzzieIsaacs cd6272a1c9 Update teststatus 2020-04-16 22:00:39 +02:00
Ozzieisaacs 53be752787 Merge remote-tracking branch 'it/patch-10' 2020-04-16 20:17:02 +02:00
Ozzieisaacs 42ac06c114 Merge remote-tracking branch 'nl/Develop' into Develop 2020-04-16 20:14:56 +02:00
Ozzieisaacs 9e159ed5ab Merge branch 'master' into Develop
# Conflicts:
#	cps/config_sql.py
#	cps/ub.py
#	cps/web.py
2020-04-16 20:12:27 +02:00
Ozzieisaacs 2c42972230 Fix for #1307 (Oauth login not working)
- Changed blueprint reference in Backend from name to id, users can now again be found
- Depending on version of flask-dance the resultcode of authorized is set different to prevent redirect loop with newer versions(>1.3)
- Redirect to login page in case no user is linked to current oauth account
- Flash messages upon successfull login, successsfull linked account
2020-04-16 17:58:42 +02:00
aribes f926e58891 Changing ordering logic when showing books from a category 2020-04-16 11:37:04 +10:00
Ozzieisaacs a784c6bd52 Fixes for oauth login after programming basic tests 2020-04-15 22:03:21 +02:00
ElQuimm 05d78f5cb5
Update italian version of message.po
Have a nice day!
2020-04-15 10:59:08 +02:00
pthiben 4ef7615d88 Merge remote-tracking branch 'origin/feature/add-cover-serie-view' into feature/add-cover-serie-view
# Conflicts:
#	cps/ub.py
2020-04-14 14:53:23 -04:00
pthiben 77c2783a3e fix linter errors
Fix the sorting
Save the sorting state
Remove unnecessary filter
Add support for grid view
2020-04-14 14:48:06 -04:00
Ozzieisaacs ce4f1258b5 Fix #1293 (error 500 on search without query) 2020-04-14 19:27:18 +02:00
Ozzieisaacs 3fbaba6693 Fix #1307 2020-04-14 18:28:16 +02:00
Ozzieisaacs a8b36aed92 Temporary fix for #1307 2020-04-14 14:13:54 +02:00
Ozzieisaacs 4749eccfa5 Added fix for python2 regex
Fix for python2 attributeError instead of TypeError on login with wrong openLDAP setting
Added default empty string on LDAPCertificate
Fix ldap as scheme for tls connection
Enabled add user on LDAP Authentication
LDAP config port is now number input
Added header for user import config
Added python ldap version to about section
Fix: It's no longer possible to login via fallback password as long as LDAP server is available
Fix: TypeError on bind is now catched and transformed to error message
Update Readme
Fixes for ldap
2020-04-14 10:58:32 +02:00
pthiben 5b1dfc123f fix linter errors
Fix the sorting
Save the sorting state
Remove unnecessary filter
Add support for grid view
2020-04-13 17:27:14 -04:00
Michael Shavit 41a3623fcc [Kobo] Add Shelf/Collection support.
Implements the v1/library/tags set of endpoints to sync CalibreWeb
shelves with the Kobo device.
Drive-by: Refactors shelf.py to consolidate how user permissions are checked.
Drive-by: Fix issue with the sync endpoint that arrises when a book is
hard-deleted.
2020-04-12 22:29:20 -04:00
Marcel 296ac203d4
Update messages.po 2020-04-11 12:32:37 +02:00
xcffl 0c9436ca82 Regenerate translation files 2020-04-11 00:06:56 +08:00
xcffl 70c9dd1b95 Fix opds format errors & extend info 2020-04-11 00:06:50 +08:00
xcffl 80753b1115 Add vscode configs into .gitignore. 2020-04-08 23:01:57 +08:00
Ozzieisaacs a194216568 Merge remote-tracking branch 'origin/master' 2020-04-05 19:10:27 +02:00
Ozzieisaacs 8bee424cc0 Merge remote-tracking branch 'ldap/master'
# Conflicts:
#	cps/admin.py
#	cps/templates/admin.html
#	cps/templates/config_edit.html
#	cps/web.py
2020-04-05 17:31:41 +02:00
Ozzie Isaacs 25ab3cabfe
Add question for logfile to Issue Template 2020-04-04 18:28:43 +02:00
Ozzieisaacs 587174b771 Fix #1272 2020-04-04 08:53:22 +02:00
Ozzieisaacs 3e1c34efe6 Merge remote-tracking branch 'fix/fix_covers' into Develop 2020-04-04 06:57:54 +02:00
Ozzieisaacs 5864637f1c Merge branch 'master' into Develop 2020-04-04 06:22:17 +02:00
Ozzieisaacs ec6b346ca1 Update Translation 2020-04-03 19:50:29 +02:00
Ozzieisaacs e99f5bcced Merge remote-tracking branch 'english/master' 2020-04-03 19:46:26 +02:00
Ozzieisaacs b89309ab82 Merge remote-tracking branch 'po/master' 2020-04-03 19:27:10 +02:00
OzzieIsaacs 2d230ec96a Updated Teststatus 2020-04-02 21:13:43 +02:00
Ozzieisaacs 4550333f1e Added redirect after create shelf 2020-04-02 20:19:05 +02:00
Ozzieisaacs 3ba610eb64 Revert accidentally committed changes in opds feed 2020-04-02 19:07:41 +02:00
Ozzieisaacs 2436c6a118 Merge remote-tracking branch 'caliblur/master' 2020-04-02 18:27:21 +02:00
Ozzieisaacs 4de80b26c1 Merge remote-tracking branch 'public_shelf/calibre-web_645'
# Conflicts:
#	cps/templates/feed.xml
#	cps/templates/layout.html
2020-04-02 18:24:32 +02:00
Ozzieisaacs bab14a1fbf Update shelfs handling, bugfix changed updater 2020-04-02 18:23:24 +02:00
Ozzieisaacs 0c27ff11b9 Update Updater 2020-04-01 18:45:16 +02:00
BeckyDTP 734e2ffbb2 Updated Polish translations 2020-03-31 21:53:13 +02:00
hexeth da42c51af2 Updated to exclude new modules 2020-03-31 08:42:08 -07:00
Michael Shavit 7cb6801241 Fix issue with cover images. 2020-03-30 02:17:08 -04:00
Ozzieisaacs f6c04b9b84 Merge branch 'master' into Develop 2020-03-29 16:48:56 +02:00
Ozzieisaacs 4eacb21259 Update updater
Update change logfile
code cosmetics js files
2020-03-29 16:44:24 +02:00
Ozzie Isaacs 6d1a3ccdcc Improve logger for windows 2020-03-28 07:13:51 +01:00
Josh O'Brien c870f6e87d English Language V2 2020-03-19 13:10:10 +11:00
Ozzieisaacs 6d907094d7 Update Readme 2020-03-14 11:22:27 +01:00
Ozzieisaacs 6643f0d1e0 Merge remote-tracking branch 'nl/master'
# Conflicts:
#	cps/translations/nl/LC_MESSAGES/messages.mo
#	cps/translations/nl/LC_MESSAGES/messages.po
2020-03-14 10:45:58 +01:00
Ozzieisaacs 20b07e0752 Merge remote-tracking branch 'sv/master'
# Conflicts:
#	cps/translations/sv/LC_MESSAGES/messages.mo
#	cps/translations/sv/LC_MESSAGES/messages.po
2020-03-14 10:39:27 +01:00
Ozzieisaacs 092423adc7 Merge remote-tracking branch 'sv/master'
# Conflicts:
#	cps/translations/sv/LC_MESSAGES/messages.mo
#	cps/translations/sv/LC_MESSAGES/messages.po
2020-03-14 10:38:50 +01:00
Ozzieisaacs a50ca1a85f Fix #1259 2020-03-14 10:35:58 +01:00
Jony 02199c8c1d
Update messages.po (Swedish)
Update Swedish translation
2020-03-14 09:32:33 +01:00
Jony c166c92685
Merge pull request #3 from janeczku/master
Update fork
2020-03-14 09:31:29 +01:00
Ozzieisaacs f243515261 Fix #950 (sorting order in comics) 2020-03-14 07:15:15 +01:00
Ozzieisaacs 98181fe21c Merge remote-tracking branch 'fix/kobo_book_delete' into Develop 2020-03-13 17:00:38 +01:00
Unknown a26ce8d8b5 Updated & corrected Dutch translations
Un-wonky-fied some literal translations, corrected contexts an respected punctuations, whitespaces, etc.....

See https://github.com/janeczku/calibre-web/issues/606#issuecomment-595913808
2020-03-13 14:01:42 +01:00
Michael Shavit de0e27c512 Fix #1164 merge. 2020-03-12 20:09:26 -04:00
Ozzieisaacs 09e7d76c6f Merge remote-tracking branch 'kobo_book_delete' into Develop
# Conflicts:
#	cps/kobo.py
#	cps/services/SyncToken.py
#	cps/templates/book_edit.html
#	cps/ub.py
2020-03-12 20:43:39 +01:00
Ozzieisaacs d597e05fa9 Merge remote-tracking branch 'reading_state' into Develop
# Conflicts:
#	cps/kobo.py
2020-03-12 20:35:24 +01:00
Ozzieisaacs 98dc991339 Merge remote-tracking branch 'more_kobo_fixes' into Develop 2020-03-12 20:33:22 +01:00
Ozzieisaacs 1d40434d2b Merge remote-tracking branch 'it/patch-9' 2020-03-12 20:32:08 +01:00
Ozzieisaacs 46b87dc7eb Fix for testability of kobo 2020-03-09 20:25:59 +01:00
ElQuimm fe7c56d269
italian updated version of messages.po
09.03.2020
2020-03-09 09:11:41 +01:00
OzzieIsaacs 5ba4801a79 Updated test result 2020-03-08 08:02:15 +01:00
Michael Shavit ad564e25ca More fixes for Kobo Sync
- Fix incorrect maintenance of the Synctoken timestamps.
- Fix issue where the SyncToken isn't included in the response when
kobo_proxying is disabled.
2020-03-08 01:20:54 -05:00
Ozzieisaacs 404be948d4 Merge remote-tracking branch 'ldap/Develop' into Develop
# Conflicts:
#	cps/admin.py
#	cps/web.py
2020-03-07 13:39:47 +01:00
Ozzieisaacs 8cbc345f36 Merge remote-tracking branch 'identifier/develop/edit_identifiers' into Develop 2020-03-07 13:35:58 +01:00
Ozzieisaacs 89927fd7e9 Merge ComicVine API 2020-03-07 13:33:35 +01:00
Ozzieisaacs 6b4a024234 Merge branch 'master' into Develop 2020-03-07 12:47:38 +01:00
Ozzieisaacs 18794831e0 Chang link to issue template 2020-03-07 11:27:50 +01:00
Ozzieisaacs 3fb851304f Merge remote-tracking branch 'ru/master' 2020-03-07 11:21:10 +01:00
Ozzieisaacs d267338837 Fixes for Kobo sync
Better output on upload cover
Fix for download after access to opds/fileformat
Fix osd search link
Added ratings to opds feed
Change for kobo sync for testing
2020-03-07 11:07:43 +01:00
Michael Shavit 8e1641dac9 Add support for syncing Kobo reading state. 2020-03-01 22:01:05 -05:00
Michael Shavit 57d37ffba8 Add schema support for more reading states to the ReadBook table. 2020-03-01 20:26:42 -05:00
ZIzA 82afa81220
up 2020-02-29 20:41:51 +04:00
ZIzA d730eb8d31
fix 2020-02-29 20:26:52 +04:00
ZIzA 5a219b580f
ru update 2020-02-29 19:10:01 +04:00
Ozzieisaacs fb83bfb363 Fix for #1223 (pdf-reader isn't working on chrome, IE, Edge) 2020-02-29 09:55:54 +01:00
Ozzie Isaacs df7d3d18b6 pdf reader 2020-02-29 08:33:09 +01:00
Wanoo a0535aa3db Add ComicVine Api
Fetching Metadata for comicBook with ComicVine API
2020-02-28 16:04:07 +01:00
Ozzieisaacs 202b6121ab Fix for #1227 (Download books not possible with gevent IPV6 connection)
Fix issue where books aren't correctly ordered by Date Added
2020-02-26 20:05:44 +01:00
Ozzieisaacs 4e8b814ec2 Fix download URL for IPV6 2020-02-26 20:04:15 +01:00
Ozzieisaacs 6becca17bf Merge remote-tracking branch 'fix/fix_time' into Develop 2020-02-26 18:09:01 +01:00
Ozzieisaacs c8b64d4162 Update chinese translation Merge remote-tracking branch 'cn/patch-1' 2020-02-26 18:03:26 +01:00
Jeff 0854303710
Update Chinese translation 2020-02-26 19:47:25 +08:00
Michael Shavit cba3e62e71 Fix issue where books weren't correctly ordered by Date added on the
Kobo device.
2020-02-26 01:06:03 -05:00
Ozzieisaacs dcba720e97 Merge remote-tracking branch 'restrict/patch-1' 2020-02-25 16:06:24 +01:00
Rewerson 6c614c06f6
restricted_tags -> denied_tags
Fix for the next error after update:
Traceback (most recent call last):
  File "cps.py", line 34, in <module>
    from cps import create_app
  File "/home/rewerson/lib/web/cps/__init__.py", line 68, in <module>
    config = config_sql.load_configuration(ub.session)
  File "/home/rewerson/lib/web/cps/config_sql.py", line 348, in load_configuration
    update({"restricted_tags": conf.config_mature_content_tags}, synchronize_session=False)
  File "/home/rewerson/.local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 3862, in update
    update_op.exec_()
  File "/home/rewerson/.local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1693, in exec_
    self._do_exec()
  File "/home/rewerson/.local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1874, in _do_exec
    values = self._resolved_values
  File "/home/rewerson/.local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1840, in _resolved_values
    desc = _entity_descriptor(self.mapper, k)
  File "/home/rewerson/.local/lib/python2.7/site-packages/sqlalchemy/orm/base.py", line 402, in _entity_descriptor
    "Entity '%s' has no property '%s'" % (description, key)
sqlalchemy.exc.InvalidRequestError: Entity '<class 'cps.ub.User'>' has no property 'restricted_tags'
2020-02-25 16:30:51 +03:00
Ozzieisaacs 9a812f11e7 Merge remote-tracking branch 'it/patch-8'
# Conflicts:
#	cps/translations/it/LC_MESSAGES/messages.po
2020-02-24 19:40:10 +01:00
Ozzieisaacs 917132fe26 Update Translation (german and russian)
Merge remote-tracking branch 'it/patch-8'

# Conflicts:
#	cps/translations/it/LC_MESSAGES/messages.po
2020-02-24 19:38:12 +01:00
Ozzieisaacs 187ca5dc8f Fix #1221 2020-02-24 19:08:54 +01:00
Ozzieisaacs 7d795771d3 Fix #1221 2020-02-24 19:02:38 +01:00
ElQuimm e51bc4ea78
Update italian message.po
Thank you for your job :-)
2020-02-23 21:23:00 +01:00
Ozzieisaacs 2dc3235d4f Merge branch 'master' into Develop 2020-02-23 20:08:37 +01:00
Ozzieisaacs 040bb4a5a8 Merge remote-tracking branch 'origin/master' 2020-02-23 20:07:51 +01:00
Ozzieisaacs fc4436f091 Update Translation 2020-02-23 20:07:21 +01:00
Ozzie Isaacs 5dbdef25d3
Windows compatibility 2020-02-23 17:24:25 +01:00
Ozzie Isaacs b9f3ac2eea
Windows compatability 2020-02-23 17:23:38 +01:00
Ozzieisaacs 9fc0c3b3de Merge remote-tracking branch 'English_texts/master'
# Conflicts:
#	cps/templates/config_edit.html
#	cps/templates/config_view_edit.html
#	cps/templates/layout.html
#	cps/templates/search_form.html
#	cps/templates/user_edit.html
2020-02-23 13:27:44 +01:00
Ozzieisaacs 4f81184da0 Update translation 2020-02-23 13:22:57 +01:00
Ozzieisaacs 8223561844 Merge branch 'master' into Develop 2020-02-23 13:21:11 +01:00
Ozzieisaacs 32a6beae65 Merge remote-tracking branch 'fix/kobo'
# Conflicts:
#	cps/kobo.py
2020-02-23 13:17:59 +01:00
Ozzieisaacs 146068c936 Merge branch 'Develop'
# Conflicts:
#	cps/db.py
#	cps/templates/user_edit.html
2020-02-23 13:15:30 +01:00
Ozzieisaacs 3b8c5ef21a Merge remote-tracking branch 'get_metadata/patch-1'
Fix #1210 Load multiple authors correct via get metadata
2020-02-23 13:14:12 +01:00
Ozzieisaacs e60ef8fc97 Calibre-web version visible in about section
Update Calibre-web Version info
2020-02-23 12:40:11 +01:00
Ozzieisaacs 24d755b123 Update translations
Merge remote-tracking branch 'it/patch-7'
2020-02-23 10:55:56 +01:00
Ozzieisaacs 7c89f0b5b9 Merge with branch develop
Release version
2020-02-23 09:08:01 +01:00
Ozzieisaacs 134a10f56c Merge remote-tracking branch 'origin/Develop' into Develop
# Conflicts:
#	cps/updater.py
2020-02-23 08:58:47 +01:00
Ozzieisaacs 3a70c86f49 Update updater to handle venv folders 2020-02-23 08:58:13 +01:00
Ozzieisaacs ac431bbc4a Limit requirements 2020-02-23 08:58:13 +01:00
OzzieIsaacs 371097eb4d Update Updater 2020-02-23 07:54:58 +01:00
OzzieIsaacs 6346059698 Changed optional-requirements 2020-02-23 06:53:17 +01:00
Ozzieisaacs 372c284ad4 Merge branch 'master' into Develop 2020-02-22 16:24:06 +01:00
Ozzie Isaacs 264ccdbf6d
Update bug_report.md 2020-02-22 13:36:31 +01:00
Ozzie Isaacs b95150ff11
Update bug report 2020-02-22 13:33:21 +01:00
Ozzie Isaacs 81fc04f24d
Update bug_report.md 2020-02-22 13:29:36 +01:00
Ozzie Isaacs 3d4ebddb04 Update issue templates 2020-02-22 13:27:56 +01:00
Ozzie Isaacs de299e0d6a Update issue templates 2020-02-22 13:25:31 +01:00
Johnny A. dos Santos 29cb8bfec4
Fix #1210 2020-02-21 18:25:02 -03:00
Ozzieisaacs b7f3e00fbf Update updater to handle venv folders 2020-02-21 18:04:26 +01:00
Ozzieisaacs 27a18d60a7 Merge remote-tracking branch 'fix/robust_proxy' into Develop
# Conflicts:
#	cps/kobo.py
2020-02-19 18:20:03 +01:00
Ozzieisaacs de8f6d3e8d Limit requirements 2020-02-19 18:15:40 +01:00
Ozzieisaacs 6893635251 Handle kobo auth request
Handle access from localhost for kobo
2020-02-18 20:36:32 +01:00
ElQuimm 94a38a3b47
udate message.po in italian
Hello, 
updated one more time the translation :-)
I think the string "Author list" is missing.
Thank you!
Quimm
2020-02-17 21:03:33 +01:00
Michael Shavit 7d99e21d0d Merge remote-tracking branch 'original/Develop' into kobo_book_delete 2020-02-17 14:49:42 -05:00
Michael Shavit df3eb40e3c Make KoboStore proxying more robust.
* Add a timeout to prevent hanging when the KoboStore isn't reachable.
* Add back a the dummy auth implementation for when proxying is
disabled.
* Return the dummy auth response as a fallback when failing to contact
the KoboStore.
* Don't contact the KoboStore during the /sync API call when proxying is
disabled.
2020-02-17 14:37:02 -05:00
Ozzieisaacs ba6b5f8fd1 Merge branch 'master' into Develop 2020-02-17 18:42:53 +01:00
Josh O'Brien 8f518993a4
Merge branch 'master' into master 2020-02-18 00:21:59 +11:00
Niktia Pchelin dac48a2610 #645 - changes create_shelf and edit_shelf to allow user create public and private shelves with the same name 2020-02-16 23:38:35 -05:00
Niktia Pchelin 7c0d10da79 #645 - displays '(public)' next to user's public shelves in OPDS feed 2020-02-16 22:47:32 -05:00
Niktia Pchelin d77b52af96 #645 - displays '(public)' next to public shelves created by the user 2020-02-16 22:24:00 -05:00
Ozzieisaacs 29f6463ed9 Fix #1149 (Prevent invalid file extensions on Kindle Paperwhite download) 2020-02-16 19:55:05 +01:00
Ozzieisaacs ed0bdbf31d Fix for #1199 (missing referrer) 2020-02-16 19:39:32 +01:00
Ozzieisaacs b152d3e06d Merge remote-tracking branch 'auth_token/fix/reverse-proxy-authentication-with-bearer-token' 2020-02-16 19:24:28 +01:00
Ozzieisaacs 16cd57fe55 Merge remote-tracking branch 'cover_layout/fix-pull-left-cover-layout' 2020-02-16 19:19:10 +01:00
Ozzieisaacs 3f578122a3 Merge remote-tracking branch 'it/patch-6' 2020-02-16 18:56:14 +01:00
Ozzieisaacs 51a27322be Merge remote-tracking branch 'cn/master' 2020-02-16 18:53:27 +01:00
OzzieIsaacs 050feed5dc Updated test result 2020-02-16 16:53:54 +01:00
Ozzieisaacs e3ddc16657 Fix opds login not working anymore (due to kobo sync protocol) 2020-02-16 14:25:15 +01:00
André Frimberger 33cdf20cd5
Remove trailing whitespaces 2020-02-16 10:25:01 +01:00
Ozzieisaacs 317e59df4b Bugfixes from tests 2020-02-15 16:02:31 +01:00
Ozzieisaacs a9a6f5b97e Renamed restrict -> deny 2020-02-15 10:21:45 +01:00
Ozzieisaacs 8b1444ebc2 Improved testability
Less content exposed with restricted content
Tornado restart and stop working with systemd
2020-02-15 09:08:39 +01:00
Kyos 509071949a Moved style to css file 2020-02-13 21:05:24 +01:00
ElQuimm 697d857549
message.po italian 2020-02-13 11:29:26 +01:00
Ozzieisaacs 2ea45b1fdc Removed shebang on non executable scripts 2020-02-10 18:37:47 +01:00
Ozzieisaacs 726595e117 Update for testability 2020-02-10 18:34:10 +01:00
Kyos 1666e32aaf Fixes cover layouts in user edit page 2020-02-09 22:31:08 +01:00
Kyos 6a69bbe4b5 Fixes cover layouts in user edit page 2020-02-09 22:20:52 +01:00
André Frimberger 7a608b4fb0
fix binascii.Error with reverse proxy bearer token
When an authenticating reverse proxy (e.g. Keycloak Gatekeeper) adds a Bearer token in the Authorization header, every request fails with HTTP status code 500.  The corresponding error in the logs is: binascii.Error: Incorrect padding. 
Despite "reverse_proxy_header_login" is enabled, calibre-web tries first to base64decode the bearer token and fails. This patch just reverses the order in which the authentication methods  are checked.
2020-02-09 17:21:22 +01:00
Ozzieisaacs 814ad87a42 Updated pdf viewer to 2.2.228 (#1184) 2020-02-09 17:02:47 +01:00
Ozzieisaacs 3e4b5e23fa Updated pdf viewer to 2.2.228 (#1184) 2020-02-09 17:02:28 +01:00
Ozzieisaacs ab24ed8088 Handle sorting of hidden books #1123
Prevent downloading of covers from hidden books
2020-02-09 14:31:42 +01:00
Ozzieisaacs 50ba2e329a Merge branch 'master' into Develop
# Conflicts:
#	cps/shelf.py
2020-02-09 07:00:04 +01:00
Ozzie Isaacs c1e2a98f46 Merge remote-tracking branch 'origin/master' 2020-02-08 14:40:28 +01:00
Ozzie Isaacs e04aa80fd6 Fix #1181 and Fix #1182 handle removed "is_xhr" on werkzeug version 1.0.0 2020-02-08 14:40:13 +01:00
Ozzie Isaacs 482e977af4
Clarified installation procedure 2020-02-08 13:27:51 +01:00
Ozzie Isaacs 2535bbbcf1 Fix #1180 working on windows with tornado and python <3.8 again 2020-02-08 13:24:01 +01:00
Ozzieisaacs 6698773d81 Improved testability 2020-02-08 11:33:31 +01:00
xcffl aefaf47f4c
Update Simplified Chinese translation 2020-02-03 17:26:17 +08:00
Josh O'Brien 9b49125776 English Language Updates
Changes to provide consistency for English language.
2020-02-03 14:22:00 +11:00
Ozzieisaacs b33a2ac90d Fix #1170 Auth-digest Header no longer crashs calibre-web
Fix #1161 Shelfs are reordering again
Update Sortable.js to 2.10.1
Code cosmetics
2020-02-02 07:47:27 +01:00
Ozzieisaacs f67953c447 Update translation
Merge remote-tracking branch 'cz/patch-11'
2020-02-01 15:03:03 +01:00
Ozzieisaacs 981632f599 Merge remote-tracking branch 'it/patch-5' 2020-02-01 15:02:10 +01:00
Ozzieisaacs a6c453d826 Merge remote-tracking branch 'pl/pl_translate_update' 2020-02-01 15:01:58 +01:00
Ozzieisaacs 4087e685f4 Fix auto detection of locale 2020-02-01 13:40:29 +01:00
Ozzieisaacs 5255085de1 Fix auto detection of locale 2020-02-01 13:38:11 +01:00
ElQuimm 9247ded710
Update - italian version of message.po 2020-01-29 21:41:54 +01:00
Jerzy Piątek 0bb0cbaef0 Updated polish translations 2020-01-28 22:28:58 +01:00
Lukáš Heroudek 0f7d272e13
Update messages.po 2020-01-28 10:03:40 +00:00
Ozzieisaacs 00dafe3121 Fix restrict columns 2020-01-27 20:34:36 +01:00
Ozzieisaacs e44494aad0 Kobo sync enable/disable working 2020-01-27 20:32:37 +01:00
Ozzieisaacs 4ab3dc2599 Merge branch 'master' into Develop
# Conflicts:
#	cps/admin.py
2020-01-27 18:20:50 +01:00
Ozzieisaacs acfad7a982 Update Italian translation 2020-01-27 18:17:17 +01:00
Ozzieisaacs b29b5b7ac1 Merge remote-tracking branch 'github/fix-admin-view-log-file' 2020-01-27 18:14:16 +01:00
ElQuimm 7803ffb995
Update italian message.po
Thank you.
2020-01-27 15:07:00 +01:00
Ghighi Eftimie fc79cdfaa2 fix mismerge 2020-01-27 15:24:11 +02:00
Michael Shavit f9dbc6bc78 Clean-up book from ArchivedBook on hard-delete.
This change also adds a warning to the hard-delete prompt that deleted
books should first be archived if the Kobo Sync feature is enabled.
An alternative would be to keep a permanent record of hard-deleted
book.
2020-01-26 16:20:10 -05:00
Michael Shavit dc7aaae235 Now that CalibreWeb delete requests are respected, we can forward
them to the KoboStore for books that aren't in Calibre.

Note: There's still an edge case where a book is removed from Calibre
without first being archived, in which case the delete call will fail.
2020-01-26 16:01:27 -05:00
Michael Shavit 9804a98af8 Merge remote-tracking branch 'original/Develop' into kobo_book_delete 2020-01-26 15:58:57 -05:00
Ghighi Eftimie 647e954e8a fix admin view of error log 2020-01-26 20:53:03 +02:00
Ozzieisaacs 004d9118bc Merge branch 'master' into Develop 2020-01-26 19:37:14 +01:00
Ozzieisaacs 594c8aad91 Update Version Info 2020-01-26 19:36:15 +01:00
Ozzieisaacs 542a0008c9 Merge remote-tracking branch 'ru/master' 2020-01-26 19:33:37 +01:00
Ozzieisaacs 24f7918aa4 Merge remote-tracking branch 'it/patch-4' 2020-01-26 19:31:52 +01:00
Ozzieisaacs 2eec329bdf Merge branch 'master' into Develop
# Conflicts:
#	cps/templates/user_edit.html
#	optional-requirements.txt
2020-01-26 19:29:36 +01:00
Ozzieisaacs 0411d4a8c9 Added 2 new kobo settings: Enable Kobo Sync (currently not working) and proxy Requests to Kobo
Added fix for kobo reader generating requests without right port number, causing url_for not working correct
2020-01-26 16:52:40 +01:00
Ozzieisaacs a986faea56 Merge remote-tracking branch 'fix/fix_creation_time' into Develop 2020-01-26 16:50:38 +01:00
Ozzieisaacs ad71d0a03f Merge remote-tracking branch 'kobo_/develop/fix-new-user' into Develop 2020-01-26 14:43:44 +01:00
Ozzieisaacs 0955c6d6fb Update Kobo 2020-01-26 14:42:53 +01:00
Michael Shavit d30b44ee0f Minor formatting changes per codacy review. 2020-01-26 01:12:52 -05:00
Michael Shavit a6f4db0f25 Fix bug where last_created is incorectly set in the SyncToken. 2020-01-26 00:32:05 -05:00
Michael Shavit 4547c328bc Delete/Restore book from Kobo device upon (un)archiving of a book in the web UI. 2020-01-26 00:29:36 -05:00
Michael Shavit 5027aeb3a0 Fix bug where last_created is incorectly set in the SyncToken. 2020-01-26 00:29:36 -05:00
Michael Shavit c0239a659c Add UI support for archived books.
Archived books will no longer appear in any book lists or searches, and
may only be restored from the Archive view.
2020-01-26 00:27:54 -05:00
Michael Shavit e404da4192 Add support for book 'deletion' (i.e archiving) from a Kobo device. 2020-01-26 00:16:55 -05:00
Simon Latapie 69fa7d0091 new user: disable kobo token on new user page
kobo token generator function is related to a user id, which is not
present on new user page.
Disable the Kobo token part when creating a new user.
2020-01-25 22:41:55 +01:00
ZIzA e1d6aec682
quick fix
sorry
2020-01-21 23:06:22 +04:00
ZIzA 155795a18e
Russian language update 2020-01-21 22:29:23 +04:00
ZIzA 8c4052e884
Update README.md 2020-01-21 22:22:10 +04:00
Ozzie Isaacs 3c63e2b7e4
Update version number 2020-01-21 07:04:18 +01:00
Simon Latapie 9b119fa724 edit book: manage identifiers 2020-01-20 22:26:43 +01:00
ElQuimm a17c1c063e
Update messages.po
:-)
Thank you
2020-01-20 22:05:11 +01:00
Ozzieisaacs 6728f5da2d Update Czech translation 2020-01-20 20:32:41 +01:00
Lukáš Heroudek 16adeae5c3
Update messages.po 2020-01-20 15:23:54 +00:00
Lukáš Heroudek 485eba94cc
Update messages.po 2020-01-20 14:41:51 +00:00
Lukáš Heroudek 5a074348ac
Update messages.po 2020-01-20 14:02:23 +00:00
Ozzieisaacs cd9bb56db5 Cleanup Kobo integration 2020-01-20 06:14:53 +01:00
Сергей 8150f934fd
Update README.md 2020-01-20 01:48:57 +04:00
Сергей 4c8f3f7bae
Add files via upload 2020-01-20 01:46:41 +04:00
Сергей ab5f176f58
Update README.md 2020-01-20 01:45:37 +04:00
Ozzieisaacs b294ac00ed Update for updated dependencies on comicapi 2020-01-19 17:45:04 +01:00
Ozzie Isaacs 165cbad67b
Delete tess.py 2020-01-19 15:04:49 +01:00
Ozzieisaacs b30da58eb9 Update german translation 2020-01-18 12:55:18 +01:00
Ozzieisaacs b0fb6b858d Merge remote-tracking branch 'swedish/patch-4' 2020-01-18 12:29:22 +01:00
Jony 53ce22ef5e
Update Swedish translation
I translated the new strings.
2020-01-18 12:18:05 +01:00
Ozzieisaacs 8e7a52f44e Merge remote-tracking branch 'swedish/master' 2020-01-18 12:04:49 +01:00
OzzieIsaacs 05a35be019 Update test result 2020-01-18 11:53:23 +01:00
Jony 4406220f70
Update Swedish translation
Update file
2020-01-18 11:25:07 +01:00
Jony 51a6cff411
Merge pull request #2 from janeczku/master
Update respository
2020-01-18 11:24:03 +01:00
Ozzieisaacs 8f4253adbd Fix for limiting domains (now no restriction to domain only) 2020-01-18 10:32:09 +01:00
Ozzieisaacs 3e404101bd Merge remote-tracking branch 'cc/develop/custom_float' into Develop 2020-01-15 17:58:57 +01:00
Ozzieisaacs 65105d9dbe Merge remote-tracking branch 'cc/develop/custom_float' into Develop 2020-01-15 17:58:23 +01:00
Ozzieisaacs 3a4d351a57 Merge remote-tracking branch 'develop/calibur-fix-colon' into Develop 2020-01-15 17:57:00 +01:00
Ozzieisaacs ce66c752c4 Updated czech translation
removed language selection for guest user
2020-01-14 18:21:31 +01:00
Lukáš Heroudek 4e42a179fa
Update messages.po 2020-01-14 16:45:45 +00:00
Ozzieisaacs 973f555544 Merge branch 'master' into Develop
(updated tinymce and bootstrap datepicker)
2020-01-13 18:39:25 +01:00
Ozzieisaacs 1d7e52c198 Merge with develop:
- No. of unread books correct calculated
- logviewer handles stream output correct
- Id for testablility in email server setup
2020-01-13 18:37:29 +01:00
Ozzieisaacs 1b42dd1043 Update czech and german translation 2020-01-13 18:24:47 +01:00
Lukáš Heroudek 77e0022252
Update messages.po
Added missing and clenup
2020-01-13 10:29:14 +00:00
Simon Latapie 56964a890b caliBlur theme: fix custom column display that contain colons 2020-01-12 14:26:07 +01:00
Simon Latapie cef41661dd custom columns: add Float type support
- remove float datatype from cc_exceptions
- handle float datatype like int or bool
- change edit template to modify input step (0.01 precision, like
  in calibre UI)
2020-01-12 14:16:08 +01:00
Ozzieisaacs 68ca0b86da Updated tiniymce + locale
updated datepicker + locale
Included cs, fi language, updated ru language
2020-01-12 14:11:53 +01:00
Ozzieisaacs 79a9ef4859 Make Kobo optional
move jsonschema dependency to optional-requirements.txt
Added version of jsonschema to about section
Added additional column to RemoteAuthToken table
Update configuration of Kobo sync protocol
2020-01-12 13:42:39 +01:00
Ozzieisaacs 2798dd5916 Merge remote-tracking branch 'fix/kobo' into Develop
# Conflicts:
#	cps/db.py
#	cps/web.py
2020-01-11 18:35:04 +01:00
Ozzieisaacs 8143c16c14 Added texts for allowed denied tags in configuration
Removed domain only restriction (now it's also possible to allow/deny name parts of users email)
Fix no. of displayed books in unread books section, with applied restrictions
2020-01-11 13:28:09 +01:00
Ozzieisaacs 42435ab34a Improved testablility 2020-01-08 19:52:05 +01:00
Lukáš Heroudek 434fb2e7cb
Add files via upload 2020-01-08 12:06:13 +00:00
Lukáš Heroudek bce70bf17c
Update messages.po 2020-01-08 12:05:36 +00:00
Lukáš Heroudek cde44178c4
Create messages.po 2020-01-08 12:03:52 +00:00
Ozzieisaacs 661ed17d23 Handle stream output in logviewer
Add migration of global matrue content settings to user based settings
Fix Caliblur Theme (Publisherslist)
Allow/deny list/edit/add/delete of tags and custom columns
Colored table background for tags restriction
2020-01-07 20:26:59 +01:00
Ozzieisaacs c659f28334 Fix #1128 2020-01-06 11:52:59 +01:00
Ozzieisaacs 218e35e3aa Merge remote-tracking branch 'origin/Develop' into Develop 2020-01-05 16:20:46 +01:00
Ozzieisaacs cabad83418 moved language selection back, default value for restriction columns
Merge branch 'master' into Develop

# Conflicts:
#	cps/editbooks.py
2020-01-05 16:20:36 +01:00
Ozzieisaacs 24ae7350f5 Fix # #1127 (user template show random books in detail view not saved) 2020-01-05 16:18:51 +01:00
Ozzieisaacs c60277f4d3 Capitalize language selection in User settings
Remove sql statement from log.debug statement upon creation of new column in settings database
2020-01-05 14:07:26 +01:00
Ozzieisaacs 6a07cfba65 Merge remote-tracking branch 'proxy_login/1105-reverse-proxy-login'
Fix for creation of bool config settings (before: new bool columns where always created with true as default)
2020-01-05 13:38:51 +01:00
Ozzieisaacs 87c415830f Merge branch 'master' into Develop
# Conflicts:
#	cps/editbooks.py
2020-01-05 13:37:45 +01:00
Ozzieisaacs c78c63e1d5 Merge remote-tracking branch 'fix_reconnect'
# Conflicts:
#	cps/web.py
2020-01-05 08:47:03 +01:00
Ozzieisaacs 56ee8c56ba Fix #1122
(Uploading books with applied language restriction leads no longer to error 500)
2020-01-05 08:40:57 +01:00
Ozzieisaacs 48495f0d66 Merge branch 'master' into Develop
# Conflicts:
#	cps/helper.py
#	cps/templates/user_edit.html
#	cps/web.py
2020-01-04 07:57:54 +01:00
Ozzieisaacs 8ad84a7ceb Fix for #1123 (mature content is visible in shelfs) 2020-01-02 17:11:30 +01:00
Ozzieisaacs 32e818af6a Fix #1124 2020-01-02 16:09:06 +01:00
Ozzieisaacs d9adb4fc94 Improvements for limit tags 2020-01-01 17:30:08 +01:00
Ozzieisaacs 513ac6cfb4 Fix for #768 (If email server is configured, admins can send user passwords, also domains can be denied from registration)
Fixes from tests
Fix response opds with read/unread
changed db_reconnect
Changed output for error 500 (now including error message)
Fix in task queue after 20 messages
2020-01-01 17:29:01 +01:00
Ozzieisaacs 1da4efec86 Merge branch 'master' into Develop 2019-12-31 10:52:45 +01:00
Ozzieisaacs 1c630eb604 fixes from tests 2019-12-30 15:16:09 +01:00
Ozzieisaacs 1c18a788f4 Merge remote-tracking branch 'tags_restrict/master' into Develop 2019-12-30 15:15:07 +01:00
Ozzieisaacs 5887f0fe6b Fix for #768 (If email server is configured, admins can send user passwords, also domains can be denied from registration) 2019-12-29 13:54:52 +01:00
ground7 b782489a8c ldap opds download bugged 2019-12-28 21:52:26 -07:00
Ozzieisaacs 01381488f4 Fixes from tests 2019-12-28 16:18:21 +01:00
ground7 6555d5869f attempt regular login if ldap login fails as fallback 2019-12-27 23:45:42 -07:00
ground7 54c4f40188 added LDAP import
update defaults
2019-12-27 23:12:18 -07:00
Ozzieisaacs 62e8bee2a8 Fix response opds with read/unread
changed db_reconnect
Changed output for error 500 (now including error message)
Fix in task queue after 20 messages
2019-12-24 13:02:53 +01:00
Michael Shavit 9ec3ddd492 Fix the HandleCoverImage endpoint so that it requires login, and doesn't
take unused parameters.
2019-12-22 16:59:00 -05:00
Michael Shavit d81dbb13e4 Support Epub downloads 2019-12-22 16:59:00 -05:00
Michael Shavit c238367b64 Reload database on every call to v1/library/sync. This fixes an issue where side-loaded books appear in the sync response with no download urls. 2019-12-22 16:59:00 -05:00
Michael Shavit cdcb8a50d1 Fix /reconnect endpoint, which was broken by 006e596c72 2019-12-22 16:58:55 -05:00
Michael Shavit 520c695401 Fix /reconnect endpoint, which was broken by 006e596c72 2019-12-22 16:54:16 -05:00
Michael Shavit b831b9d6b2 Integrate with the official Kobo store endpoint so that no
functionanility is lost by overriding the api_endpoint setting.

Requests are either:
 * Redirected to the Kobo Store
 * Proxied to the Kobo Store
 * Proxied to the Kobo Store and merged with results from CalibreWeb.
2019-12-22 13:40:49 -05:00
Ozzieisaacs bbe91f439a Merge from master 2019-12-22 15:28:43 +01:00
Ozzieisaacs b586a32843 Fix #1115 (comic reader not working under iOS, maybe invalid issue)
Improvement for #925 (Next/Prev buttons are bigger)
2019-12-22 15:24:22 +01:00
Ozzieisaacs 288944db2c Merge remote-tracking branch 'kobo_sync/kobo' into Develop
# Conflicts:
#	cps.py
#	cps/kobo.py
#	cps/kobo_auth.py
#	cps/ub.py
2019-12-20 19:24:31 +01:00
Ozzieisaacs f2c07d8f81 Update Kobo sync 2019-12-20 19:17:08 +01:00
Michael Shavit d6a9746824 Add a filter to the Sync request endpoint to ignore books that don't
have any formats supported by the device.
2019-12-20 01:28:53 -05:00
Michael Shavit f84274f1c5 git add missing generate_kobo_auth_url.html 2019-12-20 01:08:15 -05:00
Michael Shavit 2118d920f5 Formatter. 2019-12-20 01:04:12 -05:00
Michael Shavit 207004beff Remove config_server_url setting. 2019-12-20 01:02:49 -05:00
Michael Shavit 27d084ce39 Remove the KoboUserKey-based Authentication.
Instead, the user generates the api_endpoint url to set on their device
by visiting http://.../kobo_auth/generate_auth_token.
The generated url will contain a RemoteAuthorizationToken that will be
included on all subsequent requests from the device to the kobo/
endpoints. (In contrast, the device is authenticated using a session cookie on
requests to the download endpoint).

Also use Flask.url_for to generate download urls.
2019-12-20 00:55:53 -05:00
Ozzieisaacs f705889c23 Inital Kobo 2019-12-17 20:28:20 +01:00
Ozzieisaacs 7098d08888 Added option to convert AZW3 to mobi for sending to kindle 2019-12-15 18:44:02 +01:00
Ozzieisaacs eabc6e23be Test Email now send to user's email address (#834)
Added forgot/reset password routine (#1098, #1063)
2019-12-15 17:08:17 +01:00
Ozzieisaacs b6d7207ec3 Added platform information for better debugging 2019-12-15 13:33:38 +01:00
Ozzieisaacs c33623efee Unified wording for recently added books, series, categories, etc in opds and web UI ( #1045)
Added file formats and languages to opds feed
2019-12-15 13:32:34 +01:00
Ozzieisaacs 2215bf3d7f Implemented #1083 (Advanced search for extensions) 2019-12-15 11:35:07 +01:00
Ozzieisaacs 86fe970651 More fixes for googledrive 2019-12-14 22:22:27 +01:00
Andrew Roberts 3dc372c573 fixed typo 2019-12-12 21:38:45 -05:00
Andrew Roberts efcee0a7b7 added reverse proxy configuration form and handler 2019-12-12 21:31:21 -05:00
Andrew Roberts 39b6b100f9 whitespace 2019-12-12 21:31:19 -05:00
Andrew Roberts 9351ff032f whitespace 2019-12-12 21:31:17 -05:00
Andrew Roberts f0760c07d8 added admin display of reverse proxy settings 2019-12-12 21:31:12 -05:00
Andrew Roberts 77b0954c70 use a macro for the display of boolean settings 2019-12-12 21:28:50 -05:00
Andrew Roberts af7dbbf1e4 added logic for reverse proxy login 2019-12-12 21:27:40 -05:00
Andrew Roberts b661c2fa92 added config fields to settings table 2019-12-12 21:27:38 -05:00
Ozzieisaacs e308a74dc2 Fix (#1103) Internal server error with Goodreads and no result for author name on Goodreads 2019-12-12 20:08:16 +01:00
Michael Shavit 040d7d9ae3 Remove unused import and fix python3 compatibility, as per Ozielsaacs comments. 2019-12-11 00:12:35 -05:00
Michael Shavit f9b1e84704 Remove backblaze leftovers 2019-12-10 23:57:53 -05:00
Ozzieisaacs eede894e72 Merge remote-tracking branch 'merge-metadata' 2019-12-09 20:53:16 +01:00
Michael Shavit 55c0bb6d34 Set the "Size" attribute for Kobo download_urls, and refactor the code
to eventually allow formats other than KEPUB.
2019-12-08 17:28:25 -05:00
Michael Shavit 2b55b9b250 Use the login_user Cookie to authorize download requests instead of
passing the UserKey over url params.
2019-12-08 15:33:57 -05:00
Ozzieisaacs 22add37b64 Merge remote-tracking branch 'fix typo in config_edit.html #1097'
Updated translations
2019-12-08 10:10:32 +01:00
Ozzieisaacs 8a9695d48e Fix getting metadata from douban (#858) 2019-12-08 09:52:57 +01:00
Ozzieisaacs e0faad1e59 Handle no write permission to tmp folder (#1060) 2019-12-08 09:40:54 +01:00
Michael Shavit fffa2d5a1b Support passing the Auth token as a url param.
This is required to support ebook downloads which the Kobo device emits
without any auth headers.

* Also some other small bug fixes discovered during device testing.
2019-12-07 22:55:07 -05:00
Michael Shavit 0926ae530c Remove custom_column usages from an earlier commit. 2019-12-07 21:08:53 -05:00
Michael Shavit 0b709f7dfb Merge branch 'master' into kobo 2019-12-07 20:04:54 -05:00
Michael Shavit b5da2c4199 Clean-up: Fix import order in kobo.py, and other minor formatting
changes.
2019-12-07 19:54:49 -05:00
Michael Shavit 9ede01f130 * Add a UserKeyToken to the User table for Kobo authorization.
* Add proper authorization checks on the new Kobo endpoints.

Important Note: As a side-effect, all CalibreWeb API calls can be
authorized using this token (i.e without a username&password).
2019-12-07 19:54:44 -05:00
Christian Keil c61463447f Merge metadata of uploaded book versions. 2019-12-06 15:00:01 +01:00
Michael Shavit 55b54de6a0 Add simple get_download_url implementation to replace the backblaze-backed implementation 2019-12-05 19:06:39 -05:00
Michael Shavit 5357867103 Add initial support for Kobo device Sync endpoint.
- Supports /v1/library/sync call to get list of books
- Supports /v1/library/metadata call to get metadata for a given book
  + Assumes books are stored on Backblaze for metadata call
- Changes to helper.py so that we can return no cover instead of a blank
image.
2019-12-05 01:56:59 -05:00
zhiyue 222797e631
support douban book search using apikey 2019-12-04 11:59:06 +08:00
dalin 92841b46d7 update Simplified Chinese translations. 2019-12-03 16:32:03 +08:00
dalin 6fe60d5c5e Merge branch 'master' of https://github.com/idalin/calibre-web 2019-12-03 16:07:09 +08:00
dalin 4c2323fcc9 fix typo in config_edit.html 2019-12-03 16:06:25 +08:00
Ozzieisaacs fda0ab1e86 FIx for (#1092 listening to mp3 not working) 2019-12-01 12:36:55 +01:00
Ozzieisaacs 54079b36ae Fix #1095 (epub viewer not working if only viewer rule wa sapplied) 2019-12-01 12:21:21 +01:00
Ozzieisaacs f8a99c60d8 Fix for #1096 (exception on digest request) 2019-12-01 09:33:11 +01:00
Ozzieisaacs 2f27a7b0ce Merge remote-tracking branch 'd/master' 2019-11-26 10:50:55 +01:00
Ozzieisaacs 8af178c19c Fix for gdrive not working #1081 2019-11-26 10:46:06 +01:00
Ozzieisaacs 78f9ee86b1 Fix pdf cover
Fix massadding books
Add feature inform of duplicate books
2019-11-26 08:19:03 +01:00
Ozzieisaacs ab5873984e Merge remote-tracking branch 'translation/patch-3' 2019-11-17 06:59:22 +01:00
Ozzieisaacs 62ea8b8913 Logging to stdout, proposal form #1078 2019-11-16 10:09:34 +01:00
Ozzieisaacs a4416c202d Merge remote-tracking branch 'rename/develop' 2019-11-16 08:01:18 +01:00
Jony 1f5edffccf
Fix typo and update translation 2019-11-16 07:49:07 +01:00
Ozzieisaacs 651260022c Merge remote-tracking branch 'search_title/hotfix-searchform-title' 2019-11-16 07:29:00 +01:00
Ozzieisaacs 2e4344f7ea Merge remote-tracking branch 'swedish/master' 2019-11-16 07:27:08 +01:00
Jony 3cb7e77b60
Update messages.po 2019-11-14 18:52:06 +01:00
Ghighi Eftimie f782dc1857 fix for search title 2019-11-14 12:08:19 +02:00
Jony 7179f133bb
Merge pull request #1 from janeczku/master
Update from original.
2019-11-12 19:34:34 +01:00
Ozzieisaacs 88f31ddad1 Fix for #1034 2019-11-07 21:04:03 +01:00
Ozzieisaacs a7ab7fcf06 Fix #1068 PDF cover Images inverted or incorrect single image grabbed from cover page 2019-11-03 09:49:54 +01:00
Ozzieisaacs 6f61e80c97 Fix #1074, #1071 2019-10-31 15:46:38 +01:00
Ozzieisaacs d1afdb4aac Fix #1074, #1071 2019-10-31 15:44:36 +01:00
Ozzieisaacs 1112dc82c9 Merge remote-tracking branch 'origin/dependabot/pip/pyyaml-5.1' 2019-10-30 20:25:53 +01:00
dependabot[bot] e47b0c6433
Bump pyyaml from 3.12 to 5.1
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 3.12 to 5.1.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/3.12...5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-29 13:55:45 +00:00
Jan Guzej 94ae9937f0 Add flash show book template 2019-10-26 13:45:06 +02:00
Jan Guzej fadd085b57 Checking and warrying on possible duplicity 2019-10-26 11:54:27 +02:00
Ozzieisaacs 5167ee520e Solve cropped image pdf import (#1068) 2019-10-22 19:11:40 +02:00
Ozzieisaacs f758a1cc64 Solve inverted image pdf import (#1068) 2019-10-21 19:33:09 +02:00
Ozzieisaacs 2145be6db2 Improvement for #1062 2019-10-20 16:47:15 +02:00
Ozzieisaacs c740fe9124 Merge remote-tracking branch 'github_2/it-adds-info-to-shelf-order' 2019-10-20 15:50:52 +02:00
Ozzieisaacs a371e40c66 Merge remote-tracking branch 'github_3/hotfix/epub-import'
Improved cover extraction from epub files
2019-10-20 15:48:06 +02:00
Ozzieisaacs ccc6184342 Merge remote-tracking branch 'github_1/patch-1' 2019-10-20 15:03:37 +02:00
Ozzieisaacs c8c2d6659c Merge remote-tracking branch 'public_reconnect/master' 2019-10-20 15:03:02 +02:00
Ozzieisaacs 1413f26c85 Merge remote-tracking branch 'github_readme/master' 2019-10-20 15:02:07 +02:00
Jan Guzej c7d7a7597c remove language from array metadata 2019-10-19 21:49:18 +02:00
Jan Guzej fbb7663a2f epub metadata import fix 2019-10-19 14:04:15 -04:00
Kyos c93dd32179 Fixed typo and column size for LG screens 2019-10-19 12:02:14 +02:00
Kyos 7165826011 Adds Authors, Series and Book Cover to the shelf order view 2019-10-19 10:57:48 +02:00
Kyos ada727a570 Adds Authors, Series and Book Cover to the shelf order view 2019-10-19 10:52:03 +02:00
gwenhael 01b0f9534c
fix issue #1064
Allow for finer steps in serie-index
2019-10-18 15:12:27 +02:00
DenysNahurnyi 0735283d45 Fix syntax errors in README.md 2019-10-08 20:48:26 +03:00
zelazna 3764c33a3a Add the posibility to change the username 2019-10-01 15:36:00 +02:00
Ozzieisaacs 9fc02f67c2 Debug output for lcase 2019-09-27 15:30:39 +02:00
Ozzieisaacs 0c40e40dc3 Fix logfile loading behind reverse proxy (#1047) 2019-09-27 08:15:10 +02:00
Ozzieisaacs e31df16309 Revert bug in updater.py preventing new files from being created 2019-09-24 19:00:47 +02:00
Ozzieisaacs d7ea5bb9d7 Fix for #1037
Update German translation
2019-09-17 18:25:17 +02:00
Ozzieisaacs 6cda5fee0d Fix language selection on python3 2019-09-06 20:56:17 +02:00
Ozzieisaacs 1fb45d769f Merge remote-tracking branch 'requirements/patch-1' 2019-09-06 19:07:47 +02:00
Ozzieisaacs ca5e285c5a Merge branch 'Develop' 2019-09-06 19:05:02 +02:00
Ozzieisaacs fb0eebfc52 Merge remote-tracking branch 'spanish/master' 2019-09-06 19:03:03 +02:00
Ozzieisaacs dd90fb003e Merge remote-tracking branch 'french/master' 2019-09-06 19:01:45 +02:00
Ozzieisaacs 61cd044255 Merge remote-tracking branch 'polish/master' 2019-09-06 19:01:17 +02:00
Ozzieisaacs 879d02081a Fix #1021 2019-09-06 18:57:41 +02:00
Ozzieisaacs 051bc53aa2 Fix for #1009 2019-09-02 19:27:34 +02:00
Ozzie Isaacs a7fdbad8b4
Changed minimum flask version
Minimum flask version to 1.0.2 due to blueprint issues
2019-09-01 16:35:30 +02:00
Angel Docampo 5515772903 updated spanish translations 2019-08-27 13:16:23 +02:00
Angel Docampo ff900fd9c0 updated spanish translations 2019-08-27 13:15:18 +02:00
Yamakuni eec4be7a29
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-25 01:01:05 +01:00
Alex Viscreanu 6a821b8a75
Fix SSLHandshakeError error on gdrive callback
changes: Update google-api-python-client and httplib2 versions
details: https://github.com/googleapis/google-api-python-client/issues/453
2019-08-24 23:43:49 +02:00
Yamakuni 1385ecb383
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-23 16:02:21 +01:00
Yamakuni 74418f3139
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-23 16:02:13 +01:00
Yamakuni 72def4b97b
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-23 16:02:04 +01:00
Yamakuni 564c3b4778
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-23 16:01:47 +01:00
Yamakuni c9eff4a70c
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-23 16:01:38 +01:00
Yamakuni 879f63d1c1
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-23 16:01:01 +01:00
Yamakuni 3fb458dd19
Update cps/translations/fr/LC_MESSAGES/messages.po
Co-Authored-By: Johan Bonneau <lhaagounet@gmail.com>
2019-08-23 16:00:52 +01:00
Yamakuni d9a73b4fa3 French translation
Add and modify some little things
2019-08-21 15:21:17 +01:00
Ozzieisaacs 23b3bfd967 Additional fix #1016 2019-08-20 19:12:40 +02:00
Ozzieisaacs f543d7f486 Fix #1016 2019-08-20 18:32:04 +02:00
Radosław Kierznowski 6a058d2c52 Update polish translation 2019-08-18 22:08:08 +02:00
Radosław Kierznowski c73698e8fd Merge https://github.com/janeczku/calibre-web 2019-08-18 21:54:29 +02:00
Vincent Kriek 38a255e069 Add automatic epub to kepub conversion using kepubify 2019-08-18 21:44:19 +02:00
Ozzieisaacs ff41775dbb Merge remote-tracking branch 'pwr/unpickle-iso-languages' into Develop 2019-08-17 17:27:06 +02:00
Ozzieisaacs 7e530618b7 Merge branch 'Develop' 2019-08-17 16:12:26 +02:00
Ozzieisaacs d04a78afe6 Merge remote-tracking branch 'public_shelf/Develop' into Develop 2019-08-17 16:03:29 +02:00
Ozzieisaacs f566237be0 Merge remote-tracking branch 'bootstrap/Develop' into Develop 2019-08-17 15:59:13 +02:00
Ozzieisaacs 87fa4a57b5 Merge branch 'master' into Develop 2019-08-17 15:57:39 +02:00
Dmitriy Istomin a65ad9483c update Bootstrap v3.4.0 -> 3.4.1 2019-08-16 11:18:39 -04:00
W1ndst0rm 4cbdccd39e Fix for https://github.com/janeczku/calibre-web/issues/1002 2019-08-13 23:07:15 -06:00
Ozzieisaacs 9356148e2d Added more information about dependencies 2019-08-06 19:53:33 +02:00
Ozzieisaacs 4be55285d8 Fix #1001 2019-08-06 18:38:17 +02:00
Ozzieisaacs 2caee35884 Merge branch 'master' into Develop 2019-08-03 20:29:28 +02:00
Ozzieisaacs 3eae2e9c2c Changed text for not found imports 2019-08-03 18:24:56 +02:00
Ozzieisaacs e9fb5d9f25 Bugfix for comicapi 2019-08-03 14:09:54 +02:00
Ozzieisaacs 6261981656 Fix for #991
Removed additional psace before Advanced search (Pull request #996)
Set startup message for not relevant imports to debug, to reduce confusion
2019-08-03 12:56:32 +02:00
Ozzieisaacs 82ca3f31f9 Merge remote-tracking branch 'pwr/master' 2019-07-31 17:40:50 +02:00
Ozzieisaacs 97f3aa8325 Update dutch language 2019-07-31 17:38:28 +02:00
Daniel Pavel 7c503b4a31 provide a default logging configuration (fixes #987) 2019-07-31 09:42:10 +03:00
Daniel Pavel 9f8cab99e3 Moved language names from iso639.pickle to a python file 2019-07-30 15:16:24 +03:00
Ozzieisaacs 5f25b81004 Final fix for #983 2019-07-29 21:43:00 +02:00
Ozzieisaacs 73bbffccaa Fix for login issue on MacOS 2019-07-28 21:29:54 +02:00
Radosław Kierznowski 43ad7d6e29 Add Flask-SimpleLDAP to requirements.txt 2019-07-27 20:26:58 +02:00
Radosław Kierznowski 2c27d631b4 Add goodreads to requirements.txt 2019-07-27 14:55:12 +02:00
Ozzieisaacs eb31b4b00b Merge branch 'master' into Develop 2019-07-27 07:23:22 +02:00
Ozzieisaacs f59d9d5aa8 Merge remote-tracking branch 'polish/master' 2019-07-27 07:19:30 +02:00
Radosław Kierznowski 746b7b1262 Update polish translation 2019-07-26 23:04:04 +02:00
Radosław Kierznowski 2d67d55b73
Merge pull request #1 from janeczku/master
Merge oryginalnego repo
2019-07-26 21:38:27 +02:00
Ozzieisaacs 5f228fbb40 Update german translation 2019-07-26 17:20:48 +02:00
Ozzieisaacs 12576393cf Merge remote-tracking branch 'spanish/patch-1'
Merge remote-tracking branch 'german/master'
2019-07-26 16:41:52 +02:00
Mainak 7f43a2e104
Update messages.po
update and revision of the Spanish translation file.
2019-07-26 11:45:45 +02:00
Ozzieisaacs 00f17bb697 Mature contents no longer displayed in/allowed to (#975):
- typeahead tags
- advanced search tags buttons
- read
- download
2019-07-25 21:42:46 +02:00
Ozzieisaacs cf00b4eebf Cover upload gives Error 500 fix #972 (leftover from refactoring)
OPDS cannot be downloaded Fix #973 (wrong blueprint selected with wrong authentication type)
Read books with link to calibre wern't detected correct Fix #971 (Refactoring error "is" is not equal to "==" for sqlalchemy)
2019-07-24 18:43:23 +02:00
Ozzieisaacs be5c67fddd Merge branch 'master' into Develop 2019-07-23 21:41:27 +02:00
Ozzieisaacs fc4dc36c65 Fix #969 (duplicate code "init" in epub reader)
Fix for #890
2019-07-23 19:26:01 +02:00
Ozzieisaacs 97a0dccdec Fix for display of format, series, category, ratings,
Fix for display of language (sorting not working yet)
2019-07-22 21:38:52 +02:00
Ozzieisaacs 9f64a96502 Fix for #890 2019-07-22 18:28:45 +02:00
Ozzieisaacs b9c3a3fcea Fix #652 2019-07-21 18:19:07 +02:00
Ozzieisaacs 6d43e0422a Fix for non found flask_login version (#968) 2019-07-21 17:45:21 +02:00
Ozzieisaacs 0d7e58ce79 Fix for #968 (database conversion fails for default strings under python2.7) 2019-07-21 16:23:31 +02:00
Ozzieisaacs 3e008ef29b Fix update dates shown in local time format again
Fix "to update" history is shown again
2019-07-21 13:28:55 +02:00
Ozzieisaacs 5c6be5d6d0 Fix for python 3 and existing unrar entry in db
deleted unnecessary lines in config html template
2019-07-21 12:58:48 +02:00
Ozzieisaacs 2bd4eff56f Merge remote-tracking branch 'pwr/config_sql' into Develop 2019-07-21 09:50:18 +02:00
Ozzieisaacs 38f3c2d5b9 Reenabled multiple oauth provider
deleted duplicate download counting function
2019-07-21 09:45:36 +02:00
Ozzieisaacs c6542fdec6 New Oauth code 2019-07-20 20:01:05 +02:00
Ozzieisaacs 26a7d9ef30 Merge branch 'Develop'
# Conflicts:
#	cps/__init__.py
#	cps/about.py
#	cps/admin.py
#	cps/cli.py
#	cps/config_sql.py
#	cps/constants.py
#	cps/converter.py
#	cps/db.py
#	cps/editbooks.py
#	cps/gdriveutils.py
#	cps/helper.py
#	cps/logger.py
#	cps/oauth.py
#	cps/server.py
#	cps/services/simpleldap.py
#	cps/ub.py
#	cps/web.py
#	cps/worker.py
#	optional-requirements.txt
#	setup.cfg
#	setup.py
2019-07-17 19:07:05 +02:00
Daniel Pavel 847dbfc021 fixed custom columns handling on dispose 2019-07-17 11:42:19 +03:00
Ozzieisaacs 929f32335f Merge remote-tracking branch 'pwr/config_sql' into Develop 2019-07-16 21:15:06 +02:00
Ozzieisaacs 61a8eccf18 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	setup.cfg
2019-07-16 21:13:51 +02:00
Ozzieisaacs d01a0c6617 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	optional-requirements.txt
2019-07-16 21:09:24 +02:00
Ozzieisaacs d168e3bfdb Add licence to oauth
fix comicapi dependency
2019-07-16 21:08:37 +02:00
Ozzie Isaacs aba88ae53a
Update setup.cfg 2019-07-15 21:04:08 +02:00
Ozzie Isaacs 67d0ddb180
Update optional requirements 2019-07-15 21:03:35 +02:00
Ozzie Isaacs b1bb1cfdfa
Changed optional dependencies 2019-07-15 20:21:59 +02:00
Daniel Pavel 99c6247baf use the standard socket library to validate the ip address argument 2019-07-14 22:06:40 +03:00
Daniel Pavel a334ef28e7 about page: build the versions dictionary only once 2019-07-14 21:15:46 +03:00
Daniel Pavel 63634961d4 cleaner worker api
the worker thread now stops on its own
2019-07-14 20:28:32 +03:00
Ozzieisaacs d82289e303 Deactivate ldap
Fix setup for pypi
2019-07-14 18:37:44 +02:00
Daniel Pavel a836df9a5a more robust disposing of database session
avoid spamming the log with debug messages from libraries
2019-07-14 14:44:48 +03:00
Ozzieisaacs 8bfcdffeb6 Fix feature support 2019-07-14 13:20:40 +02:00
Ozzieisaacs e411c0fded Fix logging in debug mode 2019-07-14 09:18:37 +02:00
Ozzieisaacs 4708347c16 Merge branch 'Develop'
# Conflicts:
#	MANIFEST.in
#	README.md
#	cps/helper.py
#	cps/static/js/archive/archive.js
#	cps/translations/nl/LC_MESSAGES/messages.mo
#	cps/translations/nl/LC_MESSAGES/messages.po
#	cps/ub.py
#	cps/updater.py
#	cps/web.py
#	cps/worker.py
#	optional-requirements.txt
2019-07-13 20:54:21 +02:00
Ozzieisaacs 37736e11d5 Updated dependencies 2019-07-13 20:32:39 +02:00
Ozzieisaacs 792367e35e Version update 2019-07-13 20:27:32 +02:00
Ozzieisaacs be64961de5 Code cosmetics comic reader 2019-07-13 19:55:51 +02:00
Ozzieisaacs 405a3909b0 Fix for opds with LDAP authentication 2019-07-13 17:51:25 +02:00
Ozzieisaacs b1cb7123a3 Fix for #959 2019-07-11 20:37:03 +02:00
Ozzieisaacs e734bb120a Merge remote-tracking branch 'github/config_sql' into Develop 2019-07-09 19:29:58 +02:00
Daniel Pavel 006e596c72 Moved config class into separate file.
Moved Goodreads and LDAP services into separate package.
2019-07-07 16:05:51 +03:00
Ozzieisaacs 499a66dfb0 Additional glyphicons for music on search and author page
Fix duplicate user and email (now case insensitive)
Output of calibre on stderr is now logged (full traceback in debug-log, otherwise, only errormessage)
Natural sorting for comic reader
Fix for long running tasks
2019-07-06 14:46:25 +02:00
Ozzieisaacs f79d549910 Fix duplicate user and email (now case insensitive #948)
Fix sorting in comics (#950)
Fix log error on Calibre converter error (#953)
Fix long running tasks (#954)
2019-07-06 14:35:12 +02:00
Krakinou 11c8b47c39 Merge remote-tracking branch 'upstream/Develop' into Develop
Conflicts:
	cps/web.py
2019-07-01 22:58:11 +02:00
Krakinou 00a29f3d88 Check for change before encoding 2019-07-01 21:45:35 +02:00
Krakinou e5b9da5201 Error management 2019-07-01 21:44:58 +02:00
Ozzieisaacs ad44e58c7a Sorting for comics
Audiobook support
2019-06-29 14:23:39 +02:00
Ozzieisaacs 572b5427c7 Fix Encoding issues for python2 2019-06-23 21:11:45 +02:00
Ozzieisaacs 32af660f86 Improvements for logfile viewer
Fix for tornado-server with deactivated accesslog doesn't log to normal log anymore
Merge from master for unique user ids, get_metadata,
fix Goodreads integration
Update Translation (merge NL, update DE)
2019-06-22 19:55:59 +02:00
Ozzieisaacs 66283c542f Merge remote-tracking branch 'dutch/master' 2019-06-22 19:29:39 +02:00
Ozzieisaacs cc8a431532 Merge remote-tracking branch 'socket/unix-socket' into Develop 2019-06-21 09:46:03 +02:00
Ozzieisaacs 5c7aeb2f2c Change GDrive 2019-06-20 20:12:01 +02:00
Ozzie Isaacs c1d5f77fe8
Wiki link fixed 2019-06-20 10:38:32 +02:00
Daniel Pavel e254565901 support binding the http server to a unix socket file instead of TCP socket 2019-06-18 08:57:37 +03:00
Krakinou 3d0beba261 Base64 2019-06-17 23:47:35 +02:00
Krakinou 147947662c Base64 2019-06-17 23:46:38 +02:00
Heimen Stoffels d9f69ca264
Updated Dutch translation 2019-06-17 22:38:32 +02:00
Ozzieisaacs cd546eb6d4 Update comic reader js 2019-06-17 19:48:17 +02:00
Ozzieisaacs f40fc5aa75 Update LDAP 2019-06-16 08:59:25 +02:00
Ozzieisaacs 9b74d51f21 Merge remote-tracking branch 'ldap/master' into Develop
# Conflicts:
#	cps/server.py
#	cps/templates/config_edit.html
#	cps/ub.py
#	cps/updater.py
#	cps/web.py
#	optional-requirements-ldap.txt
#	setup.cfg
2019-06-16 08:20:01 +02:00
Ozzieisaacs d45b1b8ea5 Fix #937
logviewerintegrated
Code cosmetics
2019-06-15 21:18:13 +02:00
Ozzieisaacs e67d707867 Fix for #588
Merge remote-tracking branch 'linuxserver/master'
2019-06-15 11:58:55 +02:00
Krakinou 4437d7376d
Merge pull request #2 from Krakinou/flaskldap
Solve typo
2019-06-14 22:56:21 +02:00
Krakinou 304db0d20e Solve typo 2019-06-14 22:55:17 +02:00
Ozzieisaacs 3f5c6c1fa5 Fix #937 2019-06-13 20:01:37 +02:00
Ozzieisaacs 26949970d8 Revert logging functions
Fix access logger for tornado
2019-06-11 20:07:51 +02:00
Ozzieisaacs f5e3ed26b9 Fix for #935 2019-06-10 19:31:13 +02:00
Ozzieisaacs 8e4539cf8e Prevent delete of last admin user 2019-06-10 19:26:01 +02:00
Ozzieisaacs c81d4edb7d Fix for #923 2019-06-10 16:38:29 +02:00
Ozzieisaacs 546ed65e1d Update logging
Fix sort order author
Fixes sorting view
Moved version info
added feature limit listening to single ipaddress
2019-06-10 14:15:21 +02:00
Ozzieisaacs 14b6202eec Code cosmetics
Fixes func in helper,web
Fixes for pdf reader
fixes for calling from another folder
renamed to calibreweb for importing in python caller script
2019-06-08 13:45:27 +02:00
Ozzieisaacs 50973ffb72 Merge remote-tracking branch 'constants/Develop-logging-cleanup' into Develop 2019-06-08 06:52:41 +02:00
Krakinou 9a5ab97d78
Merge branch 'master' into master 2019-06-08 01:41:43 +02:00
Krakinou 6190e64956
Merge pull request #1 from Krakinou/flaskldap
Flaskldap integration
2019-06-08 01:03:59 +02:00
Krakinou 79286c9384 encode password 2019-06-08 00:54:45 +02:00
yjouanique c4e3f3670f Added public /reconnect endpoint 2019-06-07 12:15:31 +07:00
Daniel Pavel b89ab9ff10 logging clean-up
- moved most constants to separate file
- sorted and cleaned-up imports
- moved logging setup to separate file
2019-06-06 18:10:22 +03:00
Krakinou 97d12b94f6 Correct settings update 2019-06-04 00:47:49 +02:00
Krakinou e4d801bbaf initial flask_simpleldap implementation 2019-06-02 22:07:22 +02:00
Ozzieisaacs f736a15c12 Fix for restart of newer versions of tornado during update
Fix for updater with Beta Versions
2019-06-02 18:47:25 +02:00
Ozzieisaacs a02f949d23 Fix for updater with beta releases 2019-06-02 18:09:44 +02:00
Ozzieisaacs b4e0d039ef Revert setup.cfg file 2019-06-02 09:35:42 +02:00
Ozzieisaacs bb0d5c5538 Working for pip and "normal" start for python3 and python2 2019-06-02 09:33:45 +02:00
Ozzieisaacs f5b335e8e9 Update setup 2019-06-01 09:51:20 +02:00
Ozzieisaacs 67bd5d41aa Update Version info 2019-05-31 20:06:07 +02:00
Ozzieisaacs 1879dcb24a Merge remote-tracking branch 'setup/feature/setuptools-integration' into Develop 2019-05-31 19:48:09 +02:00
Ozzieisaacs 87ca05f129 Merge remote-tracking branch 'setup/feature/setuptools-integration' 2019-05-31 16:24:13 +02:00
Ozzieisaacs 6662a58cb0 Update translationfiles 2019-05-31 15:48:19 +02:00
Luke Murphy b3a286c0b5
Add initial setuptools integration 2019-05-31 11:54:05 +02:00
Ozzieisaacs 4fecce0a0d Merge branch 'master' into Develop
# Conflicts:
#	cps/helper.py
#	cps/static/js/archive/unrar.js
#	cps/templates/readcbr.html
#	cps/templates/readpdf.html
#	cps/translations/de/LC_MESSAGES/messages.mo
#	cps/translations/de/LC_MESSAGES/messages.po
#	cps/translations/es/LC_MESSAGES/messages.mo
#	cps/translations/es/LC_MESSAGES/messages.po
#	cps/translations/fr/LC_MESSAGES/messages.mo
#	cps/translations/fr/LC_MESSAGES/messages.po
#	cps/translations/it/LC_MESSAGES/messages.mo
#	cps/translations/it/LC_MESSAGES/messages.po
#	cps/translations/ja/LC_MESSAGES/messages.mo
#	cps/translations/ja/LC_MESSAGES/messages.po
#	cps/translations/km/LC_MESSAGES/messages.mo
#	cps/translations/km/LC_MESSAGES/messages.po
#	cps/translations/nl/LC_MESSAGES/messages.mo
#	cps/translations/nl/LC_MESSAGES/messages.po
#	cps/translations/pl/LC_MESSAGES/messages.mo
#	cps/translations/pl/LC_MESSAGES/messages.po
#	cps/translations/ru/LC_MESSAGES/messages.mo
#	cps/translations/ru/LC_MESSAGES/messages.po
#	cps/translations/sv/LC_MESSAGES/messages.mo
#	cps/translations/sv/LC_MESSAGES/messages.po
#	cps/translations/uk/LC_MESSAGES/messages.mo
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo
#	cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
#	cps/web.py
#	messages.pot
#	optional-requirements.txt
2019-05-31 11:17:47 +02:00
Ozzieisaacs 26e45f1f57 Merge remote-tracking branch 'comic-reader/master' 2019-05-31 08:43:51 +02:00
Ozzieisaacs df5d15d1a2 Merge remote-tracking branch 'comicapi/master' 2019-05-30 10:43:28 +02:00
Ozzieisaacs ecedf92783 Update version
Make custom columns visible (#904)
2019-05-30 10:21:11 +02:00
Ozzieisaacs d106ada9ed Changed version
Update translation
2019-05-30 09:07:52 +02:00
Ozzieisaacs ed91048a63 Fix for magic link with python 3 2019-05-26 11:31:09 +02:00
Ozzieisaacs f70c839014 Added additional permission viewer 2019-05-19 18:39:34 +02:00
Ozzieisaacs e6ff2f1d90 Fix file not found loading-icon.gif 2019-05-16 19:42:59 +02:00
subdiox 867aa2f0bd Beautify bitjs 2019-05-14 04:28:06 +09:00
subdiox 7982ed877c Downgrade bitjs to es5 branch 2019-05-13 14:53:25 +09:00
Ozzieisaacs 0c80f5c63a Update Teststatus 2019-05-12 19:44:52 +02:00
Ozzieisaacs 1030e195a5 Fix #916 2019-05-11 13:03:38 +02:00
subdiox c0d136ccd8 Fix slow loading 2019-05-10 08:16:03 +09:00
Ozzieisaacs 479b4b7d82 Update translations, integrated update of Italian translation 2019-05-08 20:24:10 +02:00
Ozzieisaacs a42ebdc096 Fix for #897 2019-05-07 19:54:13 +02:00
Ozzieisaacs 49ba221e85 Merge remote-tracking branch 'direction' 2019-05-07 18:54:27 +02:00
Ozzieisaacs 3b03aa30a6 Fix for advanced search 2019-05-06 20:51:44 +02:00
Ozzieisaacs cb0403a924 Merge remote-tracking branch 'adv_search/master' 2019-05-06 20:48:46 +02:00
Marvin Marx a2c7741e21 Fix "Internal Server Error" on advanced search
Custom boolean columns return that error if calibre does not have a
custom_column_1 in the DB, as this is queried in the removed line.
However the value is completely unused anyway -> removing.
2019-05-05 17:58:45 +02:00
Ozzieisaacs 55bb8d4590 Fix #900 2019-05-01 17:47:54 +02:00
Ozzieisaacs b80bfa5260 Improvement for #897 2019-04-29 19:01:30 +02:00
Ozzieisaacs f941908f73 Workaround for #889 2019-04-23 21:32:48 +02:00
Ozzieisaacs 9b3b2acb49 Sort button is correctly visible on list pages
Publisher list is working
2019-04-22 19:17:23 +02:00
Ozzieisaacs 406d1c76c9 Sorting and filtering of lists working (except file formats)
Refactored and bugfixing show_cover
Refactored import of helper in web.py
Fix for displaying /me (gettext) throwing error 500
Fix get search results throwing error 500
Fix routing books_list for python2.7
Fix for "me" and "settings" pages
Update sidebarview and list view
2019-04-22 19:11:35 +02:00
subdiox c2bfb29726 Add reading direction settings to readcbr page 2019-04-21 18:20:15 +09:00
subdiox 204de4aef6 Fix an issue that fullscreen doens't work on some browsers 2019-04-21 18:02:02 +09:00
subdiox 8b6d165d64 Fix Japanese translation 2019-04-21 17:53:40 +09:00
Ozzieisaacs bfd0e87a17 Merge branch 'master' into Develop
# Conflicts:
#	cps/helper.py
#	cps/reverseproxy.py
2019-04-21 08:50:31 +02:00
Ozzieisaacs 6a7b8c7870 Update Version info
Fix #816
Clarified licences for isolanguages.py and reverseproxy.py
2019-04-21 08:48:51 +02:00
Ozzieisaacs 2de4bfdcf2 Merge branch 'master' into Develop
# Conflicts:
#	cps/book_formats.py
#	cps/helper.py
#	cps/web.py
2019-04-20 18:32:46 +02:00
Ozzieisaacs f1a65a2aeb Clarified licences for isolanguages.py and reverseproxy.py 2019-04-20 17:57:06 +02:00
Ozzieisaacs 05da2ae3c7 Update search for cyrillic letters 2019-04-14 18:20:45 +02:00
Ozzieisaacs 4ae9d4a749 Merge branch 'master' into Develop
# Conflicts:
#	cps/web.py
#	cps/worker.py
2019-04-14 18:18:39 +02:00
Ozzieisaacs 2253708da7 Merge remote-tracking branch 'proxy/patch-1' into Develop 2019-04-14 10:54:09 +02:00
Ozzieisaacs 51e591bd25 Added updated translation 2019-04-13 16:46:06 +02:00
Ozzieisaacs 2a5f2ff7b3 Merge branch 'master' into Develop
# Conflicts:
#	cps/templates/readpdf.html
#	cps/translations/uk/LC_MESSAGES/messages.po
#	cps/web.py
2019-04-13 16:42:09 +02:00
Iris W 029d299067 updated comicapi version to fix installation error 2019-04-09 15:22:03 -04:00
Iris W b7e30644ab updated comicapi requirement—libunrar no longer necessary (CBR parsing support was always disabled anyway) 2019-04-03 15:36:05 -04:00
Iris Wildthyme cbdc9876b2 comicapi dependency now pippable 2019-04-02 20:58:23 -04:00
Iris Wildthyme 05d0f12608 redid comic importing support to handle metadata properly using comicapi from comictagger. needs work to automate installation 2019-04-02 18:52:45 -04:00
Ozzieisaacs 1c9ff6421d Fix uploader 2019-03-26 18:23:30 +01:00
Ozzieisaacs dc93222579 Update 2 column author list view 2019-03-26 17:54:12 +01:00
Ethan Lin 8143bc7873
Merge pull request #20 from janeczku/master
merge janeczku/master
2019-03-26 11:27:11 +08:00
Ozzieisaacs 772f978b45 Improved code quality 2019-03-24 16:24:43 +01:00
Ozzieisaacs 0f1db18eae Simplified typeahead 2019-03-24 16:14:42 +01:00
Ozzieisaacs 6940bb9b88 Code improvement 2019-03-24 15:58:43 +01:00
Ozzieisaacs 07649d04a3 Fix updater
Update translations
Code cleaning updater
2019-03-24 15:27:23 +01:00
Ozzieisaacs 39a3f70084 Fix for slow updater 2019-03-24 15:22:41 +01:00
tomjmul 8e8486497f Restirct a user to a set of tags 2019-03-19 13:53:41 +00:00
Ozzieisaacs e5593d9a7f Integrated author in sorting functions 2019-03-16 21:14:01 +01:00
Ozzieisaacs 3f2a9c8bae Code improvement 2019-03-16 17:33:15 +01:00
Ozzieisaacs 7c69589c5b Code cosmetics unrar.js 2019-03-16 17:30:24 +01:00
Ozzieisaacs 149e9b4bd4 Code cosmetis unrar 2019-03-16 17:28:21 +01:00
Ozzieisaacs a360b1759a Code cosmetics
bugfix import HttpError from pydrive
2019-03-16 17:20:14 +01:00
Ozzieisaacs 765b817384 Refactored shelf.py and editbooks.py 2019-03-16 16:53:22 +01:00
Ozzieisaacs baf83b2f5a Refactored generating download links 2019-03-16 16:23:40 +01:00
Ozzieisaacs 9c1b3f136f Improved sorting for rated,random, hot books, read/unread book 2019-03-16 15:48:09 +01:00
Ozzieisaacs a66873a9e2 Added file formats view 2019-03-11 18:42:30 +01:00
Ozzieisaacs 4a33278596 Update ratings 2019-03-10 19:22:35 +01:00
Ozzieisaacs 6d2270d931 Fixes for Oauth 2019-03-10 12:54:32 +01:00
Ozzieisaacs 1db1c2e7df Enabling LDAP working again
LDAP/Github oauth and Google oauth no credentials/parameters are rejected now
2019-03-10 11:12:44 +01:00
Ozzieisaacs da3fcb9a72 Merge branch 'master' into Develop
# Conflicts:
#	cps/book_formats.py
#	cps/static/css/style.css
#	cps/static/js/uploadprogress.js
#	cps/templates/author.html
#	cps/templates/detail.html
#	cps/templates/discover.html
#	cps/templates/index.html
#	cps/templates/layout.html
#	cps/templates/osd.xml
#	cps/templates/search.html
#	cps/templates/shelf.html
#	cps/translations/de/LC_MESSAGES/messages.mo
#	cps/translations/de/LC_MESSAGES/messages.po
#	cps/web.py
#	messages.pot
2019-03-10 08:31:10 +01:00
Ozzieisaacs 9144a7ceb9 Fix for sqlalchemy 1.3 2019-03-08 16:29:12 +01:00
Ozzieisaacs feb6a71f95 Fix uncompressed cbz files
merge from master -> file extension limitation
2019-03-05 20:59:30 +01:00
Ozzieisaacs 1561a4abdf Comic improvments 2019-03-05 20:19:02 +01:00
Ozzieisaacs f483ca3214 Code cosmetics
Bugfix uploadprogress
Bugfix mature content
Reenable read and unread feature
2019-03-05 17:34:51 +01:00
Ozzieisaacs 0224d45961 Code cosmetics 2019-03-04 20:03:09 +01:00
Ozzieisaacs 0be17ed157 Refactored sidebar (some parts are missing) 2019-03-04 19:34:29 +01:00
Ozzieisaacs f0de822ce7 Start refactor sidebar and view settings sidebar 2019-03-03 19:42:17 +01:00
Ozzieisaacs fb23db57b4 Added filtering of authors, series, categories, publishers 2019-03-03 15:37:53 +01:00
Ozzieisaacs fda977b155 Fix for users with umlauts 2019-03-03 08:38:36 +01:00
Ozzieisaacs 68a36597ab Fix opds login on python3 2019-03-03 07:37:15 +01:00
Ozzieisaacs de58d0a4d8 Merge remote-tracking branch 'metadata/Develop' into Develop
Update logger for updater
2019-03-01 19:09:37 +01:00
jianyun.zhao 54a006a420 [fix] Add a scroll bar to a long list of meta information 2019-03-01 10:57:27 +08:00
Ozzieisaacs 246d7673a9 Corrected file header with copyright information 2019-02-27 18:20:50 +01:00
Ozzieisaacs eef4787b79 Merge remote-tracking branch 'github/patch-1' into Develop
Oauth is optional again
2019-02-24 19:34:57 +01:00
Ozzieisaacs 1de3929988 Unicode 2019-02-24 19:08:24 +01:00
Ozzieisaacs cc3088c52f Merge branch 'master' into Develop
# Conflicts:
#	cps/book_formats.py
#	cps/static/js/libs/bootstrap.min.js
#	cps/templates/detail.html
#	cps/templates/layout.html
#	cps/web.py

Improvement updater (up to 100 releases are loaded at once)
Fix oauth pathes
Fix oauth without registering
2019-02-24 10:39:37 +01:00
Ozzieisaacs 0facb8fffa Fix #766 2019-02-23 18:28:25 +01:00
Ozzieisaacs 1a7052b287 Update pdf upload
Translation of uploadprogress dialog
2019-02-23 14:26:02 +01:00
AngelByDay 38307ececb
Force namespace resolution of imports
The current import for some local modules causes errors when those already exist in site-packages on the target system.
Namely "import db" is ambiguous and may cause errors due to loading of the 'db' PyPI package instead of the module.
2019-02-22 12:24:51 -05:00
Ozzieisaacs e92497b34e Merge branch 'master' into Develop
# Conflicts:
#	cps/gdriveutils.py
#	cps/helper.py
2019-02-20 18:09:42 +01:00
Ozzieisaacs 3d5d95904a Oauth working somehow (?) 2019-02-17 19:10:16 +01:00
Ozzieisaacs a0be02e687 Ldap working 2019-02-17 09:09:20 +01:00
Ozzieisaacs 37007dafee Merge branch 'master' into Develop
# Conflicts:
#	cps/templates/layout.html
#	cps/web.py
#	readme.md
2019-02-16 10:17:46 +01:00
Ozzieisaacs 4230226716 Link fixes
Fixes reader button visible in detail view
Fix formats to convert (added htmlz)
Fix logger in updater
Added request "v3" of github api on update
Fix quotes parameter on external calls
E-Mail logger working more stable (also on python3)
Routing fixes
Change import in ub
2019-02-16 07:23:36 +01:00
Ozzieisaacs 1dc6f44828 Merge branch 'master' into Develop 2019-02-10 07:56:18 +01:00
Ozzieisaacs c1ef1bcd19 User and admin pages are working again 2019-02-09 21:26:17 +01:00
Ozzieisaacs 1fc4bc5204 Fix routes
Fix error page
2019-02-09 19:01:57 +01:00
Ozzieisaacs f5235b1d4c Uploader progress bar
Fixes imports and routes
Merge branch 'master' into Develop
Finished routing
2019-02-09 18:46:41 +01:00
Ozzieisaacs d6ee8f75e9 More refactoring 2019-02-08 20:12:16 +01:00
Ozzieisaacs a00d93a2d9 Working again (basically) 2019-02-06 21:52:32 +01:00
Ozzieisaacs 561d40f8ff Merge branch 'master' into Develop 2019-02-03 20:30:37 +01:00
Ozzieisaacs 36229076f7 Refactor subprocess calls 2019-02-03 18:32:27 +01:00
Ozzieisaacs 7f34073955 Merge branch 'master' into Develop
# Conflicts:
#	cps/web.py
#	readme.md
2019-02-03 17:33:54 +01:00
Ozzieisaacs b75b91606c Fix config oauth-UI 2019-01-27 11:32:16 +01:00
Ozzieisaacs 80582573f5 Merge remote-tracking branch 'oauth/oauth' into Develop
# Conflicts:
#	cps/templates/config_edit.html
#	cps/ub.py
#	cps/web.py
2019-01-27 11:22:22 +01:00
Ozzieisaacs 3683e4e7eb Merge remote-tracking branch 'ldap/master' into Develop 2019-01-27 11:18:08 +01:00
Ozzieisaacs 8ababf9f77 Merge remote-tracking branch 'simple_shelf/shelf-down' into Develop 2019-01-27 11:16:11 +01:00
Ozzieisaacs 5971194678 Merge remote-tracking branch 'audiobook/Branch_c27805b'
# Conflicts:
#	cps/templates/detail.html
#	cps/web.py
#	readme.md
2019-01-27 11:14:38 +01:00
Krakinou d48cdcc789 Correct authentication in case LDAP not activated 2019-01-13 11:21:11 +01:00
Krakinou d763168dec Merge branch 'master' of https://github.com/Krakinou/calibre-web 2019-01-13 11:04:32 +01:00
Krakinou 7ccc40cf5b Moving import LDAP
Correct optional-requirements-ldap.txt spelling
2019-01-13 11:02:03 +01:00
Krakinou aafb267787
Merge branch 'master' into master 2019-01-12 23:46:59 +01:00
Krakinou 82e4f11334 Forgot requirements :/ 2019-01-12 19:24:21 +01:00
Krakinou 2e37c14d94 Clean some comment 2019-01-12 18:40:32 +01:00
Krakinou 91f0908059 insert into db
connect via LDAP config
2019-01-12 18:07:03 +01:00
Krakinou 8d284b151d Edit html config 2019-01-12 12:52:27 +01:00
Krakinou 30954cc27f Initial LDAP support 2019-01-10 23:51:01 +01:00
Jim Ma 4b76b8400d Add OAuth link&unlink in user profile 2018-10-14 16:51:00 +08:00
Jim Ma 1abbcfa3c6 Add OAuth support: GitHub & Google 2018-10-14 16:51:00 +08:00
otapi 9b4ca22254
Update shelf.html 2018-10-11 18:39:31 +02:00
otapi c6d3613e57
Add UI link button to shelves 2018-10-11 18:20:38 +02:00
otapi e0229c917c
Download only shelf
Show only titles and download button for specific shelf. Currently only direct link works, e.g: calibre-web/shelfdown/6
2018-10-10 23:01:05 +02:00
1040 changed files with 286323 additions and 161677 deletions

3
.gitattributes vendored
View File

@ -1,4 +1,5 @@
updater.py ident export-subst
constants.py ident export-subst
/test export-ignore
/library export-ignore
cps/static/css/libs/* linguist-vendored
cps/static/js/libs/* linguist-vendored

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
custom: ["https://PayPal.Me/calibreweb",]

55
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,55 @@
---
name: Bug/Problem report
about: Create a report to help us improve Calibre-Web
title: ''
labels: ''
assignees: ''
---
## Short Notice from the maintainer
After 6 years of more or less intensive programming on Calibre-Web, I need a break.
The last few months, maintaining Calibre-Web has felt more like work than a hobby. I felt pressured and teased by people to solve "their" problems and merge PRs for "their" Calibre-Web.
I have turned off all notifications from Github/Discord and will now concentrate undisturbed on the development of “my” Calibre-Web over the next few weeks/months.
I will look into the issues and maybe also the PRs from time to time, but don't expect a quick response from me.
Please also have a look at our [Contributing Guidelines](https://github.com/janeczku/calibre-web/blob/master/CONTRIBUTING.md)
**Describe the bug/problem**
A clear and concise description of what the bug is. If you are asking for support, please check our [Wiki](https://github.com/janeczku/calibre-web/wiki) if your question is already answered there.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Logfile**
Add content of calibre-web.log file or the relevant error, try to reproduce your problem with "debug" log-level to get more output.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
- OS: [e.g. Windows 10/Raspberry Pi OS]
- Python version: [e.g. python2.7]
- Calibre-Web version: [e.g. 0.6.8 or 087c4c59 (git rev-parse --short HEAD)]:
- Docker container: [None/LinuxServer]:
- Special Hardware: [e.g. Rasperry Pi Zero]
- Browser: [e.g. Chrome 83.0.4103.97, Safari 13.3.7, Firefox 68.0.1 ESR]
**Additional context**
Add any other context about the problem here. [e.g. access via reverse proxy, database background sync, special database location]

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1 @@
blank_issues_enabled: false

View File

@ -0,0 +1,29 @@
---
name: Feature request
about: Suggest an idea for Calibre-Web
title: ''
labels: ''
assignees: ''
---
# Short Notice from the maintainer
After 6 years of more or less intensive programming on Calibre-Web, I need a break.
The last few months, maintaining Calibre-Web has felt more like work than a hobby. I felt pressured and teased by people to solve "their" problems and merge PRs for "their" Calibre-Web.
I have turned off all notifications from Github/Discord and will now concentrate undisturbed on the development of “my” Calibre-Web over the next few weeks/months.
I will look into the issues and maybe also the PRs from time to time, but don't expect a quick response from me.
Please have a look at our [Contributing Guidelines](https://github.com/janeczku/calibre-web/blob/master/CONTRIBUTING.md)
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

16
.gitignore vendored
View File

@ -6,26 +6,32 @@ __pycache__/
# Distribution / packaging
.Python
.python-version
env/
venv/
eggs/
dist/
executable/
build/
vendor/
.eggs/
*.egg-info/
.installed.cfg
*.egg
.pylint.d
# calibre-web
*.db
*.log
config.ini
cps/static/[0-9]*
cps/cache
.idea/
*.bak
*.log.*
tags
.key
settings.yaml
gdrive_credentials
vendor
client_secrets.json
gmail.json
/.key

46
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,46 @@
## How to contribute to Calibre-Web
First of all, we would like to thank you for reading this text. We are happy you are willing to contribute to Calibre-Web.
### **General**
**Communication language** is English. Google translated texts are not as bad as you might think, they are usually understandable, so don't worry if you generate your post that way.
**Calibre-Web** is not **Calibre**. If you are having a question regarding Calibre please post this at their [repository](https://github.com/kovidgoyal/calibre).
**Docker-Containers** of Calibre-Web are maintained by different persons than the people who drive Calibre-Web. If we come to the conclusion during our analysis that the problem is related to Docker, we might ask you to open a new issue at the repository of the Docker Container.
If you are having **Basic Installation Problems** with python or its dependencies, please consider using your favorite search engine to find a solution. In case you can't find a solution, we are happy to help you.
We can offer only very limited support regarding configuration of **Reverse-Proxy Installations**, **OPDS-Reader** or other programs in combination with Calibre-Web.
### **Translation**
Some of the user languages in Calibre-Web having missing translations. We are happy to add the missing texts if you translate them. Create a Pull Request, create an issue with the .po file attached, or write an email to "ozzie.fernandez.isaacs@googlemail.com" with attached translation file. To display all book languages in your native language an additional file is used (iso_language_names.py). The content of this file is auto-generated with the corresponding translations of Calibre, please do not edit this file on your own.
### **Documentation**
The Calibre-Web documentation is hosted in the Github [Wiki](https://github.com/janeczku/calibre-web/wiki). The Wiki is open to everybody, if you find a problem, feel free to correct it. If information is missing, you are welcome to add it. The content will be reviewed time by time. Please try to be consistent with the form with the other Wiki pages (e.g. the project name is Calibre-Web with 2 capital letters and a dash in between).
### **Reporting a bug**
Do not open up a GitHub issue if the bug is a **security vulnerability** in Calibre-Web. Instead, please write an email to "ozzie.fernandez.isaacs@googlemail.com".
Ensure the **bug was not already reported** by searching on GitHub under [Issues](https://github.com/janeczku/calibre-web/issues). Please also check if a solution for your problem can be found in the [wiki](https://github.com/janeczku/calibre-web/wiki).
If you're unable to find an **open issue** addressing the problem, open a [new one](https://github.com/janeczku/calibre-web/issues/new/choose). Be sure to include a **title** and **clear description**, as much relevant information as possible, the **issue form** helps you providing the right information. Deleting the form and just pasting the stack trace doesn't speed up fixing the problem. If your issue could be resolved, consider closing the issue.
### **Feature Request**
If there is a feature missing in Calibre-Web and you can't find a feature request in the [Issues](https://github.com/janeczku/calibre-web/issues) section, you could create a [feature request](https://github.com/janeczku/calibre-web/issues/new?assignees=&labels=&template=feature_request.md&title=).
We will not extend Calibre-Web with any more login abilities or add further files storages, or file syncing ability. Furthermore Calibre-Web is made for home usage for company in-house usage, so requests regarding any sorts of social interaction capability, payment routines, search engine or web site analytics integration will not be implemented.
### **Contributing code to Calibre-Web**
Open a new GitHub pull request with the patch. Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
In case your code enhances features of Calibre-Web: Create your pull request for the development branch if your enhancement consists of more than some lines of code in a local section of Calibre-Webs code. This makes it easier to test it and check all implication before it's made public.
Please check if your code runs with python 3, python 2 is no longer supported. If possible and the feature is related to operating system functions, try to check it on Windows and Linux.
Calibre-Web is automatically tested on Linux in combination with python 3.8. The code for testing is in a [separate repo](https://github.com/OzzieIsaacs/calibre-web-test) on Github. It uses unit tests and performs real system tests with selenium; it would be great if you could consider also writing some tests.
A static code analysis is done by Codacy, but it's partly broken and doesn't run automatically. You could check your code with ESLint before contributing, a configuration file can be found in the projects root folder.

1
MANIFEST.in Normal file
View File

@ -0,0 +1 @@
graft src/calibreweb

125
README.md Executable file
View File

@ -0,0 +1,125 @@
# Short Notice from the maintainer
After 6 years of more or less intensive programming on Calibre-Web, I need a break.
The last few months, maintaining Calibre-Web has felt more like work than a hobby. I felt pressured and teased by people to solve "their" problems and merge PRs for "their" Calibre-Web.
I have turned off all notifications from Github/Discord and will now concentrate undisturbed on the development of “my” Calibre-Web over the next few weeks/months.
I will look into the issues and maybe also the PRs from time to time, but don't expect a quick response from me.
# Calibre-Web
Calibre-Web is a web app that offers a clean and intuitive interface for browsing, reading, and downloading eBooks using a valid [Calibre](https://calibre-ebook.com) database.
[![License](https://img.shields.io/github/license/janeczku/calibre-web?style=flat-square)](https://github.com/janeczku/calibre-web/blob/master/LICENSE)
![Commit Activity](https://img.shields.io/github/commit-activity/w/janeczku/calibre-web?logo=github&style=flat-square&label=commits)
[![All Releases](https://img.shields.io/github/downloads/janeczku/calibre-web/total?logo=github&style=flat-square)](https://github.com/janeczku/calibre-web/releases)
[![PyPI](https://img.shields.io/pypi/v/calibreweb?logo=pypi&logoColor=fff&style=flat-square)](https://pypi.org/project/calibreweb/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/calibreweb?logo=pypi&logoColor=fff&style=flat-square)](https://pypi.org/project/calibreweb/)
[![Discord](https://img.shields.io/discord/838810113564344381?label=Discord&logo=discord&style=flat-square)](https://discord.gg/h2VsJ2NEfB)
<details>
<summary><strong>Table of Contents</strong> (click to expand)</summary>
1. [About](#calibre-web)
2. [Features](#features)
3. [Installation](#installation)
- [Installation via pip (recommended)](#installation-via-pip-recommended)
- [Quick start](#quick-start)
- [Requirements](#requirements)
4. [Docker Images](#docker-images)
5. [Contributor Recognition](#contributor-recognition)
6. [Contact](#contact)
7. [Contributing to Calibre-Web](#contributing-to-calibre-web)
</details>
*This software is a fork of [library](https://github.com/mutschler/calibreserver) and licensed under the GPL v3 License.*
![Main screen](https://github.com/janeczku/calibre-web/wiki/images/main_screen.png)
## Features
- Modern and responsive Bootstrap 3 HTML5 interface
- Full graphical setup
- Comprehensive user management with fine-grained per-user permissions
- Admin interface
- Multilingual user interface supporting 20+ languages ([supported languages](https://github.com/janeczku/calibre-web/wiki/Translation-Status))
- OPDS feed for eBook reader apps
- Advanced search and filtering options
- Custom book collection (shelves) creation
- eBook metadata editing and deletion support
- Metadata download from various sources (extensible via plugins)
- eBook conversion through Calibre binaries
- eBook download restriction to logged-in users
- Public user registration support
- Send eBooks to E-Readers with a single click
- Sync Kobo devices with your Calibre library
- In-browser eBook reading support for multiple formats
- Upload new books in various formats, including audio formats
- Calibre Custom Columns support
- Content hiding based on categories and Custom Column content per user
- Self-update capability
- "Magic Link" login for easy access on eReaders
- LDAP, Google/GitHub OAuth, and proxy authentication support
## Installation
#### Installation via pip (recommended)
1. Create a virtual environment for Calibre-Web to avoid conflicts with existing Python dependencies
2. Install Calibre-Web via pip: `pip install calibreweb` (or `pip3` depending on your OS/distro)
3. Install optional features via pip as needed, see [this page](https://github.com/janeczku/calibre-web/wiki/Dependencies-in-Calibre-Web-Linux-and-Windows) for details
4. Start Calibre-Web by typing `cps`
*Note: Raspberry Pi OS users may encounter issues during installation. If so, please update pip (`./venv/bin/python3 -m pip install --upgrade pip`) and/or install cargo (`sudo apt install cargo`) before retrying the installation.*
Refer to the Wiki for additional installation examples: [manual installation](https://github.com/janeczku/calibre-web/wiki/Manual-installation), [Linux Mint](https://github.com/janeczku/calibre-web/wiki/How-To:-Install-Calibre-Web-in-Linux-Mint-19-or-20), [Cloud Provider](https://github.com/janeczku/calibre-web/wiki/How-To:-Install-Calibre-Web-on-a-Cloud-Provider).
## Quick Start
1. Open your browser and navigate to `http://localhost:8083` or `http://localhost:8083/opds` for the OPDS catalog
2. Log in with the default admin credentials
3. If you don't have a Calibre database, you can use [this database](https://github.com/janeczku/calibre-web/raw/master/library/metadata.db) (move it out of the Calibre-Web folder to prevent overwriting during updates)
4. Set `Location of Calibre database` to the path of the folder containing your Calibre library (metadata.db) and click "Save"
5. Optionally, use Google Drive to host your Calibre library by following the [Google Drive integration guide](https://github.com/janeczku/calibre-web/wiki/G-Drive-Setup#using-google-drive-integration)
6. Configure your Calibre-Web instance via the admin page, referring to the [Basic Configuration](https://github.com/janeczku/calibre-web/wiki/Configuration#basic-configuration) and [UI Configuration](https://github.com/janeczku/calibre-web/wiki/Configuration#ui-configuration) guides
#### Default Admin Login:
- **Username:** admin
- **Password:** admin123
## Requirements
- Python 3.5+
- [Imagemagick](https://imagemagick.org/script/download.php) for cover extraction from EPUBs (Windows users may need to install [Ghostscript](https://ghostscript.com/releases/gsdnld.html) for PDF cover extraction)
- Optional: [Calibre desktop program](https://calibre-ebook.com/download) for on-the-fly conversion and metadata editing (set "calibre's converter tool" path on the setup page)
- Optional: [Kepubify tool](https://github.com/pgaskin/kepubify/releases/latest) for Kobo device support (place the binary in `/opt/kepubify` on Linux or `C:\Program Files\kepubify` on Windows)
## Docker Images
Pre-built Docker images are available in the following Docker Hub repositories (maintained by the LinuxServer team):
#### **LinuxServer - x64, aarch64**
- [Docker Hub](https://hub.docker.com/r/linuxserver/calibre-web)
- [GitHub](https://github.com/linuxserver/docker-calibre-web)
- [GitHub - Optional Calibre layer](https://github.com/linuxserver/docker-mods/tree/universal-calibre)
Include the environment variable `DOCKER_MODS=linuxserver/mods:universal-calibre` in your Docker run/compose file to add the Calibre `ebook-convert` binary (x64 only). Omit this variable for a lightweight image.
Both the Calibre-Web and Calibre-Mod images are automatically rebuilt on new releases and updates.
- Set "path to convertertool" to `/usr/bin/ebook-convert`
- Set "path to unrar" to `/usr/bin/unrar`
## Contributor Recognition
We would like to thank all the [contributors](https://github.com/janeczku/calibre-web/graphs/contributors) and maintainers of Calibre-Web for their valuable input and dedication to the project. Your contributions are greatly appreciated.
## Contact
Join us on [Discord](https://discord.gg/h2VsJ2NEfB)
For more information, How To's, and FAQs, please visit the [Wiki](https://github.com/janeczku/calibre-web/wiki)
## Contributing to Calibre-Web
Check out our [Contributing Guidelines](https://github.com/janeczku/calibre-web/blob/master/CONTRIBUTING.md)

52
SECURITY.md Normal file
View File

@ -0,0 +1,52 @@
# Security Policy
## Reporting a Vulnerability
Please report security issues to ozzie.fernandez.isaacs@googlemail.com
## Supported Versions
To receive fixes for security vulnerabilities it is required to always upgrade to the latest version of Calibre-Web. See https://github.com/janeczku/calibre-web/releases/latest for the latest release.
## History
| Fixed in | Description |CVE number |
|---------------|--------------------------------------------------------------------------------------------------------------------|---------|
| 3rd July 2018 | Guest access acts as a backdoor ||
| V 0.6.7 | Hardcoded secret key for sessions |CVE-2020-12627 |
| V 0.6.13 | Calibre-Web Metadata cross site scripting |CVE-2021-25964|
| V 0.6.13 | Name of Shelves are only visible to users who can access the corresponding shelf Thanks to @ibarrionuevo ||
| V 0.6.13 | JavaScript could get executed in the description field. Thanks to @ranjit-git and Hagai Wechsler (WhiteSource) ||
| V 0.6.13 | JavaScript could get executed in a custom column of type "comment" field ||
| V 0.6.13 | JavaScript could get executed after converting a book to another format with a title containing javascript code ||
| V 0.6.13 | JavaScript could get executed after converting a book to another format with a username containing javascript code ||
| V 0.6.13 | JavaScript could get executed in the description series, categories or publishers title ||
| V 0.6.13 | JavaScript could get executed in the shelf title ||
| V 0.6.13 | Login with the old session cookie after logout. Thanks to @ibarrionuevo ||
| V 0.6.14 | CSRF was possible. Thanks to @mik317 and Hagai Wechsler (WhiteSource) |CVE-2021-25965|
| V 0.6.14 | Migrated some routes to POST-requests (CSRF protection). Thanks to @scara31 |CVE-2021-4164|
| V 0.6.15 | Fix for "javascript:" script links in identifier. Thanks to @scara31 |CVE-2021-4170|
| V 0.6.15 | Cross-Site Scripting vulnerability on uploaded cover file names. Thanks to @ibarrionuevo ||
| V 0.6.15 | Creating public shelfs is now denied if user is missing the edit public shelf right. Thanks to @ibarrionuevo ||
| V 0.6.15 | Changed error message in case of trying to delete a shelf unauthorized. Thanks to @ibarrionuevo ||
| V 0.6.16 | JavaScript could get executed on authors page. Thanks to @alicaz |CVE-2022-0352|
| V 0.6.16 | Localhost can no longer be used to upload covers. Thanks to @scara31 |CVE-2022-0339|
| V 0.6.16 | Another case where public shelfs could be created without permission is prevented. Thanks to @nhiephon |CVE-2022-0273|
| V 0.6.16 | It's prevented to get the name of a private shelfs. Thanks to @nhiephon |CVE-2022-0405|
| V 0.6.17 | The SSRF Protection can no longer be bypassed via an HTTP redirect. Thanks to @416e6e61 |CVE-2022-0767|
| V 0.6.17 | The SSRF Protection can no longer be bypassed via 0.0.0.0 and it's ipv6 equivalent. Thanks to @r0hanSH |CVE-2022-0766|
| V 0.6.18 | Possible SQL Injection is prevented in user table Thanks to Iman Sharafaldin (Forward Security) |CVE-2022-30765|
| V 0.6.18 | The SSRF protection no longer can be bypassed by IPV6/IPV4 embedding. Thanks to @416e6e61 |CVE-2022-0939|
| V 0.6.18 | The SSRF protection no longer can be bypassed to connect to other servers in the local network. Thanks to @michaellrowley |CVE-2022-0990|
| V 0.6.20 | Credentials for emails are now stored encrypted ||
| V 0.6.20 | Login is rate limited ||
| V 0.6.20 | Passwordstrength can be forced ||
| V 0.6.21 | SMTP server credentials are no longer returned to client ||
| V 0.6.21 | Cross-site scripting (XSS) stored in href bypasses filter using data wrapper no longer possible ||
| V 0.6.21 | Cross-site scripting (XSS) is no longer possible via pathchooser ||
| V 0.6.21 | Error Handling at non existent rating, language, and user downloaded books was fixed ||
## Statement regarding Log4j (CVE-2021-44228 and related)
Calibre-web is not affected by bugs related to Log4j. Calibre-Web is a python program, therefore not using Java, and not using the Java logging feature log4j.

View File

@ -1,3 +1,4 @@
[python: **.py]
# has to be executed with jinja2 >=2.9 to have autoescape enabled automatically
[jinja2: **/templates/**.*ml]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

31
cps.py
View File

@ -1,21 +1,34 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2022 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
base_path = os.path.dirname(os.path.abspath(__file__))
# Insert local directories into path
sys.path.append(base_path)
sys.path.append(os.path.join(base_path, 'cps'))
sys.path.append(os.path.join(base_path, 'vendor'))
from cps.server import Server
# Add local path to sys.path, so we can import cps
path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, path)
from cps.main import main
if __name__ == '__main__':
Server.startServer()
main()

52
cps/MyLoginManager.py Normal file
View File

@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler, GammaC0de, vuolter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from flask_login import LoginManager, confirm_login
from flask import session, current_app
from flask_login.utils import decode_cookie
from flask_login.signals import user_loaded_from_cookie
class MyLoginManager(LoginManager):
def _session_protection_failed(self):
sess = session._get_current_object()
ident = self._session_identifier_generator()
if(sess and not (len(sess) == 1
and sess.get('csrf_token', None))) and ident != sess.get('_id', None):
return super(). _session_protection_failed()
return False
def _load_user_from_remember_cookie(self, cookie):
user_id = decode_cookie(cookie)
if user_id is not None:
session["_user_id"] = user_id
session["_fresh"] = False
user = None
if self._user_callback:
user = self._user_callback(user_id)
if user is not None:
app = current_app._get_current_object()
user_loaded_from_cookie.send(app, user=user)
# if session was restored from remember me cookie make login valid
confirm_login()
return user
return None

View File

@ -1,2 +1,212 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__package__ = "cps"
import sys
import os
import mimetypes
from flask import Flask
from .MyLoginManager import MyLoginManager
from flask_principal import Principal
from . import logger
from .cli import CliParameter
from .constants import CONFIG_DIR
from .reverseproxy import ReverseProxied
from .server import WebServer
from .dep_check import dependency_check
from .updater import Updater
from .babel import babel, get_locale
from . import config_sql
from . import cache_buster
from . import ub, db
try:
from flask_limiter import Limiter
limiter_present = True
except ImportError:
limiter_present = False
try:
from flask_wtf.csrf import CSRFProtect
wtf_present = True
except ImportError:
wtf_present = False
mimetypes.init()
mimetypes.add_type('application/xhtml+xml', '.xhtml')
mimetypes.add_type('application/epub+zip', '.epub')
mimetypes.add_type('application/fb2+zip', '.fb2')
mimetypes.add_type('application/x-mobipocket-ebook', '.mobi')
mimetypes.add_type('application/x-mobipocket-ebook', '.prc')
mimetypes.add_type('application/vnd.amazon.ebook', '.azw')
mimetypes.add_type('application/x-mobi8-ebook', '.azw3')
mimetypes.add_type('application/x-cbr', '.cbr')
mimetypes.add_type('application/x-cbz', '.cbz')
mimetypes.add_type('application/x-cbt', '.cbt')
mimetypes.add_type('application/x-cb7', '.cb7')
mimetypes.add_type('image/vnd.djv', '.djv')
mimetypes.add_type('application/mpeg', '.mpeg')
mimetypes.add_type('application/mpeg', '.mp3')
mimetypes.add_type('application/mp4', '.m4a')
mimetypes.add_type('application/mp4', '.m4b')
mimetypes.add_type('application/ogg', '.ogg')
mimetypes.add_type('application/ogg', '.oga')
mimetypes.add_type('text/css', '.css')
mimetypes.add_type('text/javascript; charset=UTF-8', '.js')
log = logger.create()
app = Flask(__name__)
app.config.update(
SESSION_COOKIE_HTTPONLY=True,
SESSION_COOKIE_SAMESITE='Lax',
REMEMBER_COOKIE_SAMESITE='Lax', # will be available in flask-login 0.5.1 earliest
WTF_CSRF_SSL_STRICT=False
)
lm = MyLoginManager()
cli_param = CliParameter()
config = config_sql.ConfigSQL()
if wtf_present:
csrf = CSRFProtect()
else:
csrf = None
calibre_db = db.CalibreDB()
web_server = WebServer()
updater_thread = Updater()
if limiter_present:
limiter = Limiter(key_func=True, headers_enabled=True, auto_check=False, swallow_errors=False)
else:
limiter = None
def create_app():
if csrf:
csrf.init_app(app)
cli_param.init()
ub.init_db(cli_param.settings_path)
# pylint: disable=no-member
encrypt_key, error = config_sql.get_encryption_key(os.path.dirname(cli_param.settings_path))
config_sql.load_configuration(ub.session, encrypt_key)
config.init_config(ub.session, encrypt_key, cli_param)
if error:
log.error(error)
ub.password_change(cli_param.user_credentials)
if sys.version_info < (3, 0):
log.info(
'*** Python2 is EOL since end of 2019, this version of Calibre-Web is no longer supporting Python2, '
'please update your installation to Python3 ***')
print(
'*** Python2 is EOL since end of 2019, this version of Calibre-Web is no longer supporting Python2, '
'please update your installation to Python3 ***')
web_server.stop(True)
sys.exit(5)
lm.login_view = 'web.login'
lm.anonymous_user = ub.Anonymous
lm.session_protection = 'strong' if config.config_session == 1 else "basic"
db.CalibreDB.update_config(config)
db.CalibreDB.setup_db(config.config_calibre_dir, cli_param.settings_path)
calibre_db.init_db()
updater_thread.init_updater(config, web_server)
# Perform dry run of updater and exit afterward
if cli_param.dry_run:
updater_thread.dry_run()
sys.exit(0)
updater_thread.start()
requirements = dependency_check()
for res in requirements:
if res['found'] == "not installed":
message = ('Cannot import {name} module, it is needed to run calibre-web, '
'please install it using "pip install {name}"').format(name=res["name"])
log.info(message)
print("*** " + message + " ***")
web_server.stop(True)
sys.exit(8)
for res in requirements + dependency_check(True):
log.info('*** "{}" version does not meet the requirements. '
'Should: {}, Found: {}, please consider installing required version ***'
.format(res['name'],
res['target'],
res['found']))
app.wsgi_app = ReverseProxied(app.wsgi_app)
if os.environ.get('FLASK_DEBUG'):
cache_buster.init_cache_busting(app)
log.info('Starting Calibre Web...')
Principal(app)
lm.init_app(app)
app.secret_key = os.getenv('SECRET_KEY', config_sql.get_flask_session_key(ub.session))
web_server.init_app(app, config)
if hasattr(babel, "localeselector"):
babel.init_app(app)
babel.localeselector(get_locale)
else:
babel.init_app(app, locale_selector=get_locale)
from . import services
if services.ldap:
services.ldap.init_app(app, config)
if services.goodreads_support:
services.goodreads_support.connect(config.config_goodreads_api_key,
config.config_use_goodreads)
config.store_calibre_uuid(calibre_db, db.Library_Id)
# Configure rate limiter
# https://limits.readthedocs.io/en/stable/storage.html
app.config.update(RATELIMIT_ENABLED=config.config_ratelimiter)
if config.config_limiter_uri != "" and not cli_param.memory_backend:
app.config.update(RATELIMIT_STORAGE_URI=config.config_limiter_uri)
if config.config_limiter_options != "":
app.config.update(RATELIMIT_STORAGE_OPTIONS=config.config_limiter_options)
try:
limiter.init_app(app)
except Exception as e:
log.error('Wrong Flask Limiter configuration, falling back to default: {}'.format(e))
app.config.update(RATELIMIT_STORAGE_URI=None)
limiter.init_app(app)
# Register scheduled tasks
from .schedule import register_scheduled_tasks, register_startup_tasks
register_scheduled_tasks(config.schedule_reconnect)
register_startup_tasks()
return app

84
cps/about.py Normal file
View File

@ -0,0 +1,84 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import platform
import sqlite3
from collections import OrderedDict
import flask
import flask_login
import jinja2
from flask_babel import gettext as _
from . import db, calibre_db, converter, uploader, constants, dep_check
from .render_template import render_title_template
about = flask.Blueprint('about', __name__)
modules = dict()
req = dep_check.load_dependencies(False)
opt = dep_check.load_dependencies(True)
for i in (req + opt):
modules[i[1]] = i[0]
modules['Jinja2'] = jinja2.__version__
modules['pySqlite'] = sqlite3.version
modules['SQLite'] = sqlite3.sqlite_version
sorted_modules = OrderedDict((sorted(modules.items(), key=lambda x: x[0].casefold())))
def collect_stats():
if constants.NIGHTLY_VERSION[0] == "$Format:%H$":
calibre_web_version = constants.STABLE_VERSION['version'].replace("b", " Beta")
else:
calibre_web_version = (constants.STABLE_VERSION['version'].replace("b", " Beta") + ' - '
+ constants.NIGHTLY_VERSION[0].replace('%', '%%') + ' - '
+ constants.NIGHTLY_VERSION[1].replace('%', '%%'))
if getattr(sys, 'frozen', False):
calibre_web_version += " - Exe-Version"
elif constants.HOME_CONFIG:
calibre_web_version += " - pyPi"
_VERSIONS = {'Calibre Web': calibre_web_version}
_VERSIONS.update(OrderedDict(
Python=sys.version,
Platform='{0[0]} {0[2]} {0[3]} {0[4]} {0[5]}'.format(platform.uname()),
))
_VERSIONS.update(uploader.get_magick_version())
_VERSIONS['Unrar'] = converter.get_unrar_version()
_VERSIONS['Ebook converter'] = converter.get_calibre_version()
_VERSIONS['Kepubify'] = converter.get_kepubify_version()
_VERSIONS.update(sorted_modules)
return _VERSIONS
@about.route("/stats")
@flask_login.login_required
def stats():
counter = calibre_db.session.query(db.Books).count()
authors = calibre_db.session.query(db.Authors).count()
categories = calibre_db.session.query(db.Tags).count()
series = calibre_db.session.query(db.Series).count()
return render_title_template('stats.html', bookcounter=counter, authorcounter=authors, versions=collect_stats(),
categorycounter=categories, seriecounter=series, title=_("Statistics"), page="stat")

2098
cps/admin.py Executable file

File diff suppressed because it is too large Load Diff

40
cps/babel.py Normal file
View File

@ -0,0 +1,40 @@
from babel import negotiate_locale
from flask_babel import Babel, Locale
from babel.core import UnknownLocaleError
from flask import request
from flask_login import current_user
from . import logger
log = logger.create()
babel = Babel()
def get_locale():
# if a user is logged in, use the locale from the user settings
if current_user is not None and hasattr(current_user, "locale"):
# if the account is the guest account bypass the config lang settings
if current_user.name != 'Guest':
return current_user.locale
preferred = list()
if request.accept_languages:
for x in request.accept_languages.values():
try:
preferred.append(str(Locale.parse(x.replace('-', '_'))))
except (UnknownLocaleError, ValueError) as e:
log.debug('Could not parse locale "%s": %s', x, e)
return negotiate_locale(preferred or ['en'], get_available_translations())
def get_user_locale_language(user_language):
return Locale.parse(user_language).get_language_name(get_locale())
def get_available_locale():
return [Locale('en')] + babel.list_translations()
def get_available_translations():
return set(str(item) for item in get_available_locale())

View File

@ -1,217 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2016-2019 lemmsh cervinko Kennyl matthazinski OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import uploader
import os
from flask_babel import gettext as _
import comic
try:
from lxml.etree import LXML_VERSION as lxmlversion
except ImportError:
lxmlversion = None
__author__ = 'lemmsh'
logger = logging.getLogger("book_formats")
try:
from wand.image import Image
from wand import version as ImageVersion
from wand.exceptions import PolicyError
use_generic_pdf_cover = False
except (ImportError, RuntimeError) as e:
logger.warning('cannot import Image, generating pdf covers for pdf uploads will not work: %s', e)
use_generic_pdf_cover = True
try:
from PyPDF2 import PdfFileReader
from PyPDF2 import __version__ as PyPdfVersion
use_pdf_meta = True
except ImportError as e:
logger.warning('cannot import PyPDF2, extracting pdf metadata will not work: %s', e)
use_pdf_meta = False
try:
import epub
use_epub_meta = True
except ImportError as e:
logger.warning('cannot import epub, extracting epub metadata will not work: %s', e)
use_epub_meta = False
try:
import fb2
use_fb2_meta = True
except ImportError as e:
logger.warning('cannot import fb2, extracting fb2 metadata will not work: %s', e)
use_fb2_meta = False
try:
from PIL import Image
from PIL import __version__ as PILversion
use_PIL = True
except ImportError:
use_PIL = False
def process(tmp_file_path, original_file_name, original_file_extension):
meta = None
try:
if ".PDF" == original_file_extension.upper():
meta = pdf_meta(tmp_file_path, original_file_name, original_file_extension)
if ".EPUB" == original_file_extension.upper() and use_epub_meta is True:
meta = epub.get_epub_info(tmp_file_path, original_file_name, original_file_extension)
if ".FB2" == original_file_extension.upper() and use_fb2_meta is True:
meta = fb2.get_fb2_info(tmp_file_path, original_file_extension)
if original_file_extension.upper() in ['.CBZ', '.CBT']:
meta = comic.get_comic_info(tmp_file_path, original_file_name, original_file_extension)
except Exception as ex:
logger.warning('cannot parse metadata, using default: %s', ex)
if meta and meta.title.strip() and meta.author.strip():
return meta
else:
return default_meta(tmp_file_path, original_file_name, original_file_extension)
def default_meta(tmp_file_path, original_file_name, original_file_extension):
return uploader.BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=original_file_name,
author=u"Unknown",
cover=None,
description="",
tags="",
series="",
series_id="",
languages="")
def pdf_meta(tmp_file_path, original_file_name, original_file_extension):
if use_pdf_meta:
pdf = PdfFileReader(open(tmp_file_path, 'rb'), strict=False)
doc_info = pdf.getDocumentInfo()
else:
doc_info = None
if doc_info is not None:
author = doc_info.author if doc_info.author else u"Unknown"
title = doc_info.title if doc_info.title else original_file_name
subject = doc_info.subject
else:
author = u"Unknown"
title = original_file_name
subject = ""
return uploader.BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=title,
author=author,
cover=pdf_preview(tmp_file_path, original_file_name),
description=subject,
tags="",
series="",
series_id="",
languages="")
def pdf_preview(tmp_file_path, tmp_dir):
if use_generic_pdf_cover:
return None
else:
if use_PIL:
try:
input1 = PdfFileReader(open(tmp_file_path, 'rb'), strict=False)
page0 = input1.getPage(0)
xObject = page0['/Resources']['/XObject'].getObject()
for obj in xObject:
if xObject[obj]['/Subtype'] == '/Image':
size = (xObject[obj]['/Width'], xObject[obj]['/Height'])
data = xObject[obj]._data # xObject[obj].getData()
if xObject[obj]['/ColorSpace'] == '/DeviceRGB':
mode = "RGB"
else:
mode = "P"
if '/Filter' in xObject[obj]:
if xObject[obj]['/Filter'] == '/FlateDecode':
img = Image.frombytes(mode, size, data)
cover_file_name = os.path.splitext(tmp_file_path)[0] + ".cover.png"
img.save(filename=os.path.join(tmp_dir, cover_file_name))
return cover_file_name
# img.save(obj[1:] + ".png")
elif xObject[obj]['/Filter'] == '/DCTDecode':
cover_file_name = os.path.splitext(tmp_file_path)[0] + ".cover.jpg"
img = open(cover_file_name, "wb")
img.write(data)
img.close()
return cover_file_name
elif xObject[obj]['/Filter'] == '/JPXDecode':
cover_file_name = os.path.splitext(tmp_file_path)[0] + ".cover.jp2"
img = open(cover_file_name, "wb")
img.write(data)
img.close()
return cover_file_name
else:
img = Image.frombytes(mode, size, data)
cover_file_name = os.path.splitext(tmp_file_path)[0] + ".cover.png"
img.save(filename=os.path.join(tmp_dir, cover_file_name))
return cover_file_name
except Exception as ex:
print(ex)
try:
cover_file_name = os.path.splitext(tmp_file_path)[0] + ".cover.jpg"
with Image(filename=tmp_file_path + "[0]", resolution=150) as img:
img.compression_quality = 88
img.save(filename=os.path.join(tmp_dir, cover_file_name))
return cover_file_name
except PolicyError as ex:
logger.warning('Pdf extraction forbidden by Imagemagick policy: %s', ex)
return None
except Exception as ex:
logger.warning('Cannot extract cover image, using default: %s', ex)
return None
def get_versions():
if not use_generic_pdf_cover:
IVersion = ImageVersion.MAGICK_VERSION
WVersion = ImageVersion.VERSION
else:
IVersion = _(u'not installed')
WVersion = _(u'not installed')
if use_pdf_meta:
PVersion='v'+PyPdfVersion
else:
PVersion=_(u'not installed')
if lxmlversion:
XVersion = 'v'+'.'.join(map(str, lxmlversion))
else:
XVersion = _(u'not installed')
if use_PIL:
PILVersion = 'v' + PILversion
else:
PILVersion = _(u'not installed')
return {'Image Magick': IVersion,
'PyPdf': PVersion,
'lxml':XVersion,
'Wand': WVersion,
'Pillow': PILVersion}

View File

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2016-2019 jkrehm andy29485 OzzieIsaacs
#
@ -17,8 +19,13 @@
# Inspired by https://github.com/ChrisTM/Flask-CacheBust
# Uses query strings so CSS font files are found without having to resort to absolute URLs
import hashlib
import os
import hashlib
from . import logger
log = logger.create()
def init_cache_busting(app):
@ -34,28 +41,32 @@ def init_cache_busting(app):
hash_table = {} # map of file hashes
app.logger.debug('Computing cache-busting values...')
log.debug('Computing cache-busting values...')
# compute file hashes
for dirpath, __, filenames in os.walk(static_folder):
for filename in filenames:
# compute version component
rooted_filename = os.path.join(dirpath, filename)
with open(rooted_filename, 'rb') as f:
file_hash = hashlib.md5(f.read()).hexdigest()[:7]
try:
with open(rooted_filename, 'rb') as f:
file_hash = hashlib.md5(f.read()).hexdigest()[:7] # nosec
# save version to tables
file_path = rooted_filename.replace(static_folder, "")
file_path = file_path.replace("\\", "/") # Convert Windows path to web path
hash_table[file_path] = file_hash
except PermissionError:
log.error("No permission to access {} file.".format(rooted_filename))
# save version to tables
file_path = rooted_filename.replace(static_folder, "")
file_path = file_path.replace("\\", "/") # Convert Windows path to web path
hash_table[file_path] = file_hash
app.logger.debug('Finished computing cache-busting values')
log.debug('Finished computing cache-busting values')
def bust_filename(filename):
return hash_table.get(filename, "")
def bust_filename(file_name):
return hash_table.get(file_name, "")
def unbust_filename(filename):
return filename.split("?", 1)[0]
def unbust_filename(file_name):
return file_name.split("?", 1)[0]
@app.url_defaults
# pylint: disable=unused-variable
def reverse_to_cache_busted_url(endpoint, values):
"""
Make `url_for` produce busted filenames when using the 'static' endpoint.

53
cps/clean_html.py Normal file
View File

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import logger
from lxml.etree import ParserError
try:
# at least bleach 6.0 is needed -> incomplatible change from list arguments to set arguments
from bleach import clean_text as clean_html
BLEACH = True
except ImportError:
try:
BLEACH = False
from nh3 import clean as clean_html
except ImportError:
try:
BLEACH = False
from lxml.html.clean import clean_html
except ImportError:
clean_html = None
log = logger.create()
def clean_string(unsafe_text, book_id=0):
try:
if BLEACH:
safe_text = clean_html(unsafe_text, tags=set(), attributes=set())
else:
safe_text = clean_html(unsafe_text)
except ParserError as e:
log.error("Comments of book {} are corrupted: {}".format(book_id, e))
safe_text = ""
except TypeError as e:
log.error("Comments can't be parsed, maybe 'lxml' is too new, try installing 'bleach': {}".format(e))
safe_text = ""
return safe_text

View File

@ -1,7 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018 OzzieIsaacs
#
@ -18,52 +16,120 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse
import os
import sys
import os
import argparse
import socket
parser = argparse.ArgumentParser(description='Calibre Web is a web app'
' providing a interface for browsing, reading and downloading eBooks\n', prog='cps.py')
parser.add_argument('-p', metavar='path', help='path and name to settings db, e.g. /opt/cw.db')
parser.add_argument('-g', metavar='path', help='path and name to gdrive db, e.g. /opt/gd.db')
parser.add_argument('-c', metavar='path', help='path and name to SSL certfile, e.g. /opt/test.cert, works only in combination with keyfile')
parser.add_argument('-k', metavar='path', help='path and name to SSL keyfile, e.g. /opt/test.key, works only in combination with certfile')
args = parser.parse_args()
from .constants import CONFIG_DIR as _CONFIG_DIR
from .constants import STABLE_VERSION as _STABLE_VERSION
from .constants import NIGHTLY_VERSION as _NIGHTLY_VERSION
from .constants import DEFAULT_SETTINGS_FILE, DEFAULT_GDRIVE_FILE
generalPath = os.path.normpath(os.getenv("CALIBRE_DBPATH",
os.path.dirname(os.path.realpath(__file__)) + os.sep + ".." + os.sep))
if args.p:
settingspath = args.p
else:
settingspath = os.path.join(generalPath, "app.db")
if args.g:
gdpath = args.g
else:
gdpath = os.path.join(generalPath, "gdrive.db")
def version_info():
if _NIGHTLY_VERSION[1].startswith('$Format'):
return "Calibre-Web version: %s - unknown git-clone" % _STABLE_VERSION['version'].replace("b", " Beta")
return "Calibre-Web version: %s -%s" % (_STABLE_VERSION['version'].replace("b", " Beta"), _NIGHTLY_VERSION[1])
certfilepath = None
keyfilepath = None
if args.c:
if os.path.isfile(args.c):
certfilepath = args.c
else:
print("Certfilepath is invalid. Exiting...")
sys.exit(1)
if args.c is "":
certfilepath = ""
class CliParameter(object):
if args.k:
if os.path.isfile(args.k):
keyfilepath = args.k
else:
print("Keyfilepath is invalid. Exiting...")
sys.exit(1)
def init(self):
self.arg_parser()
if (args.k and not args.c) or (not args.k and args.c):
print("Certfile and Keyfile have to be used together. Exiting...")
sys.exit(1)
def arg_parser(self):
parser = argparse.ArgumentParser(description='Calibre Web is a web app providing '
'a interface for browsing, reading and downloading eBooks\n',
prog='cps.py')
parser.add_argument('-p', metavar='path', help='path and name to settings db, e.g. /opt/cw.db')
parser.add_argument('-g', metavar='path', help='path and name to gdrive db, e.g. /opt/gd.db')
parser.add_argument('-c', metavar='path', help='path and name to SSL certfile, e.g. /opt/test.cert, '
'works only in combination with keyfile')
parser.add_argument('-k', metavar='path', help='path and name to SSL keyfile, e.g. /opt/test.key, '
'works only in combination with certfile')
parser.add_argument('-o', metavar='path', help='path and name Calibre-Web logfile')
parser.add_argument('-v', '--version', action='version', help='Shows version number and exits Calibre-Web',
version=version_info())
parser.add_argument('-i', metavar='ip-address', help='Server IP-Address to listen')
parser.add_argument('-m', action='store_true', help='Use Memory-backend as limiter backend, use this parameter in case of miss configured backend')
parser.add_argument('-s', metavar='user:pass',
help='Sets specific username to new password and exits Calibre-Web')
parser.add_argument('-f', action='store_true', help='Flag is depreciated and will be removed in next version')
parser.add_argument('-l', action='store_true', help='Allow loading covers from localhost')
parser.add_argument('-d', action='store_true', help='Dry run of updater to check file permissions in advance '
'and exits Calibre-Web')
parser.add_argument('-r', action='store_true', help='Enable public database reconnect route under /reconnect')
args = parser.parse_args()
if args.k is "":
keyfilepath = ""
self.logpath = args.o or ""
self.settings_path = args.p or os.path.join(_CONFIG_DIR, DEFAULT_SETTINGS_FILE)
self.gd_path = args.g or os.path.join(_CONFIG_DIR, DEFAULT_GDRIVE_FILE)
if os.path.isdir(self.settings_path):
self.settings_path = os.path.join(self.settings_path, DEFAULT_SETTINGS_FILE)
if os.path.isdir(self.gd_path):
self.gd_path = os.path.join(self.gd_path, DEFAULT_GDRIVE_FILE)
# handle and check parameter for ssl encryption
self.certfilepath = None
self.keyfilepath = None
if args.c:
if os.path.isfile(args.c):
self.certfilepath = args.c
else:
print("Certfile path is invalid. Exiting...")
sys.exit(1)
if args.c == "":
self.certfilepath = ""
if args.k:
if os.path.isfile(args.k):
self.keyfilepath = args.k
else:
print("Keyfile path is invalid. Exiting...")
sys.exit(1)
if (args.k and not args.c) or (not args.k and args.c):
print("Certfile and Keyfile have to be used together. Exiting...")
sys.exit(1)
if args.k == "":
self.keyfilepath = ""
# overwrite limiter backend
self.memory_backend = args.m or None
# dry run updater
self.dry_run = args.d or None
# enable reconnect endpoint for docker database reconnect
self.reconnect_enable = args.r or os.environ.get("CALIBRE_RECONNECT", None)
# load covers from localhost
self.allow_localhost = args.l or os.environ.get("CALIBRE_LOCALHOST", None)
# handle and check ip address argument
self.ip_address = args.i or None
if self.ip_address:
try:
# try to parse the given ip address with socket
if hasattr(socket, 'inet_pton'):
if ':' in self.ip_address:
socket.inet_pton(socket.AF_INET6, self.ip_address)
else:
socket.inet_pton(socket.AF_INET, self.ip_address)
else:
# on Windows python < 3.4, inet_pton is not available
# inet_atom only handles IPv4 addresses
socket.inet_aton(self.ip_address)
except socket.error as err:
print(self.ip_address, ':', err)
sys.exit(1)
# handle and check user password argument
self.user_credentials = args.s or None
if self.user_credentials and ":" not in self.user_credentials:
print("No valid 'username:password' format")
sys.exit(3)
if args.f:
print("Warning: -f flag is depreciated and will be removed in next version")

View File

@ -1,8 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018 OzzieIsaacs
# Copyright (C) 2018-2022 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -17,21 +16,60 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import zipfile
import tarfile
import os
import uploader
from . import logger, isoLanguages, cover
from .constants import BookMeta
try:
from wand.image import Image
use_IM = True
except (ImportError, RuntimeError) as e:
use_IM = False
log = logger.create()
try:
from comicapi.comicarchive import ComicArchive, MetaDataStyle
use_comic_meta = True
try:
from comicapi import __version__ as comic_version
except ImportError:
comic_version = ''
try:
from comicapi.comicarchive import load_archive_plugins
import comicapi.utils
comicapi.utils.add_rar_paths()
except ImportError:
load_archive_plugins = None
except (ImportError, LookupError) as e:
log.debug('Cannot import comicapi, extracting comic metadata will not work: %s', e)
import zipfile
import tarfile
try:
import rarfile
use_rarfile = True
except (ImportError, SyntaxError) as e:
log.debug('Cannot import rarfile, extracting cover files from rar files will not work: %s', e)
use_rarfile = False
try:
import py7zr
use_7zip = True
except (ImportError, SyntaxError) as e:
log.debug('Cannot import py7zr, extracting cover files from CB7 files will not work: %s', e)
use_7zip = False
use_comic_meta = False
def extractCover(tmp_file_name, original_file_extension):
cover_data = None
def _extract_cover_from_archive(original_file_extension, tmp_file_name, rar_executable):
cover_data = extension = None
if original_file_extension.upper() == '.CBZ':
cf = zipfile.ZipFile(tmp_file_name)
for name in cf.namelist():
ext = os.path.splitext(name)
if len(ext) > 1:
extension = ext[1].lower()
if extension == '.jpg':
if extension in cover.COVER_EXTENSIONS:
cover_data = cf.read(name)
break
elif original_file_extension.upper() == '.CBT':
@ -40,33 +78,111 @@ def extractCover(tmp_file_name, original_file_extension):
ext = os.path.splitext(name)
if len(ext) > 1:
extension = ext[1].lower()
if extension == '.jpg':
if extension in cover.COVER_EXTENSIONS:
cover_data = cf.extractfile(name).read()
break
elif original_file_extension.upper() == '.CBR' and use_rarfile:
try:
rarfile.UNRAR_TOOL = rar_executable
cf = rarfile.RarFile(tmp_file_name)
for name in cf.namelist():
ext = os.path.splitext(name)
if len(ext) > 1:
extension = ext[1].lower()
if extension in cover.COVER_EXTENSIONS:
cover_data = cf.read([name])
break
except Exception as ex:
log.error('Rarfile failed with error: {}'.format(ex))
elif original_file_extension.upper() == '.CB7' and use_7zip:
cf = py7zr.SevenZipFile(tmp_file_name)
for name in cf.getnames():
ext = os.path.splitext(name)
if len(ext) > 1:
extension = ext[1].lower()
if extension in cover.COVER_EXTENSIONS:
try:
cover_data = cf.read([name])[name].read()
except (py7zr.Bad7zFile, OSError) as ex:
log.error('7Zip file failed with error: {}'.format(ex))
break
return cover_data, extension
prefix = os.path.dirname(tmp_file_name)
if cover_data:
tmp_cover_name = prefix + '/cover' + extension
image = open(tmp_cover_name, 'wb')
image.write(cover_data)
image.close()
def _extract_cover(tmp_file_name, original_file_extension, rar_executable):
cover_data = extension = None
if use_comic_meta:
try:
archive = ComicArchive(tmp_file_name, rar_exe_path=rar_executable)
except TypeError:
archive = ComicArchive(tmp_file_name)
name_list = archive.getPageNameList if hasattr(archive, "getPageNameList") else archive.get_page_name_list
for index, name in enumerate(name_list()):
ext = os.path.splitext(name)
if len(ext) > 1:
extension = ext[1].lower()
if extension in cover.COVER_EXTENSIONS:
get_page = archive.getPage if hasattr(archive, "getPageNameList") else archive.get_page
cover_data = get_page(index)
break
else:
tmp_cover_name = None
return tmp_cover_name
cover_data, extension = _extract_cover_from_archive(original_file_extension, tmp_file_name, rar_executable)
return cover.cover_processing(tmp_file_name, cover_data, extension)
def get_comic_info(tmp_file_path, original_file_name, original_file_extension):
def get_comic_info(tmp_file_path, original_file_name, original_file_extension, rar_executable):
if use_comic_meta:
try:
archive = ComicArchive(tmp_file_path, rar_exe_path=rar_executable)
except TypeError:
load_archive_plugins(force=True, rar=rar_executable)
archive = ComicArchive(tmp_file_path)
if hasattr(archive, "seemsToBeAComicArchive"):
seems_archive = archive.seemsToBeAComicArchive
else:
seems_archive = archive.seems_to_be_a_comic_archive
if seems_archive():
has_metadata = archive.hasMetadata if hasattr(archive, "hasMetadata") else archive.has_metadata
if has_metadata(MetaDataStyle.CIX):
style = MetaDataStyle.CIX
elif has_metadata(MetaDataStyle.CBI):
style = MetaDataStyle.CBI
else:
style = None
coverfile = extractCover(tmp_file_path, original_file_extension)
read_metadata = archive.readMetadata if hasattr(archive, "readMetadata") else archive.read_metadata
loaded_metadata = read_metadata(style)
return uploader.BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=original_file_name,
author=u"Unknown",
cover=coverfile,
description="",
tags="",
series="",
series_id="",
languages="")
lang = loaded_metadata.language or ""
loaded_metadata.language = isoLanguages.get_lang3(lang)
return BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=loaded_metadata.title or original_file_name,
author=" & ".join([credit["person"]
for credit in loaded_metadata.credits if credit["role"] == "Writer"]) or 'Unknown',
cover=_extract_cover(tmp_file_path, original_file_extension, rar_executable),
description=loaded_metadata.comments or "",
tags="",
series=loaded_metadata.series or "",
series_id=loaded_metadata.issue or "",
languages=loaded_metadata.language,
publisher="",
pubdate="",
identifiers=[])
return BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=original_file_name,
author='Unknown',
cover=_extract_cover(tmp_file_path, original_file_extension, rar_executable),
description="",
tags="",
series="",
series_id="",
languages="",
publisher="",
pubdate="",
identifiers=[])

575
cps/config_sql.py Normal file
View File

@ -0,0 +1,575 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2019 OzzieIsaacs, pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import json
from sqlalchemy import Column, String, Integer, SmallInteger, Boolean, BLOB, JSON
from sqlalchemy.exc import OperationalError
from sqlalchemy.sql.expression import text
from sqlalchemy import exists
from cryptography.fernet import Fernet
import cryptography.exceptions
from base64 import urlsafe_b64decode
try:
# Compatibility with sqlalchemy 2.0
from sqlalchemy.orm import declarative_base
except ImportError:
from sqlalchemy.ext.declarative import declarative_base
from . import constants, logger
from .subproc_wrapper import process_wait
log = logger.create()
_Base = declarative_base()
class _Flask_Settings(_Base):
__tablename__ = 'flask_settings'
id = Column(Integer, primary_key=True)
flask_session_key = Column(BLOB, default=b"")
def __init__(self, key):
self.flask_session_key = key
# Baseclass for representing settings in app.db with email server settings and Calibre database settings
# (application settings)
class _Settings(_Base):
__tablename__ = 'settings'
id = Column(Integer, primary_key=True)
mail_server = Column(String, default=constants.DEFAULT_MAIL_SERVER)
mail_port = Column(Integer, default=25)
mail_use_ssl = Column(SmallInteger, default=0)
mail_login = Column(String, default='mail@example.com')
mail_password_e = Column(String)
mail_password = Column(String)
mail_from = Column(String, default='automailer <mail@example.com>')
mail_size = Column(Integer, default=25*1024*1024)
mail_server_type = Column(SmallInteger, default=0)
mail_gmail_token = Column(JSON, default={})
config_calibre_dir = Column(String)
config_calibre_uuid = Column(String)
config_calibre_split = Column(Boolean, default=False)
config_calibre_split_dir = Column(String)
config_port = Column(Integer, default=constants.DEFAULT_PORT)
config_external_port = Column(Integer, default=constants.DEFAULT_PORT)
config_certfile = Column(String)
config_keyfile = Column(String)
config_trustedhosts = Column(String, default='')
config_calibre_web_title = Column(String, default='Calibre-Web')
config_books_per_page = Column(Integer, default=60)
config_random_books = Column(Integer, default=4)
config_authors_max = Column(Integer, default=0)
config_read_column = Column(Integer, default=0)
config_title_regex = Column(String, default=r'^(A|The|An|Der|Die|Das|Den|Ein|Eine|Einen|Dem|Des|Einem|Eines|Le|La|Les|L\'|Un|Une)\s+')
config_theme = Column(Integer, default=0)
config_log_level = Column(SmallInteger, default=logger.DEFAULT_LOG_LEVEL)
config_logfile = Column(String, default=logger.DEFAULT_LOG_FILE)
config_access_log = Column(SmallInteger, default=0)
config_access_logfile = Column(String, default=logger.DEFAULT_ACCESS_LOG)
config_uploading = Column(SmallInteger, default=0)
config_anonbrowse = Column(SmallInteger, default=0)
config_public_reg = Column(SmallInteger, default=0)
config_remote_login = Column(Boolean, default=False)
config_kobo_sync = Column(Boolean, default=False)
config_default_role = Column(SmallInteger, default=0)
config_default_show = Column(SmallInteger, default=constants.ADMIN_USER_SIDEBAR)
config_default_language = Column(String(3), default="all")
config_default_locale = Column(String(2), default="en")
config_columns_to_ignore = Column(String)
config_denied_tags = Column(String, default="")
config_allowed_tags = Column(String, default="")
config_restricted_column = Column(SmallInteger, default=0)
config_denied_column_value = Column(String, default="")
config_allowed_column_value = Column(String, default="")
config_use_google_drive = Column(Boolean, default=False)
config_google_drive_folder = Column(String)
config_google_drive_watch_changes_response = Column(JSON, default={})
config_use_goodreads = Column(Boolean, default=False)
config_goodreads_api_key = Column(String)
config_register_email = Column(Boolean, default=False)
config_login_type = Column(Integer, default=0)
config_kobo_proxy = Column(Boolean, default=False)
config_ldap_provider_url = Column(String, default='example.org')
config_ldap_port = Column(SmallInteger, default=389)
config_ldap_authentication = Column(SmallInteger, default=constants.LDAP_AUTH_SIMPLE)
config_ldap_serv_username = Column(String, default='cn=admin,dc=example,dc=org')
config_ldap_serv_password_e = Column(String)
config_ldap_serv_password = Column(String)
config_ldap_encryption = Column(SmallInteger, default=0)
config_ldap_cacert_path = Column(String, default="")
config_ldap_cert_path = Column(String, default="")
config_ldap_key_path = Column(String, default="")
config_ldap_dn = Column(String, default='dc=example,dc=org')
config_ldap_user_object = Column(String, default='uid=%s')
config_ldap_member_user_object = Column(String, default='')
config_ldap_openldap = Column(Boolean, default=True)
config_ldap_group_object_filter = Column(String, default='(&(objectclass=posixGroup)(cn=%s))')
config_ldap_group_members_field = Column(String, default='memberUid')
config_ldap_group_name = Column(String, default='calibreweb')
config_kepubifypath = Column(String, default=None)
config_converterpath = Column(String, default=None)
config_binariesdir = Column(String, default=None)
config_calibre = Column(String)
config_rarfile_location = Column(String, default=None)
config_upload_formats = Column(String, default=','.join(constants.EXTENSIONS_UPLOAD))
config_unicode_filename = Column(Boolean, default=False)
config_embed_metadata = Column(Boolean, default=True)
config_updatechannel = Column(Integer, default=constants.UPDATE_STABLE)
config_reverse_proxy_login_header_name = Column(String)
config_allow_reverse_proxy_header_login = Column(Boolean, default=False)
schedule_start_time = Column(Integer, default=4)
schedule_duration = Column(Integer, default=10)
schedule_generate_book_covers = Column(Boolean, default=False)
schedule_generate_series_covers = Column(Boolean, default=False)
schedule_reconnect = Column(Boolean, default=False)
schedule_metadata_backup = Column(Boolean, default=False)
config_password_policy = Column(Boolean, default=True)
config_password_min_length = Column(Integer, default=8)
config_password_number = Column(Boolean, default=True)
config_password_lower = Column(Boolean, default=True)
config_password_upper = Column(Boolean, default=True)
config_password_character = Column(Boolean, default=True)
config_password_special = Column(Boolean, default=True)
config_session = Column(Integer, default=1)
config_ratelimiter = Column(Boolean, default=True)
config_limiter_uri = Column(String, default="")
config_limiter_options = Column(String, default="")
def __repr__(self):
return self.__class__.__name__
# Class holds all application specific settings in calibre-web
class ConfigSQL(object):
# pylint: disable=no-member
def __init__(self):
self.__dict__["dirty"] = list()
def init_config(self, session, secret_key, cli):
self._session = session
self._settings = None
self.db_configured = None
self.config_calibre_dir = None
self._fernet = Fernet(secret_key)
self.cli = cli
self.load()
change = False
if self.config_binariesdir == None: # pylint: disable=access-member-before-definition
change = True
self.config_binariesdir = autodetect_calibre_binaries()
self.config_converterpath = autodetect_converter_binary(self.config_binariesdir)
if self.config_kepubifypath == None: # pylint: disable=access-member-before-definition
change = True
self.config_kepubifypath = autodetect_kepubify_binary()
if self.config_rarfile_location == None: # pylint: disable=access-member-before-definition
change = True
self.config_rarfile_location = autodetect_unrar_binary()
if change:
self.save()
def _read_from_storage(self):
if self._settings is None:
log.debug("_ConfigSQL._read_from_storage")
self._settings = self._session.query(_Settings).first()
return self._settings
def get_config_certfile(self):
if self.cli.certfilepath:
return self.cli.certfilepath
if self.cli.certfilepath == "":
return None
return self.config_certfile
def get_config_keyfile(self):
if self.cli.keyfilepath:
return self.cli.keyfilepath
if self.cli.certfilepath == "":
return None
return self.config_keyfile
def get_config_ipaddress(self):
return self.cli.ip_address or ""
def _has_role(self, role_flag):
return constants.has_flag(self.config_default_role, role_flag)
def role_admin(self):
return self._has_role(constants.ROLE_ADMIN)
def role_download(self):
return self._has_role(constants.ROLE_DOWNLOAD)
def role_viewer(self):
return self._has_role(constants.ROLE_VIEWER)
def role_upload(self):
return self._has_role(constants.ROLE_UPLOAD)
def role_edit(self):
return self._has_role(constants.ROLE_EDIT)
def role_passwd(self):
return self._has_role(constants.ROLE_PASSWD)
def role_edit_shelfs(self):
return self._has_role(constants.ROLE_EDIT_SHELFS)
def role_delete_books(self):
return self._has_role(constants.ROLE_DELETE_BOOKS)
def show_element_new_user(self, value):
return constants.has_flag(self.config_default_show, value)
def show_detail_random(self):
return self.show_element_new_user(constants.DETAIL_RANDOM)
def list_denied_tags(self):
mct = self.config_denied_tags or ""
return [t.strip() for t in mct.split(",")]
def list_allowed_tags(self):
mct = self.config_allowed_tags or ""
return [t.strip() for t in mct.split(",")]
def list_denied_column_values(self):
mct = self.config_denied_column_value or ""
return [t.strip() for t in mct.split(",")]
def list_allowed_column_values(self):
mct = self.config_allowed_column_value or ""
return [t.strip() for t in mct.split(",")]
def get_log_level(self):
return logger.get_level_name(self.config_log_level)
def get_mail_settings(self):
return {k: v for k, v in self.__dict__.items() if k.startswith('mail_')}
def get_mail_server_configured(self):
return bool((self.mail_server != constants.DEFAULT_MAIL_SERVER and self.mail_server_type == 0)
or (self.mail_gmail_token != {} and self.mail_server_type == 1))
def get_scheduled_task_settings(self):
return {k: v for k, v in self.__dict__.items() if k.startswith('schedule_')}
def set_from_dictionary(self, dictionary, field, convertor=None, default=None, encode=None):
"""Possibly updates a field of this object.
The new value, if present, is grabbed from the given dictionary, and optionally passed through a convertor.
:returns: `True` if the field has changed value
"""
new_value = dictionary.get(field, default)
if new_value is None:
return False
if field not in self.__dict__:
log.warning("_ConfigSQL trying to set unknown field '%s' = %r", field, new_value)
return False
if convertor is not None:
if encode:
new_value = convertor(new_value.encode(encode))
else:
new_value = convertor(new_value)
current_value = self.__dict__.get(field)
if current_value == new_value:
return False
setattr(self, field, new_value)
return True
def to_dict(self):
storage = {}
for k, v in self.__dict__.items():
if k[0] != '_' and not k.endswith("_e") and not k == "cli":
storage[k] = v
return storage
def load(self):
"""Load all configuration values from the underlying storage."""
s = self._read_from_storage() # type: _Settings
for k, v in s.__dict__.items():
if k[0] != '_':
if v is None:
# if the storage column has no value, apply the (possible) default
column = s.__class__.__dict__.get(k)
if column.default is not None:
v = column.default.arg
if k.endswith("_e") and v is not None:
try:
setattr(self, k, self._fernet.decrypt(v).decode())
except cryptography.fernet.InvalidToken:
setattr(self, k, "")
else:
setattr(self, k, v)
have_metadata_db = bool(self.config_calibre_dir)
if have_metadata_db:
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().lower() for x in self.config_upload_formats.split(',')]
from . import cli_param
if os.environ.get('FLASK_DEBUG'):
logfile = logger.setup(logger.LOG_TO_STDOUT, logger.logging.DEBUG)
else:
# pylint: disable=access-member-before-definition
logfile = logger.setup(cli_param.logpath or self.config_logfile, self.config_log_level)
if logfile != os.path.abspath(self.config_logfile):
if logfile != os.path.abspath(cli_param.logpath):
log.warning("Log path %s not valid, falling back to default", self.config_logfile)
self.config_logfile = logfile
s.config_logfile = logfile
self._session.merge(s)
try:
self._session.commit()
except OperationalError as e:
log.error('Database error: %s', e)
self._session.rollback()
self.__dict__["dirty"] = list()
def save(self):
"""Apply all configuration values to the underlying storage."""
s = self._read_from_storage() # type: _Settings
for k in self.dirty:
if k[0] == '_':
continue
if hasattr(s, k):
if k.endswith("_e"):
setattr(s, k, self._fernet.encrypt(self.__dict__[k].encode()))
else:
setattr(s, k, self.__dict__[k])
log.debug("_ConfigSQL updating storage")
self._session.merge(s)
try:
self._session.commit()
except OperationalError as e:
log.error('Database error: %s', e)
self._session.rollback()
self.load()
def invalidate(self, error=None):
if error:
log.error(error)
log.warning("invalidating configuration")
self.db_configured = False
self.save()
def get_book_path(self):
return self.config_calibre_split_dir if self.config_calibre_split_dir else self.config_calibre_dir
def store_calibre_uuid(self, calibre_db, Library_table):
try:
calibre_uuid = calibre_db.session.query(Library_table).one_or_none()
if self.config_calibre_uuid != calibre_uuid.uuid:
self.config_calibre_uuid = calibre_uuid.uuid
self.save()
except AttributeError:
pass
def __setattr__(self, attr_name, attr_value):
super().__setattr__(attr_name, attr_value)
self.__dict__["dirty"].append(attr_name)
def _encrypt_fields(session, secret_key):
try:
session.query(exists().where(_Settings.mail_password_e)).scalar()
except OperationalError:
with session.bind.connect() as conn:
conn.execute(text("ALTER TABLE settings ADD column 'mail_password_e' String"))
conn.execute(text("ALTER TABLE settings ADD column 'config_ldap_serv_password_e' String"))
session.commit()
crypter = Fernet(secret_key)
settings = session.query(_Settings.mail_password, _Settings.config_ldap_serv_password).first()
if settings.mail_password:
session.query(_Settings).update(
{_Settings.mail_password_e: crypter.encrypt(settings.mail_password.encode())})
if settings.config_ldap_serv_password:
session.query(_Settings).update(
{_Settings.config_ldap_serv_password_e:
crypter.encrypt(settings.config_ldap_serv_password.encode())})
session.commit()
def _migrate_table(session, orm_class, secret_key=None):
if secret_key:
_encrypt_fields(session, secret_key)
changed = False
for column_name, column in orm_class.__dict__.items():
if column_name[0] != '_':
try:
session.query(column).first()
except OperationalError as err:
log.debug("%s: %s", column_name, err.args[0])
if column.default is None:
column_default = ""
else:
if isinstance(column.default.arg, bool):
column_default = "DEFAULT {}".format(int(column.default.arg))
else:
column_default = "DEFAULT `{}`".format(column.default.arg)
if isinstance(column.type, JSON):
column_type = "JSON"
else:
column_type = column.type
alter_table = text("ALTER TABLE %s ADD COLUMN `%s` %s %s" % (orm_class.__tablename__,
column_name,
column_type,
column_default))
log.debug(alter_table)
session.execute(alter_table)
changed = True
except json.decoder.JSONDecodeError as e:
log.error("Database corrupt column: {}".format(column_name))
log.debug(e)
if changed:
try:
session.commit()
except OperationalError:
session.rollback()
def autodetect_calibre_binaries():
if sys.platform == "win32":
calibre_path = ["C:\\program files\\calibre\\",
"C:\\program files(x86)\\calibre\\",
"C:\\program files(x86)\\calibre2\\",
"C:\\program files\\calibre2\\"]
else:
calibre_path = ["/opt/calibre/"]
for element in calibre_path:
supported_binary_paths = [os.path.join(element, binary)
for binary in constants.SUPPORTED_CALIBRE_BINARIES.values()]
if all(os.path.isfile(binary_path) and os.access(binary_path, os.X_OK)
for binary_path in supported_binary_paths):
values = [process_wait([binary_path, "--version"],
pattern=r'\(calibre (.*)\)') for binary_path in supported_binary_paths]
if all(values):
version = values[0].group(1)
log.debug("calibre version %s", version)
return element
return ""
def autodetect_converter_binary(calibre_path):
if sys.platform == "win32":
converter_path = os.path.join(calibre_path, "ebook-convert.exe")
else:
converter_path = os.path.join(calibre_path, "ebook-convert")
if calibre_path and os.path.isfile(converter_path) and os.access(converter_path, os.X_OK):
return converter_path
return ""
def autodetect_unrar_binary():
if sys.platform == "win32":
calibre_path = ["C:\\program files\\WinRar\\unRAR.exe",
"C:\\program files(x86)\\WinRar\\unRAR.exe"]
else:
calibre_path = ["/usr/bin/unrar"]
for element in calibre_path:
if os.path.isfile(element) and os.access(element, os.X_OK):
return element
return ""
def autodetect_kepubify_binary():
if sys.platform == "win32":
calibre_path = ["C:\\program files\\kepubify\\kepubify-windows-64Bit.exe",
"C:\\program files(x86)\\kepubify\\kepubify-windows-64Bit.exe"]
else:
calibre_path = ["/opt/kepubify/kepubify-linux-64bit", "/opt/kepubify/kepubify-linux-32bit"]
for element in calibre_path:
if os.path.isfile(element) and os.access(element, os.X_OK):
return element
return ""
def _migrate_database(session, secret_key):
# make sure the table is created, if it does not exist
_Base.metadata.create_all(session.bind)
_migrate_table(session, _Settings, secret_key)
_migrate_table(session, _Flask_Settings)
def load_configuration(session, secret_key):
_migrate_database(session, secret_key)
if not session.query(_Settings).count():
session.add(_Settings())
session.commit()
def get_flask_session_key(_session):
flask_settings = _session.query(_Flask_Settings).one_or_none()
if flask_settings == None:
flask_settings = _Flask_Settings(os.urandom(32))
_session.add(flask_settings)
_session.commit()
return flask_settings.flask_session_key
def get_encryption_key(key_path):
key_file = os.path.join(key_path, ".key")
generate = True
error = ""
if os.path.exists(key_file) and os.path.getsize(key_file) > 32:
with open(key_file, "rb") as f:
key = f.read()
try:
urlsafe_b64decode(key)
generate = False
except ValueError:
pass
if generate:
key = Fernet.generate_key()
try:
with open(key_file, "wb") as f:
f.write(key)
except PermissionError as e:
error = e
return key, error

198
cps/constants.py Normal file
View File

@ -0,0 +1,198 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2019 OzzieIsaacs, pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
import os
from collections import namedtuple
from sqlalchemy import __version__ as sql_version
sqlalchemy_version2 = ([int(x) for x in sql_version.split('.')] >= [2, 0, 0])
# APP_MODE - production, development, or test
APP_MODE = os.environ.get('APP_MODE', 'production')
# if installed via pip this variable is set to true (empty file with name .HOMEDIR present)
HOME_CONFIG = os.path.isfile(os.path.join(os.path.dirname(os.path.abspath(__file__)), '.HOMEDIR'))
# In executables updater is not available, so variable is set to False there
UPDATER_AVAILABLE = True
# Base dir is parent of current file, necessary if called from different folder
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))
# if executable file the files should be placed in the parent dir (parallel to the exe file)
STATIC_DIR = os.path.join(BASE_DIR, 'cps', 'static')
TEMPLATES_DIR = os.path.join(BASE_DIR, 'cps', 'templates')
TRANSLATIONS_DIR = os.path.join(BASE_DIR, 'cps', 'translations')
# Cache dir - use CACHE_DIR environment variable, otherwise use the default directory: cps/cache
DEFAULT_CACHE_DIR = os.path.join(BASE_DIR, 'cps', 'cache')
CACHE_DIR = os.environ.get('CACHE_DIR', DEFAULT_CACHE_DIR)
if HOME_CONFIG:
home_dir = os.path.join(os.path.expanduser("~"), ".calibre-web")
if not os.path.exists(home_dir):
os.makedirs(home_dir)
CONFIG_DIR = os.environ.get('CALIBRE_DBPATH', home_dir)
else:
CONFIG_DIR = os.environ.get('CALIBRE_DBPATH', BASE_DIR)
if getattr(sys, 'frozen', False):
CONFIG_DIR = os.path.abspath(os.path.join(CONFIG_DIR, os.pardir))
DEFAULT_SETTINGS_FILE = "app.db"
DEFAULT_GDRIVE_FILE = "gdrive.db"
ROLE_USER = 0 << 0
ROLE_ADMIN = 1 << 0
ROLE_DOWNLOAD = 1 << 1
ROLE_UPLOAD = 1 << 2
ROLE_EDIT = 1 << 3
ROLE_PASSWD = 1 << 4
ROLE_ANONYMOUS = 1 << 5
ROLE_EDIT_SHELFS = 1 << 6
ROLE_DELETE_BOOKS = 1 << 7
ROLE_VIEWER = 1 << 8
ALL_ROLES = {
"admin_role": ROLE_ADMIN,
"download_role": ROLE_DOWNLOAD,
"upload_role": ROLE_UPLOAD,
"edit_role": ROLE_EDIT,
"passwd_role": ROLE_PASSWD,
"edit_shelf_role": ROLE_EDIT_SHELFS,
"delete_role": ROLE_DELETE_BOOKS,
"viewer_role": ROLE_VIEWER,
}
DETAIL_RANDOM = 1 << 0
SIDEBAR_LANGUAGE = 1 << 1
SIDEBAR_SERIES = 1 << 2
SIDEBAR_CATEGORY = 1 << 3
SIDEBAR_HOT = 1 << 4
SIDEBAR_RANDOM = 1 << 5
SIDEBAR_AUTHOR = 1 << 6
SIDEBAR_BEST_RATED = 1 << 7
SIDEBAR_READ_AND_UNREAD = 1 << 8
SIDEBAR_RECENT = 1 << 9
SIDEBAR_SORTED = 1 << 10
MATURE_CONTENT = 1 << 11
SIDEBAR_PUBLISHER = 1 << 12
SIDEBAR_RATING = 1 << 13
SIDEBAR_FORMAT = 1 << 14
SIDEBAR_ARCHIVED = 1 << 15
SIDEBAR_DOWNLOAD = 1 << 16
SIDEBAR_LIST = 1 << 17
sidebar_settings = {
"detail_random": DETAIL_RANDOM,
"sidebar_language": SIDEBAR_LANGUAGE,
"sidebar_series": SIDEBAR_SERIES,
"sidebar_category": SIDEBAR_CATEGORY,
"sidebar_random": SIDEBAR_RANDOM,
"sidebar_author": SIDEBAR_AUTHOR,
"sidebar_best_rated": SIDEBAR_BEST_RATED,
"sidebar_read_and_unread": SIDEBAR_READ_AND_UNREAD,
"sidebar_recent": SIDEBAR_RECENT,
"sidebar_sorted": SIDEBAR_SORTED,
"sidebar_publisher": SIDEBAR_PUBLISHER,
"sidebar_rating": SIDEBAR_RATING,
"sidebar_format": SIDEBAR_FORMAT,
"sidebar_archived": SIDEBAR_ARCHIVED,
"sidebar_download": SIDEBAR_DOWNLOAD,
"sidebar_list": SIDEBAR_LIST,
}
ADMIN_USER_ROLES = sum(r for r in ALL_ROLES.values()) & ~ROLE_ANONYMOUS
ADMIN_USER_SIDEBAR = (SIDEBAR_LIST << 1) - 1
UPDATE_STABLE = 0 << 0
AUTO_UPDATE_STABLE = 1 << 0
UPDATE_NIGHTLY = 1 << 1
AUTO_UPDATE_NIGHTLY = 1 << 2
LOGIN_STANDARD = 0
LOGIN_LDAP = 1
LOGIN_OAUTH = 2
LDAP_AUTH_ANONYMOUS = 0
LDAP_AUTH_UNAUTHENTICATE = 1
LDAP_AUTH_SIMPLE = 0
DEFAULT_MAIL_SERVER = "mail.example.org"
DEFAULT_PASSWORD = "admin123" # nosec
DEFAULT_PORT = 8083
env_CALIBRE_PORT = os.environ.get("CALIBRE_PORT", DEFAULT_PORT)
try:
DEFAULT_PORT = int(env_CALIBRE_PORT)
except ValueError:
print('Environment variable CALIBRE_PORT has invalid value (%s), faling back to default (8083)' % env_CALIBRE_PORT)
del env_CALIBRE_PORT
EXTENSIONS_AUDIO = {'mp3', 'mp4', 'ogg', 'opus', 'wav', 'flac', 'm4a', 'm4b'}
EXTENSIONS_CONVERT_FROM = ['pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf',
'txt', 'htmlz', 'rtf', 'odt', 'cbz', 'cbr', 'prc']
EXTENSIONS_CONVERT_TO = ['pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2',
'lit', 'lrf', 'txt', 'htmlz', 'rtf', 'odt']
EXTENSIONS_UPLOAD = {'txt', 'pdf', 'epub', 'kepub', 'mobi', 'azw', 'azw3', 'cbr', 'cbz', 'cbt', 'cb7', 'djvu', 'djv',
'prc', 'doc', 'docx', 'fb2', 'html', 'rtf', 'lit', 'odt', 'mp3', 'mp4', 'ogg',
'opus', 'wav', 'flac', 'm4a', 'm4b'}
_extension = ""
if sys.platform == "win32":
_extension = ".exe"
SUPPORTED_CALIBRE_BINARIES = {binary:binary + _extension for binary in ["ebook-convert", "calibredb"]}
def has_flag(value, bit_flag):
return bit_flag == (bit_flag & (value or 0))
def selected_roles(dictionary):
return sum(v for k, v in ALL_ROLES.items() if k in dictionary)
# :rtype: BookMeta
BookMeta = namedtuple('BookMeta', 'file_path, extension, title, author, cover, description, tags, series, '
'series_id, languages, publisher, pubdate, identifiers')
# python build process likes to have x.y.zbw -> b for beta and w a counting number
STABLE_VERSION = {'version': '0.6.22b'}
NIGHTLY_VERSION = dict()
NIGHTLY_VERSION[0] = '$Format:%H$'
NIGHTLY_VERSION[1] = '$Format:%cI$'
# CACHE
CACHE_TYPE_THUMBNAILS = 'thumbnails'
# Thumbnail Types
THUMBNAIL_TYPE_COVER = 1
THUMBNAIL_TYPE_SERIES = 2
THUMBNAIL_TYPE_AUTHOR = 3
# Thumbnails Sizes
COVER_THUMBNAIL_ORIGINAL = 0
COVER_THUMBNAIL_SMALL = 1
COVER_THUMBNAIL_MEDIUM = 2
COVER_THUMBNAIL_LARGE = 3
# clean-up the module namespace
del sys, os, namedtuple

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
@ -17,51 +16,47 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import subprocess
import ub
import re
from flask_babel import gettext as _
from flask_babel import lazy_gettext as N_
from . import config, logger
from .subproc_wrapper import process_wait
def versionKindle():
versions = _(u'not installed')
if os.path.exists(ub.config.config_converterpath):
log = logger.create()
# strings getting translated when used
_NOT_INSTALLED = N_('not installed')
_EXECUTION_ERROR = N_('Execution permissions missing')
def _get_command_version(path, pattern, argument=None):
if os.path.exists(path):
command = [path]
if argument:
command.append(argument)
try:
p = subprocess.Popen(ub.config.config_converterpath, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()
for lines in p.stdout.readlines():
if isinstance(lines, bytes):
lines = lines.decode('utf-8')
if re.search('Amazon kindlegen\(', lines):
versions = lines
except Exception:
versions = _(u'Excecution permissions missing')
return {'kindlegen' : versions}
match = process_wait(command, pattern=pattern)
if isinstance(match, re.Match):
return match.string
except Exception as ex:
log.warning("%s: %s", path, ex)
return _EXECUTION_ERROR
return _NOT_INSTALLED
def versionCalibre():
versions = _(u'not installed')
if os.path.exists(ub.config.config_converterpath):
try:
p = subprocess.Popen([ub.config.config_converterpath, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.wait()
for lines in p.stdout.readlines():
if isinstance(lines, bytes):
lines = lines.decode('utf-8')
if re.search('ebook-convert.*\(calibre', lines):
versions = lines
except Exception:
versions = _(u'Excecution permissions missing')
return {'Calibre converter' : versions}
def get_calibre_version():
return _get_command_version(config.config_converterpath, r'ebook-convert.*\(calibre', '--version')
def versioncheck():
if ub.config.config_ebookconverter == 1:
return versionKindle()
elif ub.config.config_ebookconverter == 2:
return versionCalibre()
else:
return {'ebook_converter':_(u'not configured')}
def get_unrar_version():
unrar_version = _get_command_version(config.config_rarfile_location, r'UNRAR.*\d')
if unrar_version == "not installed":
unrar_version = _get_command_version(config.config_rarfile_location, r'unrar.*\d', '-V')
return unrar_version
def get_kepubify_version():
return _get_command_version(config.config_kepubifypath, r'kepubify\s', '--version')

48
cps/cover.py Normal file
View File

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2022 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
try:
from wand.image import Image
use_IM = True
except (ImportError, RuntimeError) as e:
use_IM = False
NO_JPEG_EXTENSIONS = ['.png', '.webp', '.bmp']
COVER_EXTENSIONS = ['.png', '.webp', '.bmp', '.jpg', '.jpeg']
def cover_processing(tmp_file_name, img, extension):
tmp_cover_name = os.path.join(os.path.dirname(tmp_file_name), 'cover.jpg')
if extension in NO_JPEG_EXTENSIONS:
if use_IM:
with Image(blob=img) as imgc:
imgc.format = 'jpeg'
imgc.transform_colorspace('rgb')
imgc.save(filename=tmp_cover_name)
return tmp_cover_name
else:
return None
if img:
with open(tmp_cover_name, 'wb') as f:
f.write(img)
return tmp_cover_name
else:
return None

1091
cps/db.py Executable file → Normal file

File diff suppressed because it is too large Load Diff

80
cps/debug_info.py Normal file
View File

@ -0,0 +1,80 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2012-2019 cervinko, idalin, SiphonSquirrel, ouzklcn, akushsky,
# OzzieIsaacs, bodybybuddha, jkrehm, matthazinski, janeczku
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import shutil
import glob
import zipfile
import json
from io import BytesIO
from flask_babel.speaklater import LazyString
import os
from flask import send_file, __version__
from . import logger, config
from .about import collect_stats
log = logger.create()
class lazyEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, LazyString):
return str(obj)
# Let the base class default method raise the TypeError
return json.JSONEncoder.default(self, obj)
def assemble_logfiles(file_name):
log_list = sorted(glob.glob(file_name + '*'), reverse=True)
wfd = BytesIO()
for f in log_list:
with open(f, 'rb') as fd:
shutil.copyfileobj(fd, wfd)
wfd.seek(0)
if int(__version__.split('.')[0]) < 2:
return send_file(wfd,
as_attachment=True,
attachment_filename=os.path.basename(file_name))
else:
return send_file(wfd,
as_attachment=True,
download_name=os.path.basename(file_name))
def send_debug():
file_list = glob.glob(logger.get_logfile(config.config_logfile) + '*')
file_list.extend(glob.glob(logger.get_accesslogfile(config.config_access_logfile) + '*'))
for element in [logger.LOG_TO_STDOUT, logger.LOG_TO_STDERR]:
if element in file_list:
file_list.remove(element)
memory_zip = BytesIO()
with zipfile.ZipFile(memory_zip, 'w', compression=zipfile.ZIP_DEFLATED) as zf:
zf.writestr('settings.txt', json.dumps(config.to_dict(), sort_keys=True, indent=2))
zf.writestr('libs.txt', json.dumps(collect_stats(), sort_keys=True, indent=2, cls=lazyEncoder))
for fp in file_list:
zf.write(fp, os.path.basename(fp))
memory_zip.seek(0)
if int(__version__.split('.')[0]) < 2:
return send_file(memory_zip,
as_attachment=True,
attachment_filename="Calibre-Web-debug-pack.zip")
else:
return send_file(memory_zip,
as_attachment=True,
download_name="Calibre-Web-debug-pack.zip")

109
cps/dep_check.py Normal file
View File

@ -0,0 +1,109 @@
import os
import re
import sys
import json
from .constants import BASE_DIR
try:
from importlib.metadata import version
importlib = True
ImportNotFound = BaseException
except ImportError:
importlib = False
version = None
if not importlib:
try:
import pkg_resources
from pkg_resources import DistributionNotFound as ImportNotFound
pkgresources = True
except ImportError as e:
pkgresources = False
def load_dependencies(optional=False):
deps = list()
if getattr(sys, 'frozen', False):
pip_installed = os.path.join(BASE_DIR, ".pip_installed")
if os.path.exists(pip_installed):
with open(pip_installed) as f:
exe_deps = json.loads("".join(f.readlines()))
else:
return deps
if importlib or pkgresources:
if optional:
req_path = os.path.join(BASE_DIR, "optional-requirements.txt")
else:
req_path = os.path.join(BASE_DIR, "requirements.txt")
if os.path.exists(req_path):
with open(req_path, 'r') as f:
for line in f:
if not line.startswith('#') and not line == '\n' and not line.startswith('git'):
res = re.match(r'(.*?)([<=>\s]+)([\d\.]+),?\s?([<=>\s]+)?([\d\.]+)?', line.strip())
try:
if getattr(sys, 'frozen', False):
dep_version = exe_deps[res.group(1).lower().replace('_', '-')]
else:
if importlib:
dep_version = version(res.group(1))
else:
dep_version = pkg_resources.get_distribution(res.group(1)).version
except (ImportNotFound, KeyError):
if optional:
continue
dep_version = "not installed"
deps.append([dep_version, res.group(1), res.group(2), res.group(3), res.group(4), res.group(5)])
return deps
def dependency_check(optional=False):
d = list()
deps = load_dependencies(optional)
for dep in deps:
try:
dep_version_int = [int(x) if x.isnumeric() else 0 for x in dep[0].split('.')]
low_check = [int(x) for x in dep[3].split('.')]
high_check = [int(x) for x in dep[5].split('.')]
except AttributeError:
high_check = []
except ValueError:
d.append({'name': dep[1],
'target': "available",
'found': "Not available"
})
continue
if dep[2].strip() == "==":
if dep_version_int != low_check:
d.append({'name': dep[1],
'found': dep[0],
"target": dep[2] + dep[3]})
continue
elif dep[2].strip() == ">=":
if dep_version_int < low_check:
d.append({'name': dep[1],
'found': dep[0],
"target": dep[2] + dep[3]})
continue
elif dep[2].strip() == ">":
if dep_version_int <= low_check:
d.append({'name': dep[1],
'found': dep[0],
"target": dep[2] + dep[3]})
continue
if dep[4] and dep[5]:
if dep[4].strip() == "<":
if dep_version_int >= high_check:
d.append(
{'name': dep[1],
'found': dep[0],
"target": dep[4] + dep[5]})
continue
elif dep[4].strip() == "<=":
if dep_version_int > high_check:
d.append(
{'name': dep[1],
'found': dep[0],
"target": dep[4] + dep[5]})
continue
return d

1482
cps/editbooks.py Normal file

File diff suppressed because it is too large Load Diff

63
cps/embed_helper.py Normal file
View File

@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2024 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from uuid import uuid4
import os
from .file_helper import get_temp_dir
from .subproc_wrapper import process_open
from . import logger, config
from .constants import SUPPORTED_CALIBRE_BINARIES
log = logger.create()
def do_calibre_export(book_id, book_format):
try:
quotes = [3, 5, 7, 9]
tmp_dir = get_temp_dir()
calibredb_binarypath = get_calibre_binarypath("calibredb")
temp_file_name = str(uuid4())
my_env = os.environ.copy()
if config.config_calibre_split:
my_env['CALIBRE_OVERRIDE_DATABASE_PATH'] = os.path.join(config.config_calibre_dir, "metadata.db")
library_path = config.config_calibre_split_dir
else:
library_path = config.config_calibre_dir
opf_command = [calibredb_binarypath, 'export', '--dont-write-opf', '--with-library', library_path,
'--to-dir', tmp_dir, '--formats', book_format, "--template", "{}".format(temp_file_name),
str(book_id)]
p = process_open(opf_command, quotes, my_env)
_, err = p.communicate()
if err:
log.error('Metadata embedder encountered an error: %s', err)
return tmp_dir, temp_file_name
except OSError as ex:
# ToDo real error handling
log.error_or_exception(ex)
return None, None
def get_calibre_binarypath(binary):
binariesdir = config.config_binariesdir
if binariesdir:
try:
return os.path.join(binariesdir, SUPPORTED_CALIBRE_BINARIES[binary])
except KeyError as ex:
log.error("Binary not supported by Calibre-Web: %s", SUPPORTED_CALIBRE_BINARIES[binary])
pass
return ""

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
@ -17,25 +16,52 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import zipfile
from lxml import etree
import os
import uploader
import isoLanguages
from . import isoLanguages, cover
from . import config, logger
from .helper import split_authors
from .epub_helper import get_content_opf, default_ns
from .constants import BookMeta
log = logger.create()
def extractCover(zipFile, coverFile, coverpath, tmp_file_name):
if coverFile is None:
def _extract_cover(zip_file, cover_file, cover_path, tmp_file_name):
if cover_file is None:
return None
cf = extension = None
zip_cover_path = os.path.join(cover_path, cover_file).replace('\\', '/')
prefix = os.path.splitext(tmp_file_name)[0]
tmp_cover_name = prefix + '.' + os.path.basename(zip_cover_path)
ext = os.path.splitext(tmp_cover_name)
if len(ext) > 1:
extension = ext[1].lower()
if extension in cover.COVER_EXTENSIONS:
cf = zip_file.read(zip_cover_path)
return cover.cover_processing(tmp_file_name, cf, extension)
def get_epub_layout(book, book_data):
file_path = os.path.normpath(os.path.join(config.get_book_path(),
book.path, book_data.name + "." + book_data.format.lower()))
try:
tree, __ = get_content_opf(file_path, default_ns)
p = tree.xpath('/pkg:package/pkg:metadata', namespaces=default_ns)[0]
layout = p.xpath('pkg:meta[@property="rendition:layout"]/text()', namespaces=default_ns)
except (etree.XMLSyntaxError, KeyError, IndexError, OSError) as e:
log.error("Could not parse epub metadata of book {} during kobo sync: {}".format(book.id, e))
layout = []
if len(layout) == 0:
return None
else:
zipCoverPath = os.path.join(coverpath, coverFile).replace('\\', '/')
cf = zipFile.read(zipCoverPath)
prefix = os.path.splitext(tmp_file_name)[0]
tmp_cover_name = prefix + '.' + os.path.basename(zipCoverPath)
image = open(tmp_cover_name, 'wb')
image.write(cf)
image.close()
return tmp_cover_name
return layout[0]
def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
@ -45,48 +71,124 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
'dc': 'http://purl.org/dc/elements/1.1/'
}
epubZip = zipfile.ZipFile(tmp_file_path)
tree, cf_name = get_content_opf(tmp_file_path, ns)
txt = epubZip.read('META-INF/container.xml')
tree = etree.fromstring(txt)
cfname = tree.xpath('n:rootfiles/n:rootfile/@full-path', namespaces=ns)[0]
cf = epubZip.read(cfname)
tree = etree.fromstring(cf)
coverpath = os.path.dirname(cfname)
cover_path = os.path.dirname(cf_name)
p = tree.xpath('/pkg:package/pkg:metadata', namespaces=ns)[0]
epub_metadata = {}
for s in ['title', 'description', 'creator', 'language', 'subject']:
for s in ['title', 'description', 'creator', 'language', 'subject', 'publisher', 'date']:
tmp = p.xpath('dc:%s/text()' % s, namespaces=ns)
if len(tmp) > 0:
epub_metadata[s] = p.xpath('dc:%s/text()' % s, namespaces=ns)[0]
if s == 'creator':
epub_metadata[s] = ' & '.join(split_authors(tmp))
elif s == 'subject':
epub_metadata[s] = ', '.join(tmp)
elif s == 'date':
epub_metadata[s] = tmp[0][:10]
else:
epub_metadata[s] = tmp[0].strip()
else:
epub_metadata[s] = "Unknown"
epub_metadata[s] = 'Unknown'
if epub_metadata['subject'] == "Unknown":
if epub_metadata['subject'] == 'Unknown':
epub_metadata['subject'] = ''
if epub_metadata['description'] == "Unknown":
if epub_metadata['publisher'] == 'Unknown':
epub_metadata['publisher'] = ''
if epub_metadata['date'] == 'Unknown':
epub_metadata['date'] = ''
if epub_metadata['description'] == 'Unknown':
description = tree.xpath("//*[local-name() = 'description']/text()")
if len(description) > 0:
epub_metadata['description'] = description
else:
epub_metadata['description'] = ""
if epub_metadata['language'] == "Unknown":
epub_metadata['language'] = ""
else:
lang = epub_metadata['language'].split('-', 1)[0].lower()
if len(lang) == 2:
epub_metadata['language'] = isoLanguages.get(part1=lang).name
elif len(lang) == 3:
epub_metadata['language'] = isoLanguages.get(part3=lang).name
else:
epub_metadata['language'] = ""
lang = epub_metadata['language'].split('-', 1)[0].lower()
epub_metadata['language'] = isoLanguages.get_lang3(lang)
epub_metadata = parse_epub_series(ns, tree, epub_metadata)
epub_zip = zipfile.ZipFile(tmp_file_path)
cover_file = parse_epub_cover(ns, tree, epub_zip, cover_path, tmp_file_path)
identifiers = []
for node in p.xpath('dc:identifier', namespaces=ns):
try:
identifier_name = node.attrib.values()[-1]
except IndexError:
continue
identifier_value = node.text
if identifier_name in ('uuid', 'calibre') or identifier_value is None:
continue
identifiers.append([identifier_name, identifier_value])
if not epub_metadata['title']:
title = original_file_name
else:
title = epub_metadata['title']
return BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=title.encode('utf-8').decode('utf-8'),
author=epub_metadata['creator'].encode('utf-8').decode('utf-8'),
cover=cover_file,
description=epub_metadata['description'],
tags=epub_metadata['subject'].encode('utf-8').decode('utf-8'),
series=epub_metadata['series'].encode('utf-8').decode('utf-8'),
series_id=epub_metadata['series_id'].encode('utf-8').decode('utf-8'),
languages=epub_metadata['language'],
publisher=epub_metadata['publisher'].encode('utf-8').decode('utf-8'),
pubdate=epub_metadata['date'],
identifiers=identifiers)
def parse_epub_cover(ns, tree, epub_zip, cover_path, tmp_file_path):
cover_section = tree.xpath("/pkg:package/pkg:manifest/pkg:item[@id='cover-image']/@href", namespaces=ns)
for cs in cover_section:
cover_file = _extract_cover(epub_zip, cs, cover_path, tmp_file_path)
if cover_file:
return cover_file
meta_cover = tree.xpath("/pkg:package/pkg:metadata/pkg:meta[@name='cover']/@content", namespaces=ns)
if len(meta_cover) > 0:
cover_section = tree.xpath(
"/pkg:package/pkg:manifest/pkg:item[@id='"+meta_cover[0]+"']/@href", namespaces=ns)
if not cover_section:
cover_section = tree.xpath(
"/pkg:package/pkg:manifest/pkg:item[@properties='" + meta_cover[0] + "']/@href", namespaces=ns)
else:
cover_section = tree.xpath("/pkg:package/pkg:guide/pkg:reference/@href", namespaces=ns)
cover_file = None
for cs in cover_section:
if cs.endswith('.xhtml') or cs.endswith('.html'):
markup = epub_zip.read(os.path.join(cover_path, cs))
markup_tree = etree.fromstring(markup)
# no matter xhtml or html with no namespace
img_src = markup_tree.xpath("//*[local-name() = 'img']/@src")
# Alternative image source
if not len(img_src):
img_src = markup_tree.xpath("//attribute::*[contains(local-name(), 'href')]")
if len(img_src):
# img_src maybe start with "../"" so fullpath join then relpath to cwd
filename = os.path.relpath(os.path.join(os.path.dirname(os.path.join(cover_path, cover_section[0])),
img_src[0]))
cover_file = _extract_cover(epub_zip, filename, "", tmp_file_path)
else:
cover_file = _extract_cover(epub_zip, cs, cover_path, tmp_file_path)
if cover_file:
break
return cover_file
def parse_epub_series(ns, tree, epub_metadata):
series = tree.xpath("/pkg:package/pkg:metadata/pkg:meta[@name='calibre:series']/@content", namespaces=ns)
if len(series) > 0:
epub_metadata['series'] = series[0]
@ -98,41 +200,4 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension):
epub_metadata['series_id'] = series_id[0]
else:
epub_metadata['series_id'] = '1'
coversection = tree.xpath("/pkg:package/pkg:manifest/pkg:item[@id='cover-image']/@href", namespaces=ns)
coverfile = None
if len(coversection) > 0:
coverfile = extractCover(epubZip, coversection[0], coverpath, tmp_file_path)
else:
meta_cover = tree.xpath("/pkg:package/pkg:metadata/pkg:meta[@name='cover']/@content", namespaces=ns)
if len(meta_cover) > 0:
coversection = tree.xpath("/pkg:package/pkg:manifest/pkg:item[@id='"+meta_cover[0]+"']/@href", namespaces=ns)
if len(coversection) > 0:
filetype = coversection[0].rsplit('.', 1)[-1]
if filetype == "xhtml" or filetype == "html": # if cover is (x)html format
markup = epubZip.read(os.path.join(coverpath, coversection[0]))
markupTree = etree.fromstring(markup)
# no matter xhtml or html with no namespace
imgsrc = markupTree.xpath("//*[local-name() = 'img']/@src")
# imgsrc maybe startwith "../"" so fullpath join then relpath to cwd
filename = os.path.relpath(os.path.join(os.path.dirname(os.path.join(coverpath, coversection[0])), imgsrc[0]))
coverfile = extractCover(epubZip, filename, "", tmp_file_path)
else:
coverfile = extractCover(epubZip, coversection[0], coverpath, tmp_file_path)
if not epub_metadata['title']:
title = original_file_name
else:
title = epub_metadata['title']
return uploader.BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=title.encode('utf-8').decode('utf-8'),
author=epub_metadata['creator'].encode('utf-8').decode('utf-8'),
cover=coverfile,
description=epub_metadata['description'],
tags=epub_metadata['subject'].encode('utf-8').decode('utf-8'),
series=epub_metadata['series'].encode('utf-8').decode('utf-8'),
series_id=epub_metadata['series_id'].encode('utf-8').decode('utf-8'),
languages=epub_metadata['language'])
return epub_metadata

166
cps/epub_helper.py Normal file
View File

@ -0,0 +1,166 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018 lemmsh, Kennyl, Kyosfonica, matthazinski
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import zipfile
from lxml import etree
from . import isoLanguages
default_ns = {
'n': 'urn:oasis:names:tc:opendocument:xmlns:container',
'pkg': 'http://www.idpf.org/2007/opf',
}
OPF_NAMESPACE = "http://www.idpf.org/2007/opf"
PURL_NAMESPACE = "http://purl.org/dc/elements/1.1/"
OPF = "{%s}" % OPF_NAMESPACE
PURL = "{%s}" % PURL_NAMESPACE
etree.register_namespace("opf", OPF_NAMESPACE)
etree.register_namespace("dc", PURL_NAMESPACE)
OPF_NS = {None: OPF_NAMESPACE} # the default namespace (no prefix)
NSMAP = {'dc': PURL_NAMESPACE, 'opf': OPF_NAMESPACE}
def updateEpub(src, dest, filename, data, ):
# create a temp copy of the archive without filename
with zipfile.ZipFile(src, 'r') as zin:
with zipfile.ZipFile(dest, 'w') as zout:
zout.comment = zin.comment # preserve the comment
for item in zin.infolist():
if item.filename != filename:
zout.writestr(item, zin.read(item.filename))
# now add filename with its new data
with zipfile.ZipFile(dest, mode='a', compression=zipfile.ZIP_DEFLATED) as zf:
zf.writestr(filename, data)
def get_content_opf(file_path, ns=default_ns):
epubZip = zipfile.ZipFile(file_path)
txt = epubZip.read('META-INF/container.xml')
tree = etree.fromstring(txt)
cf_name = tree.xpath('n:rootfiles/n:rootfile/@full-path', namespaces=ns)[0]
cf = epubZip.read(cf_name)
return etree.fromstring(cf), cf_name
def create_new_metadata_backup(book, custom_columns, export_language, translated_cover_name, lang_type=3):
# generate root package element
package = etree.Element(OPF + "package", nsmap=OPF_NS)
package.set("unique-identifier", "uuid_id")
package.set("version", "2.0")
# generate metadata element and all sub elements of it
metadata = etree.SubElement(package, "metadata", nsmap=NSMAP)
identifier = etree.SubElement(metadata, PURL + "identifier", id="calibre_id", nsmap=NSMAP)
identifier.set(OPF + "scheme", "calibre")
identifier.text = str(book.id)
identifier2 = etree.SubElement(metadata, PURL + "identifier", id="uuid_id", nsmap=NSMAP)
identifier2.set(OPF + "scheme", "uuid")
identifier2.text = book.uuid
for i in book.identifiers:
identifier = etree.SubElement(metadata, PURL + "identifier", nsmap=NSMAP)
identifier.set(OPF + "scheme", i.format_type())
identifier.text = str(i.val)
title = etree.SubElement(metadata, PURL + "title", nsmap=NSMAP)
title.text = book.title
for author in book.authors:
creator = etree.SubElement(metadata, PURL + "creator", nsmap=NSMAP)
creator.text = str(author.name)
creator.set(OPF + "file-as", book.author_sort) # ToDo Check
creator.set(OPF + "role", "aut")
contributor = etree.SubElement(metadata, PURL + "contributor", nsmap=NSMAP)
contributor.text = "calibre (5.7.2) [https://calibre-ebook.com]"
contributor.set(OPF + "file-as", "calibre") # ToDo Check
contributor.set(OPF + "role", "bkp")
date = etree.SubElement(metadata, PURL + "date", nsmap=NSMAP)
date.text = '{d.year:04}-{d.month:02}-{d.day:02}T{d.hour:02}:{d.minute:02}:{d.second:02}'.format(d=book.pubdate)
if book.comments and book.comments[0].text:
for b in book.comments:
description = etree.SubElement(metadata, PURL + "description", nsmap=NSMAP)
description.text = b.text
for b in book.publishers:
publisher = etree.SubElement(metadata, PURL + "publisher", nsmap=NSMAP)
publisher.text = str(b.name)
if not book.languages:
language = etree.SubElement(metadata, PURL + "language", nsmap=NSMAP)
language.text = export_language
else:
for b in book.languages:
language = etree.SubElement(metadata, PURL + "language", nsmap=NSMAP)
language.text = str(b.lang_code) if lang_type == 3 else isoLanguages.get(part3=b.lang_code).part1
for b in book.tags:
subject = etree.SubElement(metadata, PURL + "subject", nsmap=NSMAP)
subject.text = str(b.name)
etree.SubElement(metadata, "meta", name="calibre:author_link_map",
content="{" + ", ".join(['"' + str(a.name) + '": ""' for a in book.authors]) + "}",
nsmap=NSMAP)
for b in book.series:
etree.SubElement(metadata, "meta", name="calibre:series",
content=str(str(b.name)),
nsmap=NSMAP)
if book.series:
etree.SubElement(metadata, "meta", name="calibre:series_index",
content=str(book.series_index),
nsmap=NSMAP)
if len(book.ratings) and book.ratings[0].rating > 0:
etree.SubElement(metadata, "meta", name="calibre:rating",
content=str(book.ratings[0].rating),
nsmap=NSMAP)
etree.SubElement(metadata, "meta", name="calibre:timestamp",
content='{d.year:04}-{d.month:02}-{d.day:02}T{d.hour:02}:{d.minute:02}:{d.second:02}'.format(
d=book.timestamp),
nsmap=NSMAP)
etree.SubElement(metadata, "meta", name="calibre:title_sort",
content=book.sort,
nsmap=NSMAP)
sequence = 0
for cc in custom_columns:
value = None
extra = None
cc_entry = getattr(book, "custom_column_" + str(cc.id))
if cc_entry.__len__():
value = [c.value for c in cc_entry] if cc.is_multiple else cc_entry[0].value
extra = cc_entry[0].extra if hasattr(cc_entry[0], "extra") else None
etree.SubElement(metadata, "meta", name="calibre:user_metadata:#{}".format(cc.label),
content=cc.to_json(value, extra, sequence),
nsmap=NSMAP)
sequence += 1
# generate guide element and all sub elements of it
# Title is translated from default export language
guide = etree.SubElement(package, "guide")
etree.SubElement(guide, "reference", type="cover", title=translated_cover_name, href="cover.jpg")
return package
def replace_metadata(tree, package):
rep_element = tree.xpath('/pkg:package/pkg:metadata', namespaces=default_ns)[0]
new_element = package.xpath('//metadata', namespaces=default_ns)[0]
tree.replace(rep_element, new_element)
return etree.tostring(tree,
xml_declaration=True,
encoding='utf-8',
pretty_print=True).decode('utf-8')

71
cps/error_handler.py Normal file
View File

@ -0,0 +1,71 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2020 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import traceback
from flask import render_template
from werkzeug.exceptions import default_exceptions
try:
from werkzeug.exceptions import FailedDependency
except ImportError:
from werkzeug.exceptions import UnprocessableEntity as FailedDependency
from . import config, app, logger, services
log = logger.create()
# custom error page
def error_http(error):
return render_template('http_error.html',
error_code="Error {0}".format(error.code),
error_name=error.name,
issue=False,
unconfigured=not config.db_configured,
instance=config.config_calibre_web_title
), error.code
def internal_error(error):
return render_template('http_error.html',
error_code="500 Internal Server Error",
error_name='The server encountered an internal error and was unable to complete your '
'request. There is an error in the application.',
issue=True,
unconfigured=False,
error_stack=traceback.format_exc().split("\n"),
instance=config.config_calibre_web_title
), 500
def init_errorhandler():
# http error handling
for ex in default_exceptions:
if ex < 500:
app.register_error_handler(ex, error_http)
elif ex == 500:
app.register_error_handler(ex, internal_error)
if services.ldap:
# Only way of catching the LDAPException upon logging in with LDAP server down
@app.errorhandler(services.ldap.LDAPException)
# pylint: disable=unused-variable
def handle_exception(e):
log.debug('LDAP server not accessible while trying to login to opds feed')
return error_http(FailedDependency())

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
@ -18,7 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from lxml import etree
import uploader
from .constants import BookMeta
def get_fb2_info(tmp_file_path, original_file_extension):
@ -28,52 +28,55 @@ def get_fb2_info(tmp_file_path, original_file_extension):
'l': 'http://www.w3.org/1999/xlink',
}
fb2_file = open(tmp_file_path)
tree = etree.fromstring(fb2_file.read())
fb2_file = open(tmp_file_path, encoding="utf-8")
tree = etree.fromstring(fb2_file.read().encode())
authors = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:author', namespaces=ns)
def get_author(element):
last_name = element.xpath('fb:last-name/text()', namespaces=ns)
if len(last_name):
last_name = last_name[0].encode('utf-8')
last_name = last_name[0]
else:
last_name = u''
last_name = ''
middle_name = element.xpath('fb:middle-name/text()', namespaces=ns)
if len(middle_name):
middle_name = middle_name[0].encode('utf-8')
middle_name = middle_name[0]
else:
middle_name = u''
middle_name = ''
first_name = element.xpath('fb:first-name/text()', namespaces=ns)
if len(first_name):
first_name = first_name[0].encode('utf-8')
first_name = first_name[0]
else:
first_name = u''
return (first_name.decode('utf-8') + u' '
+ middle_name.decode('utf-8') + u' '
+ last_name.decode('utf-8')).encode('utf-8')
first_name = ''
return (first_name + ' '
+ middle_name + ' '
+ last_name)
author = str(", ".join(map(get_author, authors)))
title = tree.xpath('/fb:FictionBook/fb:description/fb:title-info/fb:book-title/text()', namespaces=ns)
if len(title):
title = str(title[0].encode('utf-8'))
title = str(title[0])
else:
title = u''
title = ''
description = tree.xpath('/fb:FictionBook/fb:description/fb:publish-info/fb:book-name/text()', namespaces=ns)
if len(description):
description = str(description[0].encode('utf-8'))
description = str(description[0])
else:
description = u''
description = ''
return uploader.BookMeta(
return BookMeta(
file_path=tmp_file_path,
extension=original_file_extension,
title=title.decode('utf-8'),
author=author.decode('utf-8'),
title=title,
author=author,
cover=None,
description=description.decode('utf-8'),
description=description,
tags="",
series="",
series_id="",
languages="")
languages="",
publisher="",
pubdate="",
identifiers=[])

32
cps/file_helper.py Normal file
View File

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2023 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from tempfile import gettempdir
import os
import shutil
def get_temp_dir():
tmp_dir = os.path.join(gettempdir(), 'calibre_web')
if not os.path.isdir(tmp_dir):
os.mkdir(tmp_dir)
return tmp_dir
def del_temp_dir():
tmp_dir = os.path.join(gettempdir(), 'calibre_web')
shutil.rmtree(tmp_dir)

95
cps/fs.py Normal file
View File

@ -0,0 +1,95 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2020 mmonkey
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import logger
from .constants import CACHE_DIR
from os import makedirs, remove
from os.path import isdir, isfile, join
from shutil import rmtree
class FileSystem:
_instance = None
_cache_dir = CACHE_DIR
def __new__(cls):
if cls._instance is None:
cls._instance = super(FileSystem, cls).__new__(cls)
cls.log = logger.create()
return cls._instance
def get_cache_dir(self, cache_type=None):
if not isdir(self._cache_dir):
try:
makedirs(self._cache_dir)
except OSError:
self.log.info(f'Failed to create path {self._cache_dir} (Permission denied).')
raise
path = join(self._cache_dir, cache_type)
if cache_type and not isdir(path):
try:
makedirs(path)
except OSError:
self.log.info(f'Failed to create path {path} (Permission denied).')
raise
return path if cache_type else self._cache_dir
def get_cache_file_dir(self, filename, cache_type=None):
path = join(self.get_cache_dir(cache_type), filename[:2])
if not isdir(path):
try:
makedirs(path)
except OSError:
self.log.info(f'Failed to create path {path} (Permission denied).')
raise
return path
def get_cache_file_path(self, filename, cache_type=None):
return join(self.get_cache_file_dir(filename, cache_type), filename) if filename else None
def get_cache_file_exists(self, filename, cache_type=None):
path = self.get_cache_file_path(filename, cache_type)
return isfile(path)
def delete_cache_dir(self, cache_type=None):
if not cache_type and isdir(self._cache_dir):
try:
rmtree(self._cache_dir)
except OSError:
self.log.info(f'Failed to delete path {self._cache_dir} (Permission denied).')
raise
path = join(self._cache_dir, cache_type)
if cache_type and isdir(path):
try:
rmtree(path)
except OSError:
self.log.info(f'Failed to delete path {path} (Permission denied).')
raise
def delete_cache_file(self, filename, cache_type=None):
path = self.get_cache_file_path(filename, cache_type)
if isfile(path):
try:
remove(path)
except OSError:
self.log.info(f'Failed to delete path {path} (Permission denied).')
raise

156
cps/gdrive.py Normal file
View File

@ -0,0 +1,156 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import hashlib
import json
from uuid import uuid4
from time import time
from shutil import move, copyfile
from flask import Blueprint, flash, request, redirect, url_for, abort
from flask_babel import gettext as _
from flask_login import login_required
from . import logger, gdriveutils, config, ub, calibre_db, csrf
from .admin import admin_required
from .file_helper import get_temp_dir
gdrive = Blueprint('gdrive', __name__, url_prefix='/gdrive')
log = logger.create()
try:
from googleapiclient.errors import HttpError
except ImportError as err:
log.debug("Cannot import googleapiclient, using GDrive will not work: %s", err)
current_milli_time = lambda: int(round(time() * 1000))
gdrive_watch_callback_token = 'target=calibreweb-watch_files' #nosec
@gdrive.route("/authenticate")
@login_required
@admin_required
def authenticate_google_drive():
try:
authUrl = gdriveutils.Gauth.Instance().auth.GetAuthUrl()
except gdriveutils.InvalidConfigError:
flash(_('Google Drive setup not completed, try to deactivate and activate Google Drive again'),
category="error")
return redirect(url_for('web.index'))
return redirect(authUrl)
@gdrive.route("/callback")
def google_drive_callback():
auth_code = request.args.get('code')
if not auth_code:
abort(403)
try:
credentials = gdriveutils.Gauth.Instance().auth.flow.step2_exchange(auth_code)
with open(gdriveutils.CREDENTIALS, 'w') as f:
f.write(credentials.to_json())
except (ValueError, AttributeError) as error:
log.error(error)
return redirect(url_for('admin.db_configuration'))
@gdrive.route("/watch/subscribe")
@login_required
@admin_required
def watch_gdrive():
if not config.config_google_drive_watch_changes_response:
with open(gdriveutils.CLIENT_SECRETS, 'r') as settings:
filedata = json.load(settings)
address = filedata['web']['redirect_uris'][0].rstrip('/').replace('/gdrive/callback', '/gdrive/watch/callback')
notification_id = str(uuid4())
try:
result = gdriveutils.watchChange(gdriveutils.Gdrive.Instance().drive, notification_id,
'web_hook', address, gdrive_watch_callback_token, current_milli_time() + 604800*1000)
config.config_google_drive_watch_changes_response = result
config.save()
except HttpError as e:
reason=json.loads(e.content)['error']['errors'][0]
if reason['reason'] == 'push.webhookUrlUnauthorized':
flash(_('Callback domain is not verified, '
'please follow steps to verify domain in google developer console'), category="error")
else:
flash(reason['message'], category="error")
return redirect(url_for('admin.db_configuration'))
@gdrive.route("/watch/revoke")
@login_required
@admin_required
def revoke_watch_gdrive():
last_watch_response = config.config_google_drive_watch_changes_response
if last_watch_response:
try:
gdriveutils.stopChannel(gdriveutils.Gdrive.Instance().drive, last_watch_response['id'],
last_watch_response['resourceId'])
except (HttpError, AttributeError):
pass
config.config_google_drive_watch_changes_response = {}
config.save()
return redirect(url_for('admin.db_configuration'))
try:
@csrf.exempt
@gdrive.route("/watch/callback", methods=['GET', 'POST'])
def on_received_watch_confirmation():
if not config.config_google_drive_watch_changes_response:
return ''
if request.headers.get('X-Goog-Channel-Token') != gdrive_watch_callback_token \
or request.headers.get('X-Goog-Resource-State') != 'change' \
or not request.data:
return ''
log.debug('%r', request.headers)
log.debug('%r', request.data)
log.info('Change received from gdrive')
try:
j = json.loads(request.data)
log.info('Getting change details')
response = gdriveutils.getChangeById(gdriveutils.Gdrive.Instance().drive, j['id'])
log.debug('%r', response)
if response:
dbpath = os.path.join(config.config_calibre_dir, "metadata.db").encode()
if not response['deleted'] and response['file']['title'] == 'metadata.db' \
and response['file']['md5Checksum'] != hashlib.md5(dbpath): # nosec
tmp_dir = get_temp_dir()
log.info('Database file updated')
copyfile(dbpath, os.path.join(tmp_dir, "metadata.db_" + str(current_milli_time())))
log.info('Backing up existing and downloading updated metadata.db')
gdriveutils.downloadFile(None, "metadata.db", os.path.join(tmp_dir, "tmp_metadata.db"))
log.info('Setting up new DB')
# prevent error on windows, as os.rename does on existing files, also allow cross hdd move
move(os.path.join(tmp_dir, "tmp_metadata.db"), dbpath)
calibre_db.reconnect_db(config, ub.app_DB_path)
except Exception as ex:
log.error_or_exception(ex)
return ''
except AttributeError:
pass

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
@ -17,24 +16,69 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
try:
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from pydrive.auth import RefreshError, InvalidConfigError
from apiclient import errors
gdrive_support = True
except ImportError:
gdrive_support = False
import os
from ub import config
import cli
import json
import shutil
import chardet
import ssl
from flask import Response, stream_with_context
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import *
import web
from sqlalchemy import create_engine
from sqlalchemy import Column, UniqueConstraint
from sqlalchemy import String, Integer
from sqlalchemy.orm import sessionmaker, scoped_session
try:
# Compatibility with sqlalchemy 2.0
from sqlalchemy.orm import declarative_base
except ImportError:
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.exc import OperationalError, InvalidRequestError, IntegrityError
from sqlalchemy.orm.exc import StaleDataError
try:
from httplib2 import __version__ as httplib2_version
except ImportError:
httplib2_version = "not installed"
try:
from apiclient import errors
from httplib2 import ServerNotFoundError
importError = None
gdrive_support = True
except ImportError as e:
importError = e
gdrive_support = False
try:
from pydrive2.auth import GoogleAuth
from pydrive2.drive import GoogleDrive
from pydrive2.auth import RefreshError
from pydrive2.files import ApiRequestError
except ImportError as err:
try:
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from pydrive.auth import RefreshError
from pydrive.files import ApiRequestError
except ImportError as err:
importError = err
gdrive_support = False
from . import logger, cli_param, config
from .constants import CONFIG_DIR as _CONFIG_DIR
SETTINGS_YAML = os.path.join(_CONFIG_DIR, 'settings.yaml')
CREDENTIALS = os.path.join(_CONFIG_DIR, 'gdrive_credentials')
CLIENT_SECRETS = os.path.join(_CONFIG_DIR, 'client_secrets.json')
log = logger.create()
if gdrive_support:
logger.get('googleapiclient.discovery_cache').setLevel(logger.logging.ERROR)
if not logger.is_debug_enabled():
logger.get('googleapiclient.discovery').setLevel(logger.logging.ERROR)
else:
log.debug("Cannot import pydrive, httplib2, using gdrive will not work: {}".format(importError))
class Singleton:
"""
@ -67,6 +111,9 @@ class Singleton:
except AttributeError:
self._instance = self._decorated()
return self._instance
except (ImportError, NameError) as e:
log.debug(e)
return None
def __call__(self):
raise TypeError('Singletons must be accessed through `Instance()`.')
@ -78,7 +125,11 @@ class Singleton:
@Singleton
class Gauth:
def __init__(self):
self.auth = GoogleAuth(settings_file=os.path.join(config.get_main_dir,'settings.yaml'))
try:
self.auth = GoogleAuth(settings_file=SETTINGS_YAML)
except NameError as error:
log.error(error)
self.auth = None
@Singleton
@ -87,11 +138,15 @@ class Gdrive:
self.drive = getDrive(gauth=Gauth.Instance().auth)
engine = create_engine('sqlite:///{0}'.format(cli.gdpath), echo=False)
def is_gdrive_ready():
return os.path.exists(SETTINGS_YAML) and os.path.exists(CREDENTIALS)
engine = create_engine('sqlite:///{0}'.format(cli_param.gd_path), echo=False)
Base = declarative_base()
# Open session for database connection
Session = sessionmaker()
Session = sessionmaker(autoflush=False)
Session.configure(bind=engine)
session = scoped_session(Session)
@ -118,45 +173,28 @@ class PermissionAdded(Base):
return str(self.gdrive_id)
def migrate():
if not engine.dialect.has_table(engine.connect(), "permissions_added"):
PermissionAdded.__table__.create(bind = engine)
for sql in session.execute("select sql from sqlite_master where type='table'"):
if 'CREATE TABLE gdrive_ids' in sql[0]:
currUniqueConstraint = 'UNIQUE (gdrive_id)'
if currUniqueConstraint in sql[0]:
sql=sql[0].replace(currUniqueConstraint, 'UNIQUE (gdrive_id, path)')
sql=sql.replace(GdriveId.__tablename__, GdriveId.__tablename__ + '2')
session.execute(sql)
session.execute("INSERT INTO gdrive_ids2 (id, gdrive_id, path) SELECT id, "
"gdrive_id, path FROM gdrive_ids;")
session.commit()
session.execute('DROP TABLE %s' % 'gdrive_ids')
session.execute('ALTER TABLE gdrive_ids2 RENAME to gdrive_ids')
break
if not os.path.exists(cli.gdpath):
if not os.path.exists(cli_param.gd_path):
try:
Base.metadata.create_all(engine)
except Exception:
except Exception as ex:
log.error("Error connect to database: {} - {}".format(cli_param.gd_path, ex))
raise
migrate()
def getDrive(drive=None, gauth=None):
if not drive:
if not gauth:
gauth = GoogleAuth(settings_file=os.path.join(config.get_main_dir,'settings.yaml'))
gauth = GoogleAuth(settings_file=SETTINGS_YAML)
# Try to load saved client credentials
gauth.LoadCredentialsFile(os.path.join(config.get_main_dir,'gdrive_credentials'))
gauth.LoadCredentialsFile(CREDENTIALS)
if gauth.access_token_expired:
# Refresh them if expired
try:
gauth.Refresh()
except RefreshError as e:
web.app.logger.error("Google Drive error: " + e.message)
except Exception as e:
web.app.logger.exception(e)
log.error("Google Drive error: {}".format(e))
except Exception as ex:
log.error_or_exception(ex)
else:
# Initialize the saved creds
gauth.Authorize()
@ -166,18 +204,22 @@ def getDrive(drive=None, gauth=None):
try:
drive.auth.Refresh()
except RefreshError as e:
web.app.logger.error("Google Drive error: " + e.message)
log.error("Google Drive error: {}".format(e))
return drive
def listRootFolders():
drive = getDrive(Gdrive.Instance().drive)
folder = "'root' in parents and mimeType = 'application/vnd.google-apps.folder' and trashed = false"
fileList = drive.ListFile({'q': folder}).GetList()
try:
drive = getDrive(Gdrive.Instance().drive)
folder = "'root' in parents and mimeType = 'application/vnd.google-apps.folder' and trashed = false"
fileList = drive.ListFile({'q': folder}).GetList()
except (ServerNotFoundError, ssl.SSLError, RefreshError) as e:
log.info("GDrive Error {}".format(e))
fileList = []
return fileList
def getEbooksFolder(drive):
return getFolderInFolder('root',config.config_google_drive_folder,drive)
return getFolderInFolder('root', config.config_google_drive_folder, drive)
def getFolderInFolder(parentId, folderName, drive):
@ -203,11 +245,15 @@ def getEbooksFolderId(drive=None):
try:
gDriveId.gdrive_id = getEbooksFolder(drive)['id']
except Exception:
web.app.logger.error('Error gDrive, root ID not found')
log.error('Error gDrive, root ID not found')
gDriveId.path = '/'
session.merge(gDriveId)
session.commit()
return
try:
session.commit()
except OperationalError as ex:
log.error_or_exception('Database error: {}'.format(ex))
session.rollback()
return gDriveId.gdrive_id
def getFile(pathId, fileName, drive):
@ -221,37 +267,47 @@ def getFile(pathId, fileName, drive):
def getFolderId(path, drive):
# drive = getDrive(drive)
currentFolderId = getEbooksFolderId(drive)
sqlCheckPath = path if path[-1] == '/' else path + '/'
storedPathName = session.query(GdriveId).filter(GdriveId.path == sqlCheckPath).first()
currentFolderId = None
try:
currentFolderId = getEbooksFolderId(drive)
sqlCheckPath = path if path[-1] == '/' else path + '/'
storedPathName = session.query(GdriveId).filter(GdriveId.path == sqlCheckPath).first()
if not storedPathName:
dbChange = False
s = path.split('/')
for i, x in enumerate(s):
if len(x) > 0:
currentPath = "/".join(s[:i+1])
if currentPath[-1] != '/':
currentPath = currentPath + '/'
storedPathName = session.query(GdriveId).filter(GdriveId.path == currentPath).first()
if storedPathName:
currentFolderId = storedPathName.gdrive_id
else:
currentFolder = getFolderInFolder(currentFolderId, x, drive)
if currentFolder:
gDriveId = GdriveId()
gDriveId.gdrive_id = currentFolder['id']
gDriveId.path = currentPath
session.merge(gDriveId)
dbChange = True
currentFolderId = currentFolder['id']
if not storedPathName:
dbChange = False
s = path.split('/')
for i, x in enumerate(s):
if len(x) > 0:
currentPath = "/".join(s[:i+1])
if currentPath[-1] != '/':
currentPath = currentPath + '/'
storedPathName = session.query(GdriveId).filter(GdriveId.path == currentPath).first()
if storedPathName:
currentFolderId = storedPathName.gdrive_id
else:
currentFolderId = None
break
if dbChange:
session.commit()
else:
currentFolderId = storedPathName.gdrive_id
currentFolder = getFolderInFolder(currentFolderId, x, drive)
if currentFolder:
gDriveId = GdriveId()
gDriveId.gdrive_id = currentFolder['id']
gDriveId.path = currentPath
session.merge(gDriveId)
dbChange = True
currentFolderId = currentFolder['id']
else:
currentFolderId = None
break
if dbChange:
session.commit()
else:
currentFolderId = storedPathName.gdrive_id
except (OperationalError, IntegrityError, StaleDataError) as ex:
log.error_or_exception('Database error: {}'.format(ex))
session.rollback()
except ApiRequestError as ex:
log.error('{} {}'.format(ex.error['message'], path))
session.rollback()
except RefreshError as ex:
log.error(ex)
return currentFolderId
@ -269,7 +325,7 @@ def getFileFromEbooksFolder(path, fileName):
def moveGdriveFileRemote(origin_file_id, new_title):
origin_file_id['title']= new_title
origin_file_id['title'] = new_title
origin_file_id.Upload()
@ -285,17 +341,28 @@ def moveGdriveFolderRemote(origin_file, target_folder):
children = drive.auth.service.children().list(folderId=previous_parents).execute()
gFileTargetDir = getFileFromEbooksFolder(None, target_folder)
if not gFileTargetDir:
# Folder is not existing, create, and move folder
gFileTargetDir = drive.CreateFile(
{'title': target_folder, 'parents': [{"kind": "drive#fileLink", 'id': getEbooksFolderId()}],
"mimeType": "application/vnd.google-apps.folder"})
gFileTargetDir.Upload()
# Move the file to the new folder
drive.auth.service.files().update(fileId=origin_file['id'],
addParents=gFileTargetDir['id'],
removeParents=previous_parents,
fields='id, parents').execute()
# if previous_parents has no childs anymore, delete original fileparent
# Move the file to the new folder
drive.auth.service.files().update(fileId=origin_file['id'],
addParents=gFileTargetDir['id'],
removeParents=previous_parents,
fields='id, parents').execute()
elif gFileTargetDir['title'] != target_folder:
# Folder is not existing, create, and move folder
drive.auth.service.files().patch(fileId=origin_file['id'],
body={'title': target_folder},
fields='title').execute()
else:
# Move the file to the new folder
drive.auth.service.files().update(fileId=origin_file['id'],
addParents=gFileTargetDir['id'],
removeParents=previous_parents,
fields='id, parents').execute()
# if previous_parents has no children anymore, delete original fileparent
if len(children['items']) == 1:
deleteDatabaseEntry(previous_parents)
drive.auth.service.files().delete(fileId=previous_parents).execute()
@ -336,29 +403,33 @@ def copyToDrive(drive, uploadFile, createRoot, replaceFiles,
driveFile.Upload()
def uploadFileToEbooksFolder(destFile, f):
def uploadFileToEbooksFolder(destFile, f, string=False):
drive = getDrive(Gdrive.Instance().drive)
parent = getEbooksFolder(drive)
splitDir = destFile.split('/')
for i, x in enumerate(splitDir):
if i == len(splitDir)-1:
existingFiles = drive.ListFile({'q': "title = '%s' and '%s' in parents and trashed = false" %
existing_Files = drive.ListFile({'q': "title = '%s' and '%s' in parents and trashed = false" %
(x.replace("'", r"\'"), parent['id'])}).GetList()
if len(existingFiles) > 0:
driveFile = existingFiles[0]
if len(existing_Files) > 0:
driveFile = existing_Files[0]
else:
driveFile = drive.CreateFile({'title': x, 'parents': [{"kind": "drive#fileLink", 'id': parent['id']}],})
driveFile.SetContentFile(f)
driveFile = drive.CreateFile({'title': x,
'parents': [{"kind": "drive#fileLink", 'id': parent['id']}], })
if not string:
driveFile.SetContentFile(f)
else:
driveFile.SetContentString(f)
driveFile.Upload()
else:
existingFolder = drive.ListFile({'q': "title = '%s' and '%s' in parents and trashed = false" %
existing_Folder = drive.ListFile({'q': "title = '%s' and '%s' in parents and trashed = false" %
(x.replace("'", r"\'"), parent['id'])}).GetList()
if len(existingFolder) == 0:
if len(existing_Folder) == 0:
parent = drive.CreateFile({'title': x, 'parents': [{"kind": "drive#fileLink", 'id': parent['id']}],
"mimeType": "application/vnd.google-apps.folder"})
parent.Upload()
else:
parent = existingFolder[0]
parent = existing_Folder[0]
def watchChange(drive, channel_id, channel_type, channel_address,
@ -443,17 +514,23 @@ def getChangeById (drive, change_id):
change = drive.auth.service.changes().get(changeId=change_id).execute()
return change
except (errors.HttpError) as error:
web.app.logger.info(error.message)
log.error(error)
return None
except Exception as e:
web.app.logger.info(e)
except Exception as ex:
log.error(ex)
return None
# Deletes the local hashes database to force search for new folder names
def deleteDatabaseOnChange():
session.query(GdriveId).delete()
session.commit()
try:
session.query(GdriveId).delete()
session.commit()
except (OperationalError, InvalidRequestError) as ex:
session.rollback()
log.error_or_exception('Database error: {}'.format(ex))
session.rollback()
def updateGdriveCalibreFromLocal():
copyToDrive(Gdrive.Instance().drive, config.config_calibre_dir, False, True)
@ -463,20 +540,29 @@ def updateGdriveCalibreFromLocal():
# update gdrive.db on edit of books title
def updateDatabaseOnEdit(ID,newPath):
sqlCheckPath = newPath if newPath[-1] == '/' else newPath + u'/'
sqlCheckPath = newPath if newPath[-1] == '/' else newPath + '/'
storedPathName = session.query(GdriveId).filter(GdriveId.gdrive_id == ID).first()
if storedPathName:
storedPathName.path = sqlCheckPath
session.commit()
try:
session.commit()
except OperationalError as ex:
log.error_or_exception('Database error: {}'.format(ex))
session.rollback()
# Deletes the hashes in database of deleted book
def deleteDatabaseEntry(ID):
session.query(GdriveId).filter(GdriveId.gdrive_id == ID).delete()
session.commit()
try:
session.commit()
except OperationalError as ex:
log.error_or_exception('Database error: {}'.format(ex))
session.rollback()
# Gets cover file from gdrive
# ToDo: Check is this right everyone get read permissions on cover files?
def get_cover_via_gdrive(cover_path):
df = getFileFromEbooksFolder(cover_path, 'cover.jpg')
if df:
@ -490,7 +576,34 @@ def get_cover_via_gdrive(cover_path):
permissionAdded = PermissionAdded()
permissionAdded.gdrive_id = df['id']
session.add(permissionAdded)
session.commit()
try:
session.commit()
except OperationalError as ex:
log.error_or_exception('Database error: {}'.format(ex))
session.rollback()
return df.metadata.get('webContentLink')
else:
return None
# Gets cover file from gdrive
def get_metadata_backup_via_gdrive(metadata_path):
df = getFileFromEbooksFolder(metadata_path, 'metadata.opf')
if df:
if not session.query(PermissionAdded).filter(PermissionAdded.gdrive_id == df['id']).first():
df.GetPermissions()
df.InsertPermission({
'type': 'anyone',
'value': 'anyone',
'role': 'writer', # ToDo needs write access
'withLink': True})
permissionAdded = PermissionAdded()
permissionAdded.gdrive_id = df['id']
session.add(permissionAdded)
try:
session.commit()
except OperationalError as ex:
log.error_or_exception('Database error: {}'.format(ex))
session.rollback()
return df.metadata.get('webContentLink')
else:
return None
@ -504,18 +617,75 @@ def partial(total_byte_len, part_size_limit):
return s
# downloads files in chunks from gdrive
def do_gdrive_download(df, headers):
def do_gdrive_download(df, headers, convert_encoding=False):
total_size = int(df.metadata.get('fileSize'))
download_url = df.metadata.get('downloadUrl')
s = partial(total_size, 1024 * 1024) # I'm downloading BIG files, so 100M chunk size is fine for me
def stream():
def stream(convert_encoding):
for byte in s:
headers = {"Range": 'bytes=%s-%s' % (byte[0], byte[1])}
headers = {"Range": 'bytes={}-{}'.format(byte[0], byte[1])}
resp, content = df.auth.Get_Http_Object().request(download_url, headers=headers)
if resp.status == 206:
if convert_encoding:
result = chardet.detect(content)
content = content.decode(result['encoding']).encode('utf-8')
yield content
else:
web.app.logger.info('An error occurred: %s' % resp)
log.warning('An error occurred: {}'.format(resp))
return
return Response(stream_with_context(stream()), headers=headers)
return Response(stream_with_context(stream(convert_encoding)), headers=headers)
_SETTINGS_YAML_TEMPLATE = """
client_config_backend: settings
client_config_file: %(client_file)s
client_config:
client_id: %(client_id)s
client_secret: %(client_secret)s
redirect_uri: %(redirect_uri)s
save_credentials: True
save_credentials_backend: file
save_credentials_file: %(credential)s
get_refresh_token: True
oauth_scope:
- https://www.googleapis.com/auth/drive
"""
def update_settings(client_id, client_secret, redirect_uri):
if redirect_uri.endswith('/'):
redirect_uri = redirect_uri[:-1]
config_params = {
'client_file': CLIENT_SECRETS,
'client_id': client_id,
'client_secret': client_secret,
'redirect_uri': redirect_uri,
'credential': CREDENTIALS
}
with open(SETTINGS_YAML, 'w') as f:
f.write(_SETTINGS_YAML_TEMPLATE % config_params)
def get_error_text(client_secrets=None):
if not gdrive_support:
return 'Import of optional Google Drive requirements missing'
if not os.path.isfile(CLIENT_SECRETS):
return 'client_secrets.json is missing or not readable'
try:
with open(CLIENT_SECRETS, 'r') as settings:
filedata = json.load(settings)
except PermissionError:
return 'client_secrets.json is missing or not readable'
if 'web' not in filedata:
return 'client_secrets.json is not configured for web application'
if 'redirect_uris' not in filedata['web']:
return 'Callback url (redirect url) is missing in client_secrets.json'
if client_secrets:
client_secrets.update(filedata['web'])

29
cps/gevent_wsgi.py Normal file
View File

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2022 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from gevent.pywsgi import WSGIHandler
class MyWSGIHandler(WSGIHandler):
def get_environ(self):
env = super().get_environ()
path, __ = self.path.split('?', 1) if '?' in self.path else (self.path, '')
env['RAW_URI'] = path
return env

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2019 pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from .iso_language_names import LANGUAGE_NAMES as _LANGUAGE_NAMES
from . import logger
log = logger.create()
try:
from iso639 import languages, __version__
@ -15,14 +35,66 @@ except ImportError:
__version__ = "? (PyCountry)"
def _copy_fields(l):
l.part1 = l.alpha_2
l.part3 = l.alpha_3
l.part1 = getattr(l, 'alpha_2', None)
l.part3 = getattr(l, 'alpha_3', None)
return l
def get(name=None, part1=None, part3=None):
if (part3 is not None):
if part3 is not None:
return _copy_fields(pyc_languages.get(alpha_3=part3))
if (part1 is not None):
if part1 is not None:
return _copy_fields(pyc_languages.get(alpha_2=part1))
if (name is not None):
if name is not None:
return _copy_fields(pyc_languages.get(name=name))
def get_language_names(locale):
return _LANGUAGE_NAMES.get(str(locale))
def get_language_name(locale, lang_code):
try:
return get_language_names(locale)[lang_code]
except KeyError:
log.error('Missing translation for language name: {}'.format(lang_code))
return "Unknown"
def get_language_codes(locale, language_names, remainder=None):
language_names = set(x.strip().lower() for x in language_names if x)
lang = list()
for k, v in get_language_names(locale).items():
v = v.lower()
if v in language_names:
lang.append(k)
language_names.remove(v)
if remainder is not None and language_names:
remainder.extend(language_names)
return lang
def get_valid_language_codes(locale, language_names, remainder=None):
lang = list()
if "" in language_names:
language_names.remove("")
for k, __ in get_language_names(locale).items():
if k in language_names:
lang.append(k)
language_names.remove(k)
if remainder is not None and len(language_names):
remainder.extend(language_names)
return lang
def get_lang3(lang):
try:
if len(lang) == 2:
ret_value = get(part1=lang).part3
elif len(lang) == 3:
ret_value = lang
else:
ret_value = ""
except KeyError:
ret_value = lang
return ret_value

10976
cps/iso_language_names.py Normal file

File diff suppressed because it is too large Load Diff

182
cps/jinjia.py Normal file
View File

@ -0,0 +1,182 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# custom jinja filters
from markupsafe import escape
import datetime
import mimetypes
from uuid import uuid4
# from babel.dates import format_date
from flask import Blueprint, request, url_for
from flask_babel import format_date
from flask_login import current_user
from . import constants, logger
jinjia = Blueprint('jinjia', __name__)
log = logger.create()
# pagination links in jinja
@jinjia.app_template_filter('url_for_other_page')
def url_for_other_page(page):
args = request.view_args.copy()
args['page'] = page
for get, val in request.args.items():
args[get] = val
return url_for(request.endpoint, **args)
# shortentitles to at longest nchar, shorten longer words if necessary
@jinjia.app_template_filter('shortentitle')
def shortentitle_filter(s, nchar=20):
text = s.split()
res = "" # result
suml = 0 # overall length
for line in text:
if suml >= 60:
res += '...'
break
# if word longer than 20 chars truncate line and append '...', otherwise add whole word to result
# string, and summarize total length to stop at chars given by nchar
if len(line) > nchar:
res += line[:(nchar-3)] + '[..] '
suml += nchar+3
else:
res += line + ' '
suml += len(line) + 1
return res.strip()
@jinjia.app_template_filter('mimetype')
def mimetype_filter(val):
return mimetypes.types_map.get('.' + val, 'application/octet-stream')
@jinjia.app_template_filter('formatdate')
def formatdate_filter(val):
try:
return format_date(val, format='medium')
except AttributeError as e:
log.error('Babel error: %s, Current user locale: %s, Current User: %s', e,
current_user.locale,
current_user.name
)
return val
@jinjia.app_template_filter('formatdateinput')
def format_date_input(val):
input_date = val.isoformat().split('T', 1)[0] # Hack to support dates <1900
return '' if input_date == "0101-01-01" else input_date
@jinjia.app_template_filter('strftime')
def timestamptodate(date, fmt=None):
date = datetime.datetime.fromtimestamp(
int(date)/1000
)
native = date.replace(tzinfo=None)
if fmt:
time_format = fmt
else:
time_format = '%d %m %Y - %H:%S'
return native.strftime(time_format)
@jinjia.app_template_filter('yesno')
def yesno(value, yes, no):
return yes if value else no
@jinjia.app_template_filter('formatfloat')
def formatfloat(value, decimals=1):
value = 0 if not value else value
return ('{0:.' + str(decimals) + 'f}').format(value).rstrip('0').rstrip('.')
@jinjia.app_template_filter('formatseriesindex')
def formatseriesindex_filter(series_index):
if series_index:
try:
if int(series_index) - series_index == 0:
return int(series_index)
else:
return series_index
except (ValueError, TypeError):
return series_index
return 0
@jinjia.app_template_filter('escapedlink')
def escapedlink_filter(url, text):
return "<a href='{}'>{}</a>".format(url, escape(text))
@jinjia.app_template_filter('uuidfilter')
def uuidfilter(var):
return uuid4()
@jinjia.app_template_filter('cache_timestamp')
def cache_timestamp(rolling_period='month'):
if rolling_period == 'day':
return str(int(datetime.datetime.today().replace(hour=1, minute=1).timestamp()))
elif rolling_period == 'year':
return str(int(datetime.datetime.today().replace(day=1).timestamp()))
else:
return str(int(datetime.datetime.today().replace(month=1, day=1).timestamp()))
@jinjia.app_template_filter('last_modified')
def book_last_modified(book):
return str(int(book.last_modified.timestamp()))
@jinjia.app_template_filter('get_cover_srcset')
def get_cover_srcset(book):
srcset = list()
resolutions = {
constants.COVER_THUMBNAIL_SMALL: 'sm',
constants.COVER_THUMBNAIL_MEDIUM: 'md',
constants.COVER_THUMBNAIL_LARGE: 'lg'
}
for resolution, shortname in resolutions.items():
url = url_for('web.get_cover', book_id=book.id, resolution=shortname, c=book_last_modified(book))
srcset.append(f'{url} {resolution}x')
return ', '.join(srcset)
@jinjia.app_template_filter('get_series_srcset')
def get_cover_srcset(series):
srcset = list()
resolutions = {
constants.COVER_THUMBNAIL_SMALL: 'sm',
constants.COVER_THUMBNAIL_MEDIUM: 'md',
constants.COVER_THUMBNAIL_LARGE: 'lg'
}
for resolution, shortname in resolutions.items():
url = url_for('web.get_series_cover', series_id=series.id, resolution=shortname, c=cache_timestamp())
srcset.append(f'{url} {resolution}x')
return ', '.join(srcset)

1245
cps/kobo.py Normal file

File diff suppressed because it is too large Load Diff

174
cps/kobo_auth.py Normal file
View File

@ -0,0 +1,174 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 shavitmichael, OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""This module is used to control authentication/authorization of Kobo sync requests.
This module also includes research notes into the auth protocol used by Kobo devices.
Log-in:
When first booting a Kobo device the user must sign into a Kobo (or affiliate) account.
Upon successful sign-in, the user is redirected to
https://auth.kobobooks.com/CrossDomainSignIn?id=<some id>
which serves the following response:
<script type='text/javascript'>
location.href='kobo://UserAuthenticated?userId=<redacted>&userKey<redacted>&email=<redacted>&returnUrl=https%3a%2f%2fwww.kobo.com';
</script>
And triggers the insertion of a userKey into the device's User table.
Together, the device's DeviceId and UserKey act as an *irrevocable* authentication
token to most (if not all) Kobo APIs. In fact, in most cases only the UserKey is
required to authorize the API call.
Changing Kobo password *does not* invalidate user keys! This is apparently a known
issue for a few years now https://www.mobileread.com/forums/showpost.php?p=3476851&postcount=13
(although this poster hypothesised that Kobo could blacklist a DeviceId, many endpoints
will still grant access given the userkey.)
Official Kobo Store Api authorization:
* For most of the endpoints we care about (sync, metadata, tags, etc), the userKey is
passed in the x-kobo-userkey header, and is sufficient to authorize the API call.
* Some endpoints (e.g: AnnotationService) instead make use of Bearer tokens pass through
an authorization header. To get a BearerToken, the device makes a POST request to the
v1/auth/device endpoint with the secret UserKey and the device's DeviceId.
* The book download endpoint passes an auth token as a URL param instead of a header.
Our implementation:
We pretty much ignore all of the above. To authenticate the user, we generate a random
and unique token that they append to the CalibreWeb Url when setting up the api_store
setting on the device.
Thus, every request from the device to the api_store will hit CalibreWeb with the
auth_token in the url (e.g: https://mylibrary.com/<auth_token>/v1/library/sync).
In addition, once authenticated we also set the login cookie on the response that will
be sent back for the duration of the session to authorize subsequent API calls (in
particular calls to non-Kobo specific endpoints such as the CalibreWeb book download).
"""
from binascii import hexlify
from datetime import datetime
from os import urandom
from functools import wraps
from flask import g, Blueprint, abort, request
from flask_login import login_user, current_user, login_required
from flask_babel import gettext as _
from flask_limiter import RateLimitExceeded
from . import logger, config, calibre_db, db, helper, ub, lm, limiter
from .render_template import render_title_template
log = logger.create()
kobo_auth = Blueprint("kobo_auth", __name__, url_prefix="/kobo_auth")
@kobo_auth.route("/generate_auth_token/<int:user_id>")
@login_required
def generate_auth_token(user_id):
warning = False
host_list = request.host.rsplit(':')
if len(host_list) == 1:
host = ':'.join(host_list)
else:
host = ':'.join(host_list[0:-1])
if host.startswith('127.') or host.lower() == 'localhost' or host.startswith('[::ffff:7f') or host == "[::1]":
warning = _('Please access Calibre-Web from non localhost to get valid api_endpoint for kobo device')
# Generate auth token if none is existing for this user
auth_token = ub.session.query(ub.RemoteAuthToken).filter(
ub.RemoteAuthToken.user_id == user_id
).filter(ub.RemoteAuthToken.token_type==1).first()
if not auth_token:
auth_token = ub.RemoteAuthToken()
auth_token.user_id = user_id
auth_token.expiration = datetime.max
auth_token.auth_token = (hexlify(urandom(16))).decode("utf-8")
auth_token.token_type = 1
ub.session.add(auth_token)
ub.session_commit()
books = calibre_db.session.query(db.Books).join(db.Data).all()
for book in books:
formats = [data.format for data in book.data]
if 'KEPUB' not in formats and config.config_kepubifypath and 'EPUB' in formats:
helper.convert_book_format(book.id, config.config_calibre_dir, 'EPUB', 'KEPUB', current_user.name)
return render_title_template(
"generate_kobo_auth_url.html",
title=_("Kobo Setup"),
auth_token=auth_token.auth_token,
warning = warning
)
@kobo_auth.route("/deleteauthtoken/<int:user_id>", methods=["POST"])
@login_required
def delete_auth_token(user_id):
# Invalidate any previously generated Kobo Auth token for this user
ub.session.query(ub.RemoteAuthToken).filter(ub.RemoteAuthToken.user_id == user_id)\
.filter(ub.RemoteAuthToken.token_type==1).delete()
return ub.session_commit()
def disable_failed_auth_redirect_for_blueprint(bp):
lm.blueprint_login_views[bp.name] = None
def get_auth_token():
if "auth_token" in g:
return g.get("auth_token")
else:
return None
def register_url_value_preprocessor(kobo):
@kobo.url_value_preprocessor
# pylint: disable=unused-variable
def pop_auth_token(__, values):
g.auth_token = values.pop("auth_token")
def requires_kobo_auth(f):
@wraps(f)
def inner(*args, **kwargs):
auth_token = get_auth_token()
if auth_token is not None:
try:
limiter.check()
except RateLimitExceeded:
return abort(429)
except (ConnectionError, Exception) as e:
log.error("Connection error to limiter backend: %s", e)
return abort(429)
user = (
ub.session.query(ub.User)
.join(ub.RemoteAuthToken)
.filter(ub.RemoteAuthToken.auth_token == auth_token).filter(ub.RemoteAuthToken.token_type==1)
.first()
)
if user is not None:
login_user(user)
[limiter.limiter.storage.clear(k.key) for k in limiter.current_limits]
return f(*args, **kwargs)
log.debug("Received Kobo request without a recognizable auth token.")
return abort(401)
return inner

88
cps/kobo_sync_status.py Normal file
View File

@ -0,0 +1,88 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from flask_login import current_user
from . import ub
import datetime
from sqlalchemy.sql.expression import or_, and_, true
from sqlalchemy import exc
# Add the current book id to kobo_synced_books table for current user, if entry is already present,
# do nothing (safety precaution)
def add_synced_books(book_id):
is_present = ub.session.query(ub.KoboSyncedBooks).filter(ub.KoboSyncedBooks.book_id == book_id)\
.filter(ub.KoboSyncedBooks.user_id == current_user.id).count()
if not is_present:
synced_book = ub.KoboSyncedBooks()
synced_book.user_id = current_user.id
synced_book.book_id = book_id
ub.session.add(synced_book)
ub.session_commit()
# Select all entries of current book in kobo_synced_books table, which are from current user and delete them
def remove_synced_book(book_id, all=False, session=None):
if not all:
user = ub.KoboSyncedBooks.user_id == current_user.id
else:
user = true()
if not session:
ub.session.query(ub.KoboSyncedBooks).filter(ub.KoboSyncedBooks.book_id == book_id).filter(user).delete()
ub.session_commit()
else:
session.query(ub.KoboSyncedBooks).filter(ub.KoboSyncedBooks.book_id == book_id).filter(user).delete()
ub.session_commit(_session=session)
def change_archived_books(book_id, state=None, message=None):
archived_book = ub.session.query(ub.ArchivedBook).filter(and_(ub.ArchivedBook.user_id == int(current_user.id),
ub.ArchivedBook.book_id == book_id)).first()
if not archived_book:
archived_book = ub.ArchivedBook(user_id=current_user.id, book_id=book_id)
archived_book.is_archived = state if state else not archived_book.is_archived
archived_book.last_modified = datetime.datetime.utcnow() # toDo. Check utc timestamp
ub.session.merge(archived_book)
ub.session_commit(message)
return archived_book.is_archived
# select all books which are synced by the current user and do not belong to a synced shelf and set them to archive
# select all shelves from current user which are synced and do not belong to the "only sync" shelves
def update_on_sync_shelfs(user_id):
books_to_archive = (ub.session.query(ub.KoboSyncedBooks)
.join(ub.BookShelf, ub.KoboSyncedBooks.book_id == ub.BookShelf.book_id, isouter=True)
.join(ub.Shelf, ub.Shelf.user_id == user_id, isouter=True)
.filter(or_(ub.Shelf.kobo_sync == 0, ub.Shelf.kobo_sync == None))
.filter(ub.KoboSyncedBooks.user_id == user_id).all())
for b in books_to_archive:
change_archived_books(b.book_id, True)
ub.session.query(ub.KoboSyncedBooks) \
.filter(ub.KoboSyncedBooks.book_id == b.book_id) \
.filter(ub.KoboSyncedBooks.user_id == user_id).delete()
ub.session_commit()
# Search all shelf which are currently not synced
shelves_to_archive = ub.session.query(ub.Shelf).filter(ub.Shelf.user_id == user_id).filter(
ub.Shelf.kobo_sync == 0).all()
for a in shelves_to_archive:
ub.session.add(ub.ShelfArchive(uuid=a.uuid, user_id=user_id))
ub.session_commit()

209
cps/logger.py Normal file
View File

@ -0,0 +1,209 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2019 pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import inspect
import logging
from logging import Formatter, StreamHandler
from logging.handlers import RotatingFileHandler
from .constants import CONFIG_DIR as _CONFIG_DIR
ACCESS_FORMATTER_GEVENT = Formatter("%(message)s")
ACCESS_FORMATTER_TORNADO = Formatter("[%(asctime)s] %(message)s")
FORMATTER = Formatter("[%(asctime)s] %(levelname)5s {%(name)s:%(lineno)d} %(message)s")
DEFAULT_LOG_LEVEL = logging.INFO
DEFAULT_LOG_FILE = os.path.join(_CONFIG_DIR, "calibre-web.log")
DEFAULT_ACCESS_LOG = os.path.join(_CONFIG_DIR, "access.log")
LOG_TO_STDERR = '/dev/stderr'
LOG_TO_STDOUT = '/dev/stdout'
logging.addLevelName(logging.WARNING, "WARN")
logging.addLevelName(logging.CRITICAL, "CRIT")
class _Logger(logging.Logger):
def error_or_exception(self, message, stacklevel=2, *args, **kwargs):
if sys.version_info > (3, 7):
if is_debug_enabled():
self.exception(message, stacklevel=stacklevel, *args, **kwargs)
else:
self.error(message, stacklevel=stacklevel, *args, **kwargs)
else:
if is_debug_enabled():
self.exception(message, stack_info=True, *args, **kwargs)
else:
self.error(message, *args, **kwargs)
def debug_no_auth(self, message, *args, **kwargs):
message = message.strip("\r\n")
if message.startswith("send: AUTH"):
self.debug(message[:16], *args, **kwargs)
else:
self.debug(message, *args, **kwargs)
def get(name=None):
return logging.getLogger(name)
def create():
parent_frame = inspect.stack(0)[1]
if hasattr(parent_frame, 'frame'):
parent_frame = parent_frame.frame
else:
parent_frame = parent_frame[0]
parent_module = inspect.getmodule(parent_frame)
return get(parent_module.__name__)
def is_debug_enabled():
return logging.root.level <= logging.DEBUG
def is_info_enabled(logger):
return logging.getLogger(logger).level <= logging.INFO
def get_level_name(level):
return logging.getLevelName(level)
def is_valid_logfile(file_path):
if file_path == LOG_TO_STDERR or file_path == LOG_TO_STDOUT:
return True
if not file_path:
return True
if os.path.isdir(file_path):
return False
log_dir = os.path.dirname(file_path)
return (not log_dir) or os.path.isdir(log_dir)
def _absolute_log_file(log_file, default_log_file):
if log_file:
if not os.path.dirname(log_file):
log_file = os.path.join(_CONFIG_DIR, log_file)
return os.path.abspath(log_file)
return default_log_file
def get_logfile(log_file):
return _absolute_log_file(log_file, DEFAULT_LOG_FILE)
def get_accesslogfile(log_file):
return _absolute_log_file(log_file, DEFAULT_ACCESS_LOG)
def setup(log_file, log_level=None):
"""
Configure the logging output.
May be called multiple times.
"""
log_level = log_level or DEFAULT_LOG_LEVEL
logging.setLoggerClass(_Logger)
logging.getLogger(__package__).setLevel(log_level)
r = logging.root
if log_level >= logging.INFO or os.environ.get('FLASK_DEBUG'):
# avoid spamming the log with debug messages from libraries
r.setLevel(log_level)
# Otherwise, name gets destroyed on Windows
if log_file != LOG_TO_STDERR and log_file != LOG_TO_STDOUT:
log_file = _absolute_log_file(log_file, DEFAULT_LOG_FILE)
previous_handler = r.handlers[0] if r.handlers else None
if previous_handler:
# if the log_file has not changed, don't create a new handler
if getattr(previous_handler, 'baseFilename', None) == log_file:
return "" if log_file == DEFAULT_LOG_FILE else log_file
logging.debug("logging to %s level %s", log_file, r.level)
if log_file == LOG_TO_STDERR or log_file == LOG_TO_STDOUT:
if log_file == LOG_TO_STDOUT:
file_handler = StreamHandler(sys.stdout)
file_handler.baseFilename = log_file
else:
file_handler = StreamHandler(sys.stderr)
file_handler.baseFilename = log_file
else:
try:
file_handler = RotatingFileHandler(log_file, maxBytes=100000, backupCount=2, encoding='utf-8')
except (IOError, PermissionError):
if log_file == DEFAULT_LOG_FILE:
raise
file_handler = RotatingFileHandler(DEFAULT_LOG_FILE, maxBytes=100000, backupCount=2, encoding='utf-8')
log_file = ""
file_handler.setFormatter(FORMATTER)
for h in r.handlers:
r.removeHandler(h)
h.close()
r.addHandler(file_handler)
logging.captureWarnings(True)
return "" if log_file == DEFAULT_LOG_FILE else log_file
def create_access_log(log_file, log_name, formatter):
"""
One-time configuration for the web server's access log.
"""
log_file = _absolute_log_file(log_file, DEFAULT_ACCESS_LOG)
logging.debug("access log: %s", log_file)
access_log = logging.getLogger(log_name)
access_log.propagate = False
access_log.setLevel(logging.INFO)
try:
file_handler = RotatingFileHandler(log_file, maxBytes=50000, backupCount=2, encoding='utf-8')
except (IOError, PermissionError):
if log_file == DEFAULT_ACCESS_LOG:
raise
file_handler = RotatingFileHandler(DEFAULT_ACCESS_LOG, maxBytes=50000, backupCount=2, encoding='utf-8')
log_file = ""
file_handler.setFormatter(formatter)
access_log.addHandler(file_handler)
return access_log, "" if _absolute_log_file(log_file, DEFAULT_ACCESS_LOG) == DEFAULT_ACCESS_LOG else log_file
# Enable logging of smtp lib debug output
class StderrLogger(object):
def __init__(self, name=None):
self.log = get(name or self.__class__.__name__)
self.buffer = ''
def write(self, message):
try:
if message == '\n':
self.log.debug(self.buffer.replace('\n', '\\n'))
self.buffer = ''
else:
self.buffer += message
except Exception:
self.log.debug("Logging Error")
# default configuration, before application settings are applied
setup(LOG_TO_STDERR, logging.DEBUG if os.environ.get('FLASK_DEBUG') else DEFAULT_LOG_LEVEL)

81
cps/main.py Normal file
View File

@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2012-2022 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from . import create_app, limiter
from .jinjia import jinjia
from .remotelogin import remotelogin
from flask import request
def request_username():
return request.authorization.username
def main():
app = create_app()
from .web import web
from .opds import opds
from .admin import admi
from .gdrive import gdrive
from .editbooks import editbook
from .about import about
from .search import search
from .search_metadata import meta
from .shelf import shelf
from .tasks_status import tasks
from .error_handler import init_errorhandler
try:
from .kobo import kobo, get_kobo_activated
from .kobo_auth import kobo_auth
from flask_limiter.util import get_remote_address
kobo_available = get_kobo_activated()
except (ImportError, AttributeError): # Catch also error for not installed flask-WTF (missing csrf decorator)
kobo_available = False
try:
from .oauth_bb import oauth
oauth_available = True
except ImportError:
oauth_available = False
from . import web_server
init_errorhandler()
app.register_blueprint(search)
app.register_blueprint(tasks)
app.register_blueprint(web)
app.register_blueprint(opds)
limiter.limit("3/minute",key_func=request_username)(opds)
app.register_blueprint(jinjia)
app.register_blueprint(about)
app.register_blueprint(shelf)
app.register_blueprint(admi)
app.register_blueprint(remotelogin)
app.register_blueprint(meta)
app.register_blueprint(gdrive)
app.register_blueprint(editbook)
if kobo_available:
app.register_blueprint(kobo)
app.register_blueprint(kobo_auth)
limiter.limit("3/minute", key_func=get_remote_address)(kobo)
if oauth_available:
app.register_blueprint(oauth)
success = web_server.start()
sys.exit(0 if success else 1)

View File

@ -0,0 +1,141 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2022 quarz12
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import concurrent.futures
import requests
from bs4 import BeautifulSoup as BS # requirement
from typing import List, Optional
try:
import cchardet #optional for better speed
except ImportError:
pass
from cps import logger
from cps.services.Metadata import MetaRecord, MetaSourceInfo, Metadata
import cps.logger as logger
#from time import time
from operator import itemgetter
log = logger.create()
log = logger.create()
class Amazon(Metadata):
__name__ = "Amazon"
__id__ = "amazon"
headers = {'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'sec-gpc': '1',
'sec-fetch-site': 'none',
'sec-fetch-mode': 'navigate',
'sec-fetch-user': '?1',
'sec-fetch-dest': 'document',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'en-US,en;q=0.9'}
session = requests.Session()
session.headers=headers
def search(
self, query: str, generic_cover: str = "", locale: str = "en"
) -> Optional[List[MetaRecord]]:
#timer=time()
def inner(link, index) -> [dict, int]:
with self.session as session:
try:
r = session.get(f"https://www.amazon.com/{link}")
r.raise_for_status()
except Exception as ex:
log.warning(ex)
return None
long_soup = BS(r.text, "lxml") #~4sec :/
soup2 = long_soup.find("div", attrs={"cel_widget_id": "dpx-books-ppd_csm_instrumentation_wrapper"})
if soup2 is None:
return None
try:
match = MetaRecord(
title = "",
authors = "",
source=MetaSourceInfo(
id=self.__id__,
description="Amazon Books",
link="https://amazon.com/"
),
url = f"https://www.amazon.com{link}",
#the more searches the slower, these are too hard to find in reasonable time or might not even exist
publisher= "", # very unreliable
publishedDate= "", # very unreliable
id = None, # ?
tags = [] # dont exist on amazon
)
try:
match.description = "\n".join(
soup2.find("div", attrs={"data-feature-name": "bookDescription"}).stripped_strings)\
.replace("\xa0"," ")[:-9].strip().strip("\n")
except (AttributeError, TypeError):
return None # if there is no description it is not a book and therefore should be ignored
try:
match.title = soup2.find("span", attrs={"id": "productTitle"}).text
except (AttributeError, TypeError):
match.title = ""
try:
match.authors = [next(
filter(lambda i: i != " " and i != "\n" and not i.startswith("{"),
x.findAll(string=True))).strip()
for x in soup2.findAll("span", attrs={"class": "author"})]
except (AttributeError, TypeError, StopIteration):
match.authors = ""
try:
match.rating = int(
soup2.find("span", class_="a-icon-alt").text.split(" ")[0].split(".")[
0]) # first number in string
except (AttributeError, ValueError):
match.rating = 0
try:
match.cover = soup2.find("img", attrs={"class": "a-dynamic-image frontImage"})["src"]
except (AttributeError, TypeError):
match.cover = ""
return match, index
except Exception as e:
log.error_or_exception(e)
return None
val = list()
if self.active:
try:
results = self.session.get(
f"https://www.amazon.com/s?k={query.replace(' ', '+')}&i=digital-text&sprefix={query.replace(' ', '+')}"
f"%2Cdigital-text&ref=nb_sb_noss",
headers=self.headers)
results.raise_for_status()
except requests.exceptions.HTTPError as e:
log.error_or_exception(e)
return []
except Exception as e:
log.warning(e)
return []
soup = BS(results.text, 'html.parser')
links_list = [next(filter(lambda i: "digital-text" in i["href"], x.findAll("a")))["href"] for x in
soup.findAll("div", attrs={"data-component-type": "s-search-result"})]
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
fut = {executor.submit(inner, link, index) for index, link in enumerate(links_list[:5])}
val = list(map(lambda x : x.result() ,concurrent.futures.as_completed(fut)))
result = list(filter(lambda x: x, val))
return [x[0] for x in sorted(result, key=itemgetter(1))] #sort by amazons listing order for best relevance

View File

@ -0,0 +1,92 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ComicVine api document: https://comicvine.gamespot.com/api/documentation
from typing import Dict, List, Optional
from urllib.parse import quote
import requests
from cps import logger
from cps.services.Metadata import MetaRecord, MetaSourceInfo, Metadata
log = logger.create()
class ComicVine(Metadata):
__name__ = "ComicVine"
__id__ = "comicvine"
DESCRIPTION = "ComicVine Books"
META_URL = "https://comicvine.gamespot.com/"
API_KEY = "57558043c53943d5d1e96a9ad425b0eb85532ee6"
BASE_URL = (
f"https://comicvine.gamespot.com/api/search?api_key={API_KEY}"
f"&resources=issue&query="
)
QUERY_PARAMS = "&sort=name:desc&format=json"
HEADERS = {"User-Agent": "Not Evil Browser"}
def search(
self, query: str, generic_cover: str = "", locale: str = "en"
) -> Optional[List[MetaRecord]]:
val = list()
if self.active:
title_tokens = list(self.get_title_tokens(query, strip_joiners=False))
if title_tokens:
tokens = [quote(t.encode("utf-8")) for t in title_tokens]
query = "%20".join(tokens)
try:
result = requests.get(
f"{ComicVine.BASE_URL}{query}{ComicVine.QUERY_PARAMS}",
headers=ComicVine.HEADERS,
)
result.raise_for_status()
except Exception as e:
log.warning(e)
return None
for result in result.json()["results"]:
match = self._parse_search_result(
result=result, generic_cover=generic_cover, locale=locale
)
val.append(match)
return val
def _parse_search_result(
self, result: Dict, generic_cover: str, locale: str
) -> MetaRecord:
series = result["volume"].get("name", "")
series_index = result.get("issue_number", 0)
issue_name = result.get("name", "")
match = MetaRecord(
id=result["id"],
title=f"{series}#{series_index} - {issue_name}",
authors=result.get("authors", []),
url=result.get("site_detail_url", ""),
source=MetaSourceInfo(
id=self.__id__,
description=ComicVine.DESCRIPTION,
link=ComicVine.META_URL,
),
series=series,
)
match.cover = result["image"].get("original_url", generic_cover)
match.description = result.get("description", "")
match.publishedDate = result.get("store_date", result.get("date_added"))
match.series_index = series_index
match.tags = ["Comics", series]
match.identifiers = {"comicvine": match.id}
return match

View File

@ -0,0 +1,259 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2022 xlivevil
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
from concurrent import futures
from typing import List, Optional
import requests
from html2text import HTML2Text
from lxml import etree
from cps import logger
from cps.services.Metadata import Metadata, MetaRecord, MetaSourceInfo
log = logger.create()
def html2text(html: str) -> str:
h2t = HTML2Text()
h2t.body_width = 0
h2t.single_line_break = True
h2t.emphasis_mark = "*"
return h2t.handle(html)
class Douban(Metadata):
__name__ = "豆瓣"
__id__ = "douban"
DESCRIPTION = "豆瓣"
META_URL = "https://book.douban.com/"
SEARCH_JSON_URL = "https://www.douban.com/j/search"
SEARCH_URL = "https://www.douban.com/search"
ID_PATTERN = re.compile(r"sid: (?P<id>\d+),")
AUTHORS_PATTERN = re.compile(r"作者|译者")
PUBLISHER_PATTERN = re.compile(r"出版社")
SUBTITLE_PATTERN = re.compile(r"副标题")
PUBLISHED_DATE_PATTERN = re.compile(r"出版年")
SERIES_PATTERN = re.compile(r"丛书")
IDENTIFIERS_PATTERN = re.compile(r"ISBN|统一书号")
CRITERIA_PATTERN = re.compile("criteria = '(.+)'")
TITTLE_XPATH = "//span[@property='v:itemreviewed']"
COVER_XPATH = "//a[@class='nbg']"
INFO_XPATH = "//*[@id='info']//span[@class='pl']"
TAGS_XPATH = "//a[contains(@class, 'tag')]"
DESCRIPTION_XPATH = "//div[@id='link-report']//div[@class='intro']"
RATING_XPATH = "//div[@class='rating_self clearfix']/strong"
session = requests.Session()
session.headers = {
'user-agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.56',
}
def search(self,
query: str,
generic_cover: str = "",
locale: str = "en") -> List[MetaRecord]:
val = []
if self.active:
log.debug(f"start searching {query} on douban")
if title_tokens := list(
self.get_title_tokens(query, strip_joiners=False)):
query = "+".join(title_tokens)
book_id_list = self._get_book_id_list_from_html(query)
if not book_id_list:
log.debug("No search results in Douban")
return []
with futures.ThreadPoolExecutor(
max_workers=5, thread_name_prefix='douban') as executor:
fut = [
executor.submit(self._parse_single_book, book_id,
generic_cover) for book_id in book_id_list
]
val = [
future.result() for future in futures.as_completed(fut)
if future.result()
]
return val
def _get_book_id_list_from_html(self, query: str) -> List[str]:
try:
r = self.session.get(self.SEARCH_URL,
params={
"cat": 1001,
"q": query
})
r.raise_for_status()
except Exception as e:
log.warning(e)
return []
html = etree.HTML(r.content.decode("utf8"))
result_list = html.xpath(self.COVER_XPATH)
return [
self.ID_PATTERN.search(item.get("onclick")).group("id")
for item in result_list[:10]
if self.ID_PATTERN.search(item.get("onclick"))
]
def _get_book_id_list_from_json(self, query: str) -> List[str]:
try:
r = self.session.get(self.SEARCH_JSON_URL,
params={
"cat": 1001,
"q": query
})
r.raise_for_status()
except Exception as e:
log.warning(e)
return []
results = r.json()
if results["total"] == 0:
return []
return [
self.ID_PATTERN.search(item).group("id")
for item in results["items"][:10] if self.ID_PATTERN.search(item)
]
def _parse_single_book(self,
id: str,
generic_cover: str = "") -> Optional[MetaRecord]:
url = f"https://book.douban.com/subject/{id}/"
log.debug(f"start parsing {url}")
try:
r = self.session.get(url)
r.raise_for_status()
except Exception as e:
log.warning(e)
return None
match = MetaRecord(
id=id,
title="",
authors=[],
url=url,
source=MetaSourceInfo(
id=self.__id__,
description=self.DESCRIPTION,
link=self.META_URL,
),
)
decode_content = r.content.decode("utf8")
html = etree.HTML(decode_content)
match.title = html.xpath(self.TITTLE_XPATH)[0].text
match.cover = html.xpath(
self.COVER_XPATH)[0].attrib["href"] or generic_cover
try:
rating_num = float(html.xpath(self.RATING_XPATH)[0].text.strip())
except Exception:
rating_num = 0
match.rating = int(-1 * rating_num // 2 * -1) if rating_num else 0
tag_elements = html.xpath(self.TAGS_XPATH)
if len(tag_elements):
match.tags = [tag_element.text for tag_element in tag_elements]
else:
match.tags = self._get_tags(decode_content)
description_element = html.xpath(self.DESCRIPTION_XPATH)
if len(description_element):
match.description = html2text(
etree.tostring(description_element[-1]).decode("utf8"))
info = html.xpath(self.INFO_XPATH)
for element in info:
text = element.text
if self.AUTHORS_PATTERN.search(text):
next_element = element.getnext()
while next_element is not None and next_element.tag != "br":
match.authors.append(next_element.text)
next_element = next_element.getnext()
elif self.PUBLISHER_PATTERN.search(text):
if publisher := element.tail.strip():
match.publisher = publisher
else:
match.publisher = element.getnext().text
elif self.SUBTITLE_PATTERN.search(text):
match.title = f'{match.title}:{element.tail.strip()}'
elif self.PUBLISHED_DATE_PATTERN.search(text):
match.publishedDate = self._clean_date(element.tail.strip())
elif self.SERIES_PATTERN.search(text):
match.series = element.getnext().text
elif i_type := self.IDENTIFIERS_PATTERN.search(text):
match.identifiers[i_type.group()] = element.tail.strip()
return match
def _clean_date(self, date: str) -> str:
"""
Clean up the date string to be in the format YYYY-MM-DD
Examples of possible patterns:
'2014-7-16', '1988年4月', '1995-04', '2021-8', '2020-12-1', '1996年',
'1972', '2004/11/01', '1959年3月北京第1版第1印'
"""
year = date[:4]
moon = "01"
day = "01"
if len(date) > 5:
digit = []
ls = []
for i in range(5, len(date)):
if date[i].isdigit():
digit.append(date[i])
elif digit:
ls.append("".join(digit) if len(digit) ==
2 else f"0{digit[0]}")
digit = []
if digit:
ls.append("".join(digit) if len(digit) ==
2 else f"0{digit[0]}")
moon = ls[0]
if len(ls) > 1:
day = ls[1]
return f"{year}-{moon}-{day}"
def _get_tags(self, text: str) -> List[str]:
tags = []
if criteria := self.CRITERIA_PATTERN.search(text):
tags.extend(
item.replace('7:', '') for item in criteria.group().split('|')
if item.startswith('7:'))
return tags

View File

@ -0,0 +1,129 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Google Books api document: https://developers.google.com/books/docs/v1/using
from typing import Dict, List, Optional
from urllib.parse import quote
from datetime import datetime
import requests
from cps import logger
from cps.isoLanguages import get_lang3, get_language_name
from cps.services.Metadata import MetaRecord, MetaSourceInfo, Metadata
log = logger.create()
class Google(Metadata):
__name__ = "Google"
__id__ = "google"
DESCRIPTION = "Google Books"
META_URL = "https://books.google.com/"
BOOK_URL = "https://books.google.com/books?id="
SEARCH_URL = "https://www.googleapis.com/books/v1/volumes?q="
ISBN_TYPE = "ISBN_13"
def search(
self, query: str, generic_cover: str = "", locale: str = "en"
) -> Optional[List[MetaRecord]]:
val = list()
if self.active:
title_tokens = list(self.get_title_tokens(query, strip_joiners=False))
if title_tokens:
tokens = [quote(t.encode("utf-8")) for t in title_tokens]
query = "+".join(tokens)
try:
results = requests.get(Google.SEARCH_URL + query)
results.raise_for_status()
except Exception as e:
log.warning(e)
return None
for result in results.json().get("items", []):
val.append(
self._parse_search_result(
result=result, generic_cover=generic_cover, locale=locale
)
)
return val
def _parse_search_result(
self, result: Dict, generic_cover: str, locale: str
) -> MetaRecord:
match = MetaRecord(
id=result["id"],
title=result["volumeInfo"]["title"],
authors=result["volumeInfo"].get("authors", []),
url=Google.BOOK_URL + result["id"],
source=MetaSourceInfo(
id=self.__id__,
description=Google.DESCRIPTION,
link=Google.META_URL,
),
)
match.cover = self._parse_cover(result=result, generic_cover=generic_cover)
match.description = result["volumeInfo"].get("description", "")
match.languages = self._parse_languages(result=result, locale=locale)
match.publisher = result["volumeInfo"].get("publisher", "")
try:
datetime.strptime(result["volumeInfo"].get("publishedDate", ""), "%Y-%m-%d")
match.publishedDate = result["volumeInfo"].get("publishedDate", "")
except ValueError:
match.publishedDate = ""
match.rating = result["volumeInfo"].get("averageRating", 0)
match.series, match.series_index = "", 1
match.tags = result["volumeInfo"].get("categories", [])
match.identifiers = {"google": match.id}
match = self._parse_isbn(result=result, match=match)
return match
@staticmethod
def _parse_isbn(result: Dict, match: MetaRecord) -> MetaRecord:
identifiers = result["volumeInfo"].get("industryIdentifiers", [])
for identifier in identifiers:
if identifier.get("type") == Google.ISBN_TYPE:
match.identifiers["isbn"] = identifier.get("identifier")
break
return match
@staticmethod
def _parse_cover(result: Dict, generic_cover: str) -> str:
if result["volumeInfo"].get("imageLinks"):
cover_url = result["volumeInfo"]["imageLinks"]["thumbnail"]
# strip curl in cover
cover_url = cover_url.replace("&edge=curl", "")
# request 800x900 cover image (higher resolution)
cover_url += "&fife=w800-h900"
return cover_url.replace("http://", "https://")
return generic_cover
@staticmethod
def _parse_languages(result: Dict, locale: str) -> List[str]:
language_iso2 = result["volumeInfo"].get("language", "")
languages = (
[get_language_name(locale, get_lang3(language_iso2))]
if language_iso2
else []
)
return languages

View File

@ -0,0 +1,357 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
import json
import re
from multiprocessing.pool import ThreadPool
from typing import List, Optional, Tuple, Union
from urllib.parse import quote
import requests
from dateutil import parser
from html2text import HTML2Text
from lxml.html import HtmlElement, fromstring, tostring
from markdown2 import Markdown
from cps import logger
from cps.isoLanguages import get_language_name
from cps.services.Metadata import MetaRecord, MetaSourceInfo, Metadata
log = logger.create()
SYMBOLS_TO_TRANSLATE = (
"öÖüÜóÓőŐúÚéÉáÁűŰíÍąĄćĆęĘłŁńŃóÓśŚźŹżŻ",
"oOuUoOoOuUeEaAuUiIaAcCeElLnNoOsSzZzZ",
)
SYMBOL_TRANSLATION_MAP = dict(
[(ord(a), ord(b)) for (a, b) in zip(*SYMBOLS_TO_TRANSLATE)]
)
def get_int_or_float(value: str) -> Union[int, float]:
number_as_float = float(value)
number_as_int = int(number_as_float)
return number_as_int if number_as_float == number_as_int else number_as_float
def strip_accents(s: Optional[str]) -> Optional[str]:
return s.translate(SYMBOL_TRANSLATION_MAP) if s is not None else s
def sanitize_comments_html(html: str) -> str:
text = html2text(html)
md = Markdown()
html = md.convert(text)
return html
def html2text(html: str) -> str:
# replace <u> tags with <span> as <u> becomes emphasis in html2text
if isinstance(html, bytes):
html = html.decode("utf-8")
html = re.sub(
r"<\s*(?P<solidus>/?)\s*[uU]\b(?P<rest>[^>]*)>",
r"<\g<solidus>span\g<rest>>",
html,
)
h2t = HTML2Text()
h2t.body_width = 0
h2t.single_line_break = True
h2t.emphasis_mark = "*"
return h2t.handle(html)
class LubimyCzytac(Metadata):
__name__ = "LubimyCzytac.pl"
__id__ = "lubimyczytac"
BASE_URL = "https://lubimyczytac.pl"
BOOK_SEARCH_RESULT_XPATH = (
"*//div[@class='listSearch']//div[@class='authorAllBooks__single']"
)
SINGLE_BOOK_RESULT_XPATH = ".//div[contains(@class,'authorAllBooks__singleText')]"
TITLE_PATH = "/div/a[contains(@class,'authorAllBooks__singleTextTitle')]"
TITLE_TEXT_PATH = f"{TITLE_PATH}//text()"
URL_PATH = f"{TITLE_PATH}/@href"
AUTHORS_PATH = "/div/a[contains(@href,'autor')]//text()"
SIBLINGS = "/following-sibling::dd"
CONTAINER = "//section[@class='container book']"
PUBLISHER = f"{CONTAINER}//dt[contains(text(),'Wydawnictwo:')]{SIBLINGS}/a/text()"
LANGUAGES = f"{CONTAINER}//dt[contains(text(),'Język:')]{SIBLINGS}/text()"
DESCRIPTION = f"{CONTAINER}//div[@class='collapse-content']"
SERIES = f"{CONTAINER}//span/a[contains(@href,'/cykl/')]/text()"
TRANSLATOR = f"{CONTAINER}//dt[contains(text(),'Tłumacz:')]{SIBLINGS}/a/text()"
DETAILS = "//div[@id='book-details']"
PUBLISH_DATE = "//dt[contains(@title,'Data pierwszego wydania"
FIRST_PUBLISH_DATE = f"{DETAILS}{PUBLISH_DATE} oryginalnego')]{SIBLINGS}[1]/text()"
FIRST_PUBLISH_DATE_PL = f"{DETAILS}{PUBLISH_DATE} polskiego')]{SIBLINGS}[1]/text()"
TAGS = "//a[contains(@href,'/ksiazki/t/')]/text()" # "//nav[@aria-label='breadcrumbs']//a[contains(@href,'/ksiazki/k/')]/span/text()"
RATING = "//meta[@property='books:rating:value']/@content"
COVER = "//meta[@property='og:image']/@content"
ISBN = "//meta[@property='books:isbn']/@content"
META_TITLE = "//meta[@property='og:description']/@content"
SUMMARY = "//script[@type='application/ld+json']//text()"
def search(
self, query: str, generic_cover: str = "", locale: str = "en"
) -> Optional[List[MetaRecord]]:
if self.active:
try:
result = requests.get(self._prepare_query(title=query))
result.raise_for_status()
except Exception as e:
log.warning(e)
return None
root = fromstring(result.text)
lc_parser = LubimyCzytacParser(root=root, metadata=self)
matches = lc_parser.parse_search_results()
if matches:
with ThreadPool(processes=10) as pool:
final_matches = pool.starmap(
lc_parser.parse_single_book,
[(match, generic_cover, locale) for match in matches],
)
return final_matches
return matches
def _prepare_query(self, title: str) -> str:
query = ""
characters_to_remove = "\?()\/"
pattern = "[" + characters_to_remove + "]"
title = re.sub(pattern, "", title)
title = title.replace("_", " ")
if '"' in title or ",," in title:
title = title.split('"')[0].split(",,")[0]
if "/" in title:
title_tokens = [
token for token in title.lower().split(" ") if len(token) > 1
]
else:
title_tokens = list(self.get_title_tokens(title, strip_joiners=False))
if title_tokens:
tokens = [quote(t.encode("utf-8")) for t in title_tokens]
query = query + "%20".join(tokens)
if not query:
return ""
return f"{LubimyCzytac.BASE_URL}/szukaj/ksiazki?phrase={query}"
class LubimyCzytacParser:
PAGES_TEMPLATE = "<p id='strony'>Książka ma {0} stron(y).</p>"
TRANSLATOR_TEMPLATE = "<p id='translator'>Tłumacz: {0}</p>"
PUBLISH_DATE_TEMPLATE = "<p id='pierwsze_wydanie'>Data pierwszego wydania: {0}</p>"
PUBLISH_DATE_PL_TEMPLATE = (
"<p id='pierwsze_wydanie'>Data pierwszego wydania w Polsce: {0}</p>"
)
def __init__(self, root: HtmlElement, metadata: Metadata) -> None:
self.root = root
self.metadata = metadata
def parse_search_results(self) -> List[MetaRecord]:
matches = []
results = self.root.xpath(LubimyCzytac.BOOK_SEARCH_RESULT_XPATH)
for result in results:
title = self._parse_xpath_node(
root=result,
xpath=f"{LubimyCzytac.SINGLE_BOOK_RESULT_XPATH}"
f"{LubimyCzytac.TITLE_TEXT_PATH}",
)
book_url = self._parse_xpath_node(
root=result,
xpath=f"{LubimyCzytac.SINGLE_BOOK_RESULT_XPATH}"
f"{LubimyCzytac.URL_PATH}",
)
authors = self._parse_xpath_node(
root=result,
xpath=f"{LubimyCzytac.SINGLE_BOOK_RESULT_XPATH}"
f"{LubimyCzytac.AUTHORS_PATH}",
take_first=False,
)
if not all([title, book_url, authors]):
continue
matches.append(
MetaRecord(
id=book_url.replace(f"/ksiazka/", "").split("/")[0],
title=title,
authors=[strip_accents(author) for author in authors],
url=LubimyCzytac.BASE_URL + book_url,
source=MetaSourceInfo(
id=self.metadata.__id__,
description=self.metadata.__name__,
link=LubimyCzytac.BASE_URL,
),
)
)
return matches
def parse_single_book(
self, match: MetaRecord, generic_cover: str, locale: str
) -> MetaRecord:
try:
response = requests.get(match.url)
response.raise_for_status()
except Exception as e:
log.warning(e)
return None
self.root = fromstring(response.text)
match.cover = self._parse_cover(generic_cover=generic_cover)
match.description = self._parse_description()
match.languages = self._parse_languages(locale=locale)
match.publisher = self._parse_publisher()
match.publishedDate = self._parse_from_summary(attribute_name="datePublished")
match.rating = self._parse_rating()
match.series, match.series_index = self._parse_series()
match.tags = self._parse_tags()
match.identifiers = {
"isbn": self._parse_isbn(),
"lubimyczytac": match.id,
}
return match
def _parse_xpath_node(
self,
xpath: str,
root: HtmlElement = None,
take_first: bool = True,
strip_element: bool = True,
) -> Optional[Union[str, List[str]]]:
root = root if root is not None else self.root
node = root.xpath(xpath)
if not node:
return None
return (
(node[0].strip() if strip_element else node[0])
if take_first
else [x.strip() for x in node]
)
def _parse_cover(self, generic_cover) -> Optional[str]:
return (
self._parse_xpath_node(xpath=LubimyCzytac.COVER, take_first=True)
or generic_cover
)
def _parse_publisher(self) -> Optional[str]:
return self._parse_xpath_node(xpath=LubimyCzytac.PUBLISHER, take_first=True)
def _parse_languages(self, locale: str) -> List[str]:
languages = list()
lang = self._parse_xpath_node(xpath=LubimyCzytac.LANGUAGES, take_first=True)
if lang:
if "polski" in lang:
languages.append("pol")
if "angielski" in lang:
languages.append("eng")
return [get_language_name(locale, language) for language in languages]
def _parse_series(self) -> Tuple[Optional[str], Optional[Union[float, int]]]:
series_index = 0
series = self._parse_xpath_node(xpath=LubimyCzytac.SERIES, take_first=True)
if series:
if "tom " in series:
series_name, series_info = series.split(" (tom ", 1)
series_info = series_info.replace(" ", "").replace(")", "")
# Check if book is not a bundle, i.e. chapter 1-3
if "-" in series_info:
series_info = series_info.split("-", 1)[0]
if series_info.replace(".", "").isdigit() is True:
series_index = get_int_or_float(series_info)
return series_name, series_index
return None, None
def _parse_tags(self) -> List[str]:
tags = self._parse_xpath_node(xpath=LubimyCzytac.TAGS, take_first=False)
return [
strip_accents(w.replace(", itd.", " itd."))
for w in tags
if isinstance(w, str)
]
def _parse_from_summary(self, attribute_name: str) -> Optional[str]:
value = None
summary_text = self._parse_xpath_node(xpath=LubimyCzytac.SUMMARY)
if summary_text:
data = json.loads(summary_text)
value = data.get(attribute_name)
return value.strip() if value is not None else value
def _parse_rating(self) -> Optional[str]:
rating = self._parse_xpath_node(xpath=LubimyCzytac.RATING)
return round(float(rating.replace(",", ".")) / 2) if rating else rating
def _parse_date(self, xpath="first_publish") -> Optional[datetime.datetime]:
options = {
"first_publish": LubimyCzytac.FIRST_PUBLISH_DATE,
"first_publish_pl": LubimyCzytac.FIRST_PUBLISH_DATE_PL,
}
date = self._parse_xpath_node(xpath=options.get(xpath))
return parser.parse(date) if date else None
def _parse_isbn(self) -> Optional[str]:
return self._parse_xpath_node(xpath=LubimyCzytac.ISBN)
def _parse_description(self) -> str:
description = ""
description_node = self._parse_xpath_node(
xpath=LubimyCzytac.DESCRIPTION, strip_element=False
)
if description_node is not None:
for source in self.root.xpath('//p[@class="source"]'):
source.getparent().remove(source)
description = tostring(description_node, method="html")
description = sanitize_comments_html(description)
else:
description_node = self._parse_xpath_node(xpath=LubimyCzytac.META_TITLE)
if description_node is not None:
description = description_node
description = sanitize_comments_html(description)
description = self._add_extra_info_to_description(description=description)
return description
def _add_extra_info_to_description(self, description: str) -> str:
pages = self._parse_from_summary(attribute_name="numberOfPages")
if pages:
description += LubimyCzytacParser.PAGES_TEMPLATE.format(pages)
first_publish_date = self._parse_date()
if first_publish_date:
description += LubimyCzytacParser.PUBLISH_DATE_TEMPLATE.format(
first_publish_date.strftime("%d.%m.%Y")
)
first_publish_date_pl = self._parse_date(xpath="first_publish_pl")
if first_publish_date_pl:
description += LubimyCzytacParser.PUBLISH_DATE_PL_TEMPLATE.format(
first_publish_date_pl.strftime("%d.%m.%Y")
)
translator = self._parse_xpath_node(xpath=LubimyCzytac.TRANSLATOR)
if translator:
description += LubimyCzytacParser.TRANSLATOR_TEMPLATE.format(translator)
return description

View File

@ -0,0 +1,83 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import itertools
from typing import Dict, List, Optional
from urllib.parse import quote, unquote
try:
from fake_useragent.errors import FakeUserAgentError
except (ImportError):
FakeUserAgentError = BaseException
try:
from scholarly import scholarly
except FakeUserAgentError:
raise ImportError("No module named 'scholarly'")
from cps import logger
from cps.services.Metadata import MetaRecord, MetaSourceInfo, Metadata
log = logger.create()
class scholar(Metadata):
__name__ = "Google Scholar"
__id__ = "googlescholar"
META_URL = "https://scholar.google.com/"
def search(
self, query: str, generic_cover: str = "", locale: str = "en"
) -> Optional[List[MetaRecord]]:
val = list()
if self.active:
title_tokens = list(self.get_title_tokens(query, strip_joiners=False))
if title_tokens:
tokens = [quote(t.encode("utf-8")) for t in title_tokens]
query = " ".join(tokens)
try:
scholarly.set_timeout(20)
scholarly.set_retries(2)
scholar_gen = itertools.islice(scholarly.search_pubs(query), 10)
except Exception as e:
log.warning(e)
return list()
for result in scholar_gen:
match = self._parse_search_result(
result=result, generic_cover="", locale=locale
)
val.append(match)
return val
def _parse_search_result(
self, result: Dict, generic_cover: str, locale: str
) -> MetaRecord:
match = MetaRecord(
id=result.get("pub_url", result.get("eprint_url", "")),
title=result["bib"].get("title"),
authors=result["bib"].get("author", []),
url=result.get("pub_url", result.get("eprint_url", "")),
source=MetaSourceInfo(
id=self.__id__, description=self.__name__, link=scholar.META_URL
),
)
match.cover = result.get("image", {}).get("original_url", generic_cover)
match.description = unquote(result["bib"].get("abstract", ""))
match.publisher = result["bib"].get("venue", "")
match.publishedDate = result["bib"].get("pub_year") + "-01-01"
match.identifiers = {"scholar": match.id}
return match

156
cps/oauth.py Normal file
View File

@ -0,0 +1,156 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 jim3ma
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from flask import session
try:
from flask_dance.consumer.storage.sqla import SQLAlchemyStorage as SQLAlchemyBackend
from flask_dance.consumer.storage.sqla import first, _get_real_user
from sqlalchemy.orm.exc import NoResultFound
backend_resultcode = True # prevent storing values with this resultcode
except ImportError:
pass
class OAuthBackend(SQLAlchemyBackend):
"""
Stores and retrieves OAuth tokens using a relational database through
the `SQLAlchemy`_ ORM.
.. _SQLAlchemy: https://www.sqlalchemy.org/
"""
def __init__(self, model, session, provider_id,
user=None, user_id=None, user_required=None, anon_user=None,
cache=None):
self.provider_id = provider_id
super(OAuthBackend, self).__init__(model, session, user, user_id, user_required, anon_user, cache)
def get(self, blueprint, user=None, user_id=None):
if self.provider_id + '_oauth_token' in session and session[self.provider_id + '_oauth_token'] != '':
return session[self.provider_id + '_oauth_token']
# check cache
cache_key = self.make_cache_key(blueprint=blueprint, user=user, user_id=user_id)
token = self.cache.get(cache_key)
if token:
return token
# if not cached, make database queries
query = (
self.session.query(self.model)
.filter_by(provider=self.provider_id)
)
uid = first([user_id, self.user_id, blueprint.config.get("user_id")])
u = first(_get_real_user(ref, self.anon_user)
for ref in (user, self.user, blueprint.config.get("user")))
use_provider_user_id = False
if self.provider_id + '_oauth_user_id' in session and session[self.provider_id + '_oauth_user_id'] != '':
query = query.filter_by(provider_user_id=session[self.provider_id + '_oauth_user_id'])
use_provider_user_id = True
if self.user_required and not u and not uid and not use_provider_user_id:
# raise ValueError("Cannot get OAuth token without an associated user")
return None
# check for user ID
if hasattr(self.model, "user_id") and uid:
query = query.filter_by(user_id=uid)
# check for user (relationship property)
elif hasattr(self.model, "user") and u:
query = query.filter_by(user=u)
# if we have the property, but not value, filter by None
elif hasattr(self.model, "user_id"):
query = query.filter_by(user_id=None)
# run query
try:
token = query.one().token
except NoResultFound:
token = None
# cache the result
self.cache.set(cache_key, token)
return token
def set(self, blueprint, token, user=None, user_id=None):
uid = first([user_id, self.user_id, blueprint.config.get("user_id")])
u = first(_get_real_user(ref, self.anon_user)
for ref in (user, self.user, blueprint.config.get("user")))
if self.user_required and not u and not uid:
raise ValueError("Cannot set OAuth token without an associated user")
# if there was an existing model, delete it
existing_query = (
self.session.query(self.model)
.filter_by(provider=self.provider_id)
)
# check for user ID
has_user_id = hasattr(self.model, "user_id")
if has_user_id and uid:
existing_query = existing_query.filter_by(user_id=uid)
# check for user (relationship property)
has_user = hasattr(self.model, "user")
if has_user and u:
existing_query = existing_query.filter_by(user=u)
# queue up delete query -- won't be run until commit()
existing_query.delete()
# create a new model for this token
kwargs = {
"provider": self.provider_id,
"token": token,
}
if has_user_id and uid:
kwargs["user_id"] = uid
if has_user and u:
kwargs["user"] = u
self.session.add(self.model(**kwargs))
# commit to delete and add simultaneously
self.session.commit()
# invalidate cache
self.cache.delete(self.make_cache_key(
blueprint=blueprint, user=user, user_id=user_id
))
def delete(self, blueprint, user=None, user_id=None):
query = (
self.session.query(self.model)
.filter_by(provider=self.provider_id)
)
uid = first([user_id, self.user_id, blueprint.config.get("user_id")])
u = first(_get_real_user(ref, self.anon_user)
for ref in (user, self.user, blueprint.config.get("user")))
if self.user_required and not u and not uid:
raise ValueError("Cannot delete OAuth token without an associated user")
# check for user ID
if hasattr(self.model, "user_id") and uid:
query = query.filter_by(user_id=uid)
# check for user (relationship property)
elif hasattr(self.model, "user") and u:
query = query.filter_by(user=u)
# if we have the property, but not value, filter by None
elif hasattr(self.model, "user_id"):
query = query.filter_by(user_id=None)
# run query
query.delete()
self.session.commit()
# invalidate cache
self.cache.delete(self.make_cache_key(
blueprint=blueprint, user=user, user_id=user_id,
))

367
cps/oauth_bb.py Normal file
View File

@ -0,0 +1,367 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
import json
from functools import wraps
from flask import session, request, make_response, abort
from flask import Blueprint, flash, redirect, url_for
from flask_babel import gettext as _
from flask_dance.consumer import oauth_authorized, oauth_error
from flask_dance.contrib.github import make_github_blueprint, github
from flask_dance.contrib.google import make_google_blueprint, google
from oauthlib.oauth2 import TokenExpiredError, InvalidGrantError
from flask_login import login_user, current_user, login_required
from sqlalchemy.orm.exc import NoResultFound
from . import constants, logger, config, app, ub
try:
from .oauth import OAuthBackend, backend_resultcode
except NameError:
pass
oauth_check = {}
oauthblueprints = []
oauth = Blueprint('oauth', __name__)
log = logger.create()
def oauth_required(f):
@wraps(f)
def inner(*args, **kwargs):
if config.config_login_type == constants.LOGIN_OAUTH:
return f(*args, **kwargs)
if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
data = {'status': 'error', 'message': 'Not Found'}
response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8"
return response, 404
abort(404)
return inner
def register_oauth_blueprint(cid, show_name):
oauth_check[cid] = show_name
def register_user_with_oauth(user=None):
all_oauth = {}
for oauth_key in oauth_check.keys():
if str(oauth_key) + '_oauth_user_id' in session and session[str(oauth_key) + '_oauth_user_id'] != '':
all_oauth[oauth_key] = oauth_check[oauth_key]
if len(all_oauth.keys()) == 0:
return
if user is None:
flash(_("Register with %(provider)s", provider=", ".join(list(all_oauth.values()))), category="success")
else:
for oauth_key in all_oauth.keys():
# Find this OAuth token in the database, or create it
query = ub.session.query(ub.OAuth).filter_by(
provider=oauth_key,
provider_user_id=session[str(oauth_key) + "_oauth_user_id"],
)
try:
oauth_key = query.one()
oauth_key.user_id = user.id
except NoResultFound:
# no found, return error
return
ub.session_commit("User {} with OAuth for provider {} registered".format(user.name, oauth_key))
def logout_oauth_user():
for oauth_key in oauth_check.keys():
if str(oauth_key) + '_oauth_user_id' in session:
session.pop(str(oauth_key) + '_oauth_user_id')
def oauth_update_token(provider_id, token, provider_user_id):
session[provider_id + "_oauth_user_id"] = provider_user_id
session[provider_id + "_oauth_token"] = token
# Find this OAuth token in the database, or create it
query = ub.session.query(ub.OAuth).filter_by(
provider=provider_id,
provider_user_id=provider_user_id,
)
try:
oauth_entry = query.one()
# update token
oauth_entry.token = token
except NoResultFound:
oauth_entry = ub.OAuth(
provider=provider_id,
provider_user_id=provider_user_id,
token=token,
)
ub.session.add(oauth_entry)
ub.session_commit()
# Disable Flask-Dance's default behavior for saving the OAuth token
# Value differrs depending on flask-dance version
return backend_resultcode
def bind_oauth_or_register(provider_id, provider_user_id, redirect_url, provider_name):
query = ub.session.query(ub.OAuth).filter_by(
provider=provider_id,
provider_user_id=provider_user_id,
)
try:
oauth_entry = query.first()
# already bind with user, just login
if oauth_entry.user:
login_user(oauth_entry.user)
log.debug("You are now logged in as: '%s'", oauth_entry.user.name)
flash(_("Success! You are now logged in as: %(nickname)s", nickname= oauth_entry.user.name),
category="success")
return redirect(url_for('web.index'))
else:
# bind to current user
if current_user and current_user.is_authenticated:
oauth_entry.user = current_user
try:
ub.session.add(oauth_entry)
ub.session.commit()
flash(_("Link to %(oauth)s Succeeded", oauth=provider_name), category="success")
log.info("Link to {} Succeeded".format(provider_name))
return redirect(url_for('web.profile'))
except Exception as ex:
log.error_or_exception(ex)
ub.session.rollback()
else:
flash(_("Login failed, No User Linked With OAuth Account"), category="error")
log.info('Login failed, No User Linked With OAuth Account')
return redirect(url_for('web.login'))
# return redirect(url_for('web.login'))
# if config.config_public_reg:
# return redirect(url_for('web.register'))
# else:
# flash(_("Public registration is not enabled"), category="error")
# return redirect(url_for(redirect_url))
except (NoResultFound, AttributeError):
return redirect(url_for(redirect_url))
def get_oauth_status():
status = []
query = ub.session.query(ub.OAuth).filter_by(
user_id=current_user.id,
)
try:
oauths = query.all()
for oauth_entry in oauths:
status.append(int(oauth_entry.provider))
return status
except NoResultFound:
return None
def unlink_oauth(provider):
if request.host_url + 'me' != request.referrer:
pass
query = ub.session.query(ub.OAuth).filter_by(
provider=provider,
user_id=current_user.id,
)
try:
oauth_entry = query.one()
if current_user and current_user.is_authenticated:
oauth_entry.user = current_user
try:
ub.session.delete(oauth_entry)
ub.session.commit()
logout_oauth_user()
flash(_("Unlink to %(oauth)s Succeeded", oauth=oauth_check[provider]), category="success")
log.info("Unlink to {} Succeeded".format(oauth_check[provider]))
except Exception as ex:
log.error_or_exception(ex)
ub.session.rollback()
flash(_("Unlink to %(oauth)s Failed", oauth=oauth_check[provider]), category="error")
except NoResultFound:
log.warning("oauth %s for user %d not found", provider, current_user.id)
flash(_("Not Linked to %(oauth)s", oauth=provider), category="error")
return redirect(url_for('web.profile'))
def generate_oauth_blueprints():
if not ub.session.query(ub.OAuthProvider).count():
for provider in ("github", "google"):
oauthProvider = ub.OAuthProvider()
oauthProvider.provider_name = provider
oauthProvider.active = False
ub.session.add(oauthProvider)
ub.session_commit("{} Blueprint Created".format(provider))
oauth_ids = ub.session.query(ub.OAuthProvider).all()
ele1 = dict(provider_name='github',
id=oauth_ids[0].id,
active=oauth_ids[0].active,
oauth_client_id=oauth_ids[0].oauth_client_id,
scope=None,
oauth_client_secret=oauth_ids[0].oauth_client_secret,
obtain_link='https://github.com/settings/developers')
ele2 = dict(provider_name='google',
id=oauth_ids[1].id,
active=oauth_ids[1].active,
scope=["https://www.googleapis.com/auth/userinfo.email"],
oauth_client_id=oauth_ids[1].oauth_client_id,
oauth_client_secret=oauth_ids[1].oauth_client_secret,
obtain_link='https://console.developers.google.com/apis/credentials')
oauthblueprints.append(ele1)
oauthblueprints.append(ele2)
for element in oauthblueprints:
if element['provider_name'] == 'github':
blueprint_func = make_github_blueprint
else:
blueprint_func = make_google_blueprint
blueprint = blueprint_func(
client_id=element['oauth_client_id'],
client_secret=element['oauth_client_secret'],
redirect_to="oauth."+element['provider_name']+"_login",
scope=element['scope']
)
element['blueprint'] = blueprint
element['blueprint'].backend = OAuthBackend(ub.OAuth, ub.session, str(element['id']),
user=current_user, user_required=True)
app.register_blueprint(blueprint, url_prefix="/login")
if element['active']:
register_oauth_blueprint(element['id'], element['provider_name'])
return oauthblueprints
if ub.oauth_support:
oauthblueprints = generate_oauth_blueprints()
@oauth_authorized.connect_via(oauthblueprints[0]['blueprint'])
def github_logged_in(blueprint, token):
if not token:
flash(_("Failed to log in with GitHub."), category="error")
log.error("Failed to log in with GitHub")
return False
resp = blueprint.session.get("/user")
if not resp.ok:
flash(_("Failed to fetch user info from GitHub."), category="error")
log.error("Failed to fetch user info from GitHub")
return False
github_info = resp.json()
github_user_id = str(github_info["id"])
return oauth_update_token(str(oauthblueprints[0]['id']), token, github_user_id)
@oauth_authorized.connect_via(oauthblueprints[1]['blueprint'])
def google_logged_in(blueprint, token):
if not token:
flash(_("Failed to log in with Google."), category="error")
log.error("Failed to log in with Google")
return False
resp = blueprint.session.get("/oauth2/v2/userinfo")
if not resp.ok:
flash(_("Failed to fetch user info from Google."), category="error")
log.error("Failed to fetch user info from Google")
return False
google_info = resp.json()
google_user_id = str(google_info["id"])
return oauth_update_token(str(oauthblueprints[1]['id']), token, google_user_id)
# notify on OAuth provider error
@oauth_error.connect_via(oauthblueprints[0]['blueprint'])
def github_error(blueprint, error, error_description=None, error_uri=None):
msg = (
"OAuth error from {name}! "
"error={error} description={description} uri={uri}"
).format(
name=blueprint.name,
error=error,
description=error_description,
uri=error_uri,
) # ToDo: Translate
flash(msg, category="error")
@oauth_error.connect_via(oauthblueprints[1]['blueprint'])
def google_error(blueprint, error, error_description=None, error_uri=None):
msg = (
"OAuth error from {name}! "
"error={error} description={description} uri={uri}"
).format(
name=blueprint.name,
error=error,
description=error_description,
uri=error_uri,
) # ToDo: Translate
flash(msg, category="error")
@oauth.route('/link/github')
@oauth_required
def github_login():
if not github.authorized:
return redirect(url_for('github.login'))
try:
account_info = github.get('/user')
if account_info.ok:
account_info_json = account_info.json()
return bind_oauth_or_register(oauthblueprints[0]['id'], account_info_json['id'], 'github.login', 'github')
flash(_("GitHub Oauth error, please retry later."), category="error")
log.error("GitHub Oauth error, please retry later")
except (InvalidGrantError, TokenExpiredError) as e:
flash(_("GitHub Oauth error: {}").format(e), category="error")
log.error(e)
return redirect(url_for('web.login'))
@oauth.route('/unlink/github', methods=["GET"])
@login_required
def github_login_unlink():
return unlink_oauth(oauthblueprints[0]['id'])
@oauth.route('/link/google')
@oauth_required
def google_login():
if not google.authorized:
return redirect(url_for("google.login"))
try:
resp = google.get("/oauth2/v2/userinfo")
if resp.ok:
account_info_json = resp.json()
return bind_oauth_or_register(oauthblueprints[1]['id'], account_info_json['id'], 'google.login', 'google')
flash(_("Google Oauth error, please retry later."), category="error")
log.error("Google Oauth error, please retry later")
except (InvalidGrantError, TokenExpiredError) as e:
flash(_("Google Oauth error: {}").format(e), category="error")
log.error(e)
return redirect(url_for('web.login'))
@oauth.route('/unlink/google', methods=["GET"])
@login_required
def google_login_unlink():
return unlink_oauth(oauthblueprints[1]['id'])

552
cps/opds.py Normal file
View File

@ -0,0 +1,552 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
import json
from urllib.parse import unquote_plus
from flask import Blueprint, request, render_template, make_response, abort, Response, g
from flask_login import current_user
from flask_babel import get_locale
from flask_babel import gettext as _
from sqlalchemy.sql.expression import func, text, or_, and_, true
from sqlalchemy.exc import InvalidRequestError, OperationalError
from . import logger, config, db, calibre_db, ub, isoLanguages, constants
from .usermanagement import requires_basic_auth_if_no_ano
from .helper import get_download_link, get_book_cover
from .pagination import Pagination
from .web import render_read_books
opds = Blueprint('opds', __name__)
log = logger.create()
@opds.route("/opds/")
@opds.route("/opds")
@requires_basic_auth_if_no_ano
def feed_index():
return render_xml_template('index.xml')
@opds.route("/opds/osd")
@requires_basic_auth_if_no_ano
def feed_osd():
return render_xml_template('osd.xml', lang='en-EN')
# @opds.route("/opds/search", defaults={'query': ""})
@opds.route("/opds/search/<path:query>")
@requires_basic_auth_if_no_ano
def feed_cc_search(query):
# Handle strange query from Libera Reader with + instead of spaces
plus_query = unquote_plus(request.environ['RAW_URI'].split('/opds/search/')[1]).strip()
return feed_search(plus_query)
@opds.route("/opds/search", methods=["GET"])
@requires_basic_auth_if_no_ano
def feed_normal_search():
return feed_search(request.args.get("query", "").strip())
@opds.route("/opds/books")
@requires_basic_auth_if_no_ano
def feed_booksindex():
return render_element_index(db.Books.sort, None, 'opds.feed_letter_books')
@opds.route("/opds/books/letter/<book_id>")
@requires_basic_auth_if_no_ano
def feed_letter_books(book_id):
off = request.args.get("offset") or 0
letter = true() if book_id == "00" else func.upper(db.Books.sort).startswith(book_id)
entries, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), 0,
db.Books,
letter,
[db.Books.sort],
True, config.config_read_column)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/new")
@requires_basic_auth_if_no_ano
def feed_new():
if not current_user.check_visibility(constants.SIDEBAR_RECENT):
abort(404)
off = request.args.get("offset") or 0
entries, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), 0,
db.Books, True, [db.Books.timestamp.desc()],
True, config.config_read_column)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/discover")
@requires_basic_auth_if_no_ano
def feed_discover():
if not current_user.check_visibility(constants.SIDEBAR_RANDOM):
abort(404)
query = calibre_db.generate_linked_query(config.config_read_column, db.Books)
entries = query.filter(calibre_db.common_filters()).order_by(func.random()).limit(config.config_books_per_page)
pagination = Pagination(1, config.config_books_per_page, int(config.config_books_per_page))
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/rated")
@requires_basic_auth_if_no_ano
def feed_best_rated():
if not current_user.check_visibility(constants.SIDEBAR_BEST_RATED):
abort(404)
off = request.args.get("offset") or 0
entries, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), 0,
db.Books, db.Books.ratings.any(db.Ratings.rating > 9),
[db.Books.timestamp.desc()],
True, config.config_read_column)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/hot")
@requires_basic_auth_if_no_ano
def feed_hot():
if not current_user.check_visibility(constants.SIDEBAR_HOT):
abort(404)
off = request.args.get("offset") or 0
all_books = ub.session.query(ub.Downloads, func.count(ub.Downloads.book_id)).order_by(
func.count(ub.Downloads.book_id).desc()).group_by(ub.Downloads.book_id)
hot_books = all_books.offset(off).limit(config.config_books_per_page)
entries = list()
for book in hot_books:
query = calibre_db.generate_linked_query(config.config_read_column, db.Books)
download_book = query.filter(calibre_db.common_filters()).filter(
book.Downloads.book_id == db.Books.id).first()
if download_book:
entries.append(download_book)
else:
ub.delete_download(book.Downloads.book_id)
num_books = entries.__len__()
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1),
config.config_books_per_page, num_books)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/author")
@requires_basic_auth_if_no_ano
def feed_authorindex():
if not current_user.check_visibility(constants.SIDEBAR_AUTHOR):
abort(404)
return render_element_index(db.Authors.sort, db.books_authors_link, 'opds.feed_letter_author')
@opds.route("/opds/author/letter/<book_id>")
@requires_basic_auth_if_no_ano
def feed_letter_author(book_id):
if not current_user.check_visibility(constants.SIDEBAR_AUTHOR):
abort(404)
off = request.args.get("offset") or 0
letter = true() if book_id == "00" else func.upper(db.Authors.sort).startswith(book_id)
entries = calibre_db.session.query(db.Authors).join(db.books_authors_link).join(db.Books)\
.filter(calibre_db.common_filters()).filter(letter)\
.group_by(text('books_authors_link.author'))\
.order_by(db.Authors.sort)
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
entries.count())
entries = entries.limit(config.config_books_per_page).offset(off).all()
return render_xml_template('feed.xml', listelements=entries, folder='opds.feed_author', pagination=pagination)
@opds.route("/opds/author/<int:book_id>")
@requires_basic_auth_if_no_ano
def feed_author(book_id):
return render_xml_dataset(db.Authors, book_id)
@opds.route("/opds/publisher")
@requires_basic_auth_if_no_ano
def feed_publisherindex():
if not current_user.check_visibility(constants.SIDEBAR_PUBLISHER):
abort(404)
off = request.args.get("offset") or 0
entries = calibre_db.session.query(db.Publishers)\
.join(db.books_publishers_link)\
.join(db.Books).filter(calibre_db.common_filters())\
.group_by(text('books_publishers_link.publisher'))\
.order_by(db.Publishers.sort)\
.limit(config.config_books_per_page).offset(off)
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
len(calibre_db.session.query(db.Publishers).all()))
return render_xml_template('feed.xml', listelements=entries, folder='opds.feed_publisher', pagination=pagination)
@opds.route("/opds/publisher/<int:book_id>")
@requires_basic_auth_if_no_ano
def feed_publisher(book_id):
return render_xml_dataset(db.Publishers, book_id)
@opds.route("/opds/category")
@requires_basic_auth_if_no_ano
def feed_categoryindex():
if not current_user.check_visibility(constants.SIDEBAR_CATEGORY):
abort(404)
return render_element_index(db.Tags.name, db.books_tags_link, 'opds.feed_letter_category')
@opds.route("/opds/category/letter/<book_id>")
@requires_basic_auth_if_no_ano
def feed_letter_category(book_id):
if not current_user.check_visibility(constants.SIDEBAR_CATEGORY):
abort(404)
off = request.args.get("offset") or 0
letter = true() if book_id == "00" else func.upper(db.Tags.name).startswith(book_id)
entries = calibre_db.session.query(db.Tags)\
.join(db.books_tags_link)\
.join(db.Books)\
.filter(calibre_db.common_filters()).filter(letter)\
.group_by(text('books_tags_link.tag'))\
.order_by(db.Tags.name)
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
entries.count())
entries = entries.offset(off).limit(config.config_books_per_page).all()
return render_xml_template('feed.xml', listelements=entries, folder='opds.feed_category', pagination=pagination)
@opds.route("/opds/category/<int:book_id>")
@requires_basic_auth_if_no_ano
def feed_category(book_id):
return render_xml_dataset(db.Tags, book_id)
@opds.route("/opds/series")
@requires_basic_auth_if_no_ano
def feed_seriesindex():
if not current_user.check_visibility(constants.SIDEBAR_SERIES):
abort(404)
return render_element_index(db.Series.sort, db.books_series_link, 'opds.feed_letter_series')
@opds.route("/opds/series/letter/<book_id>")
@requires_basic_auth_if_no_ano
def feed_letter_series(book_id):
if not current_user.check_visibility(constants.SIDEBAR_SERIES):
abort(404)
off = request.args.get("offset") or 0
letter = true() if book_id == "00" else func.upper(db.Series.sort).startswith(book_id)
entries = calibre_db.session.query(db.Series)\
.join(db.books_series_link)\
.join(db.Books)\
.filter(calibre_db.common_filters()).filter(letter)\
.group_by(text('books_series_link.series'))\
.order_by(db.Series.sort)
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
entries.count())
entries = entries.offset(off).limit(config.config_books_per_page).all()
return render_xml_template('feed.xml', listelements=entries, folder='opds.feed_series', pagination=pagination)
@opds.route("/opds/series/<int:book_id>")
@requires_basic_auth_if_no_ano
def feed_series(book_id):
off = request.args.get("offset") or 0
entries, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), 0,
db.Books,
db.Books.series.any(db.Series.id == book_id),
[db.Books.series_index],
True, config.config_read_column)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/ratings")
@requires_basic_auth_if_no_ano
def feed_ratingindex():
if not current_user.check_visibility(constants.SIDEBAR_RATING):
abort(404)
off = request.args.get("offset") or 0
entries = calibre_db.session.query(db.Ratings, func.count('books_ratings_link.book').label('count'),
(db.Ratings.rating / 2).label('name')) \
.join(db.books_ratings_link)\
.join(db.Books)\
.filter(calibre_db.common_filters()) \
.group_by(text('books_ratings_link.rating'))\
.order_by(db.Ratings.rating).all()
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
len(entries))
element = list()
for entry in entries:
element.append(FeedObject(entry[0].id, _("{} Stars").format(entry.name)))
return render_xml_template('feed.xml', listelements=element, folder='opds.feed_ratings', pagination=pagination)
@opds.route("/opds/ratings/<book_id>")
@requires_basic_auth_if_no_ano
def feed_ratings(book_id):
return render_xml_dataset(db.Ratings, book_id)
@opds.route("/opds/formats")
@requires_basic_auth_if_no_ano
def feed_formatindex():
if not current_user.check_visibility(constants.SIDEBAR_FORMAT):
abort(404)
off = request.args.get("offset") or 0
entries = calibre_db.session.query(db.Data).join(db.Books)\
.filter(calibre_db.common_filters()) \
.group_by(db.Data.format)\
.order_by(db.Data.format).all()
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
len(entries))
element = list()
for entry in entries:
element.append(FeedObject(entry.format, entry.format))
return render_xml_template('feed.xml', listelements=element, folder='opds.feed_format', pagination=pagination)
@opds.route("/opds/formats/<book_id>")
@requires_basic_auth_if_no_ano
def feed_format(book_id):
off = request.args.get("offset") or 0
entries, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), 0,
db.Books,
db.Books.data.any(db.Data.format == book_id.upper()),
[db.Books.timestamp.desc()],
True, config.config_read_column)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/language")
@opds.route("/opds/language/")
@requires_basic_auth_if_no_ano
def feed_languagesindex():
if not current_user.check_visibility(constants.SIDEBAR_LANGUAGE):
abort(404)
off = request.args.get("offset") or 0
if current_user.filter_language() == "all":
languages = calibre_db.speaking_language()
else:
languages = calibre_db.session.query(db.Languages).filter(
db.Languages.lang_code == current_user.filter_language()).all()
languages[0].name = isoLanguages.get_language_name(get_locale(), languages[0].lang_code)
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
len(languages))
return render_xml_template('feed.xml', listelements=languages, folder='opds.feed_languages', pagination=pagination)
@opds.route("/opds/language/<int:book_id>")
@requires_basic_auth_if_no_ano
def feed_languages(book_id):
off = request.args.get("offset") or 0
entries, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), 0,
db.Books,
db.Books.languages.any(db.Languages.id == book_id),
[db.Books.timestamp.desc()],
True, config.config_read_column)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
@opds.route("/opds/shelfindex")
@requires_basic_auth_if_no_ano
def feed_shelfindex():
if not (current_user.is_authenticated or g.allow_anonymous):
abort(404)
off = request.args.get("offset") or 0
shelf = ub.session.query(ub.Shelf).filter(
or_(ub.Shelf.is_public == 1, ub.Shelf.user_id == current_user.id)).order_by(ub.Shelf.name).all()
number = len(shelf)
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
number)
return render_xml_template('feed.xml', listelements=shelf, folder='opds.feed_shelf', pagination=pagination)
@opds.route("/opds/shelf/<int:book_id>")
@requires_basic_auth_if_no_ano
def feed_shelf(book_id):
if not (current_user.is_authenticated or g.allow_anonymous):
abort(404)
off = request.args.get("offset") or 0
if current_user.is_anonymous:
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.is_public == 1,
ub.Shelf.id == book_id).first()
else:
shelf = ub.session.query(ub.Shelf).filter(or_(and_(ub.Shelf.user_id == int(current_user.id),
ub.Shelf.id == book_id),
and_(ub.Shelf.is_public == 1,
ub.Shelf.id == book_id))).first()
result = list()
# user is allowed to access shelf
if shelf:
result, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1),
config.config_books_per_page,
db.Books,
ub.BookShelf.shelf == shelf.id,
[ub.BookShelf.order.asc()],
True, config.config_read_column,
ub.BookShelf, ub.BookShelf.book_id == db.Books.id)
# delete shelf entries where book is not existent anymore, can happen if book is deleted outside calibre-web
wrong_entries = calibre_db.session.query(ub.BookShelf) \
.join(db.Books, ub.BookShelf.book_id == db.Books.id, isouter=True) \
.filter(db.Books.id == None).all()
for entry in wrong_entries:
log.info('Not existing book {} in {} deleted'.format(entry.book_id, shelf))
try:
ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == entry.book_id).delete()
ub.session.commit()
except (OperationalError, InvalidRequestError) as e:
ub.session.rollback()
log.error_or_exception("Settings Database error: {}".format(e))
return render_xml_template('feed.xml', entries=result, pagination=pagination)
@opds.route("/opds/download/<book_id>/<book_format>/")
@requires_basic_auth_if_no_ano
def opds_download_link(book_id, book_format):
if not current_user.role_download():
return abort(403)
if "Kobo" in request.headers.get('User-Agent'):
client = "kobo"
else:
client = ""
return get_download_link(book_id, book_format.lower(), client)
@opds.route("/ajax/book/<string:uuid>/<library>")
@opds.route("/ajax/book/<string:uuid>", defaults={'library': ""})
@requires_basic_auth_if_no_ano
def get_metadata_calibre_companion(uuid, library):
entry = calibre_db.session.query(db.Books).filter(db.Books.uuid.like("%" + uuid + "%")).first()
if entry is not None:
js = render_template('json.txt', entry=entry)
response = make_response(js)
response.headers["Content-Type"] = "application/json; charset=utf-8"
return response
else:
return ""
@opds.route("/opds/stats")
@requires_basic_auth_if_no_ano
def get_database_stats():
stat = dict()
stat['books'] = calibre_db.session.query(db.Books).count()
stat['authors'] = calibre_db.session.query(db.Authors).count()
stat['categories'] = calibre_db.session.query(db.Tags).count()
stat['series'] = calibre_db.session.query(db.Series).count()
return Response(json.dumps(stat), mimetype="application/json")
@opds.route("/opds/thumb_240_240/<book_id>")
@opds.route("/opds/cover_240_240/<book_id>")
@opds.route("/opds/cover_90_90/<book_id>")
@opds.route("/opds/cover/<book_id>")
@requires_basic_auth_if_no_ano
def feed_get_cover(book_id):
return get_book_cover(book_id)
@opds.route("/opds/readbooks")
@requires_basic_auth_if_no_ano
def feed_read_books():
if not (current_user.check_visibility(constants.SIDEBAR_READ_AND_UNREAD) and not current_user.is_anonymous):
return abort(403)
off = request.args.get("offset") or 0
result, pagination = render_read_books(int(off) / (int(config.config_books_per_page)) + 1, True, True)
return render_xml_template('feed.xml', entries=result, pagination=pagination)
@opds.route("/opds/unreadbooks")
@requires_basic_auth_if_no_ano
def feed_unread_books():
if not (current_user.check_visibility(constants.SIDEBAR_READ_AND_UNREAD) and not current_user.is_anonymous):
return abort(403)
off = request.args.get("offset") or 0
result, pagination = render_read_books(int(off) / (int(config.config_books_per_page)) + 1, False, True)
return render_xml_template('feed.xml', entries=result, pagination=pagination)
class FeedObject:
def __init__(self, rating_id, rating_name):
self.rating_id = rating_id
self.rating_name = rating_name
@property
def id(self):
return self.rating_id
@property
def name(self):
return self.rating_name
def feed_search(term):
if term:
entries, __, ___ = calibre_db.get_search_results(term, config=config)
entries_count = len(entries) if len(entries) > 0 else 1
pagination = Pagination(1, entries_count, entries_count)
return render_xml_template('feed.xml', searchterm=term, entries=entries, pagination=pagination)
else:
return render_xml_template('feed.xml', searchterm="")
def render_xml_template(*args, **kwargs):
# ToDo: return time in current timezone similar to %z
currtime = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S+00:00")
xml = render_template(current_time=currtime, instance=config.config_calibre_web_title, constants=constants.sidebar_settings, *args, **kwargs)
response = make_response(xml)
response.headers["Content-Type"] = "application/atom+xml; charset=utf-8"
return response
def render_xml_dataset(data_table, book_id):
off = request.args.get("offset") or 0
entries, __, pagination = calibre_db.fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), 0,
db.Books,
getattr(db.Books, data_table.__tablename__).any(data_table.id == book_id),
[db.Books.timestamp.desc()],
True, config.config_read_column)
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
def render_element_index(database_column, linked_table, folder):
shift = 0
off = int(request.args.get("offset") or 0)
entries = calibre_db.session.query(func.upper(func.substr(database_column, 1, 1)).label('id'), None, None)
# query = calibre_db.generate_linked_query(config.config_read_column, db.Books)
if linked_table is not None:
entries = entries.join(linked_table).join(db.Books)
entries = entries.filter(calibre_db.common_filters()).group_by(func.upper(func.substr(database_column, 1, 1))).all()
elements = []
if off == 0 and entries:
elements.append({'id': "00", 'name': _("All")})
shift = 1
for entry in entries[
off + shift - 1:
int(off + int(config.config_books_per_page) - shift)]:
elements.append({'id': entry.id, 'name': entry.id})
pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
len(entries) + 1)
return render_xml_template('feed.xml',
letterelements=elements,
folder=folder,
pagination=pagination)

75
cps/pagination.py Normal file
View File

@ -0,0 +1,75 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from math import ceil
# simple pagination for the feed
class Pagination(object):
def __init__(self, page, per_page, total_count):
self.page = int(page)
self.per_page = int(per_page)
self.total_count = int(total_count)
@property
def next_offset(self):
return int(self.page * self.per_page)
@property
def previous_offset(self):
return int((self.page - 2) * self.per_page)
@property
def last_offset(self):
last = int(self.total_count) - int(self.per_page)
if last < 0:
last = 0
return int(last)
@property
def pages(self):
return int(ceil(self.total_count / float(self.per_page)))
@property
def has_prev(self):
return self.page > 1
@property
def has_next(self):
return self.page < self.pages
# right_edge: last right_edges count of all pages are shown as number, means, if 10 pages are paginated -> 9,10 shown
# left_edge: first left_edges count of all pages are shown as number -> 1,2 shown
# left_current: left_current count below current page are shown as number, means if current page 5 -> 3,4 shown
# left_current: right_current count above current page are shown as number, means if current page 5 -> 6,7 shown
def iter_pages(self, left_edge=2, left_current=2,
right_current=4, right_edge=2):
last = 0
left_current = self.page - left_current - 1
right_current = self.page + right_current + 1
right_edge = self.pages - right_edge
for num in range(1, (self.pages + 1)):
if num <= left_edge or (left_current < num < right_current) or num > right_edge:
if last + 1 != num:
yield None
yield num
last = num

30
cps/redirect.py Normal file → Executable file
View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Flask License
@ -26,13 +25,11 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# http://flask.pocoo.org/snippets/62/
# https://web.archive.org/web/20120517003641/http://flask.pocoo.org/snippets/62/
try:
from urllib.parse import urlparse, urljoin
except ImportError:
from urlparse import urlparse, urljoin
from flask import request, url_for, redirect
from urllib.parse import urlparse, urljoin
from flask import request, url_for, redirect, current_app
def is_safe_url(target):
@ -41,16 +38,15 @@ def is_safe_url(target):
return test_url.scheme in ('http', 'https') and ref_url.netloc == test_url.netloc
def get_redirect_target():
for target in request.values.get('next'), request.referrer:
if not target:
continue
if is_safe_url(target):
return target
def remove_prefix(text, prefix):
if text.startswith(prefix):
return text[len(prefix):]
return ""
def redirect_back(endpoint, **values):
target = request.form['next']
if not target or not is_safe_url(target):
def get_redirect_location(next, endpoint, **values):
target = next or url_for(endpoint, **values)
adapter = current_app.url_map.bind(urlparse(request.host_url).netloc)
if not len(adapter.allowed_methods(remove_prefix(target, request.environ.get('HTTP_X_SCRIPT_NAME',"")))):
target = url_for(endpoint, **values)
return redirect(target)
return target

135
cps/remotelogin.py Normal file
View File

@ -0,0 +1,135 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
from datetime import datetime
from functools import wraps
from flask import Blueprint, request, make_response, abort, url_for, flash, redirect
from flask_login import login_required, current_user, login_user
from flask_babel import gettext as _
from sqlalchemy.sql.expression import true
from . import config, logger, ub
from .render_template import render_title_template
remotelogin = Blueprint('remotelogin', __name__)
log = logger.create()
def remote_login_required(f):
@wraps(f)
def inner(*args, **kwargs):
if config.config_remote_login:
return f(*args, **kwargs)
if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
data = {'status': 'error', 'message': 'Forbidden'}
response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8"
return response, 403
abort(403)
return inner
@remotelogin.route('/remote/login')
@remote_login_required
def remote_login():
auth_token = ub.RemoteAuthToken()
ub.session.add(auth_token)
ub.session_commit()
verify_url = url_for('remotelogin.verify_token', token=auth_token.auth_token, _external=true)
log.debug("Remot Login request with token: %s", auth_token.auth_token)
return render_title_template('remote_login.html', title=_("Login"), token=auth_token.auth_token,
verify_url=verify_url, page="remotelogin")
@remotelogin.route('/verify/<token>')
@remote_login_required
@login_required
def verify_token(token):
auth_token = ub.session.query(ub.RemoteAuthToken).filter(ub.RemoteAuthToken.auth_token == token).first()
# Token not found
if auth_token is None:
flash(_("Token not found"), category="error")
log.error("Remote Login token not found")
return redirect(url_for('web.index'))
# Token expired
elif datetime.now() > auth_token.expiration:
ub.session.delete(auth_token)
ub.session_commit()
flash(_("Token has expired"), category="error")
log.error("Remote Login token expired")
return redirect(url_for('web.index'))
# Update token with user information
auth_token.user_id = current_user.id
auth_token.verified = True
ub.session_commit()
flash(_("Success! Please return to your device"), category="success")
log.debug("Remote Login token for userid %s verified", auth_token.user_id)
return redirect(url_for('web.index'))
@remotelogin.route('/ajax/verify_token', methods=['POST'])
@remote_login_required
def token_verified():
token = request.form['token']
auth_token = ub.session.query(ub.RemoteAuthToken).filter(ub.RemoteAuthToken.auth_token == token).first()
data = {}
# Token not found
if auth_token is None:
data['status'] = 'error'
data['message'] = _("Token not found")
# Token expired
elif datetime.now() > auth_token.expiration:
ub.session.delete(auth_token)
ub.session_commit()
data['status'] = 'error'
data['message'] = _("Token has expired")
elif not auth_token.verified:
data['status'] = 'not_verified'
else:
user = ub.session.query(ub.User).filter(ub.User.id == auth_token.user_id).first()
login_user(user)
ub.session.delete(auth_token)
ub.session_commit("User {} logged in via remotelogin, token deleted".format(user.name))
data['status'] = 'success'
log.debug("Remote Login for userid %s succeeded", user.id)
flash(_("Success! You are now logged in as: %(nickname)s", nickname=user.name), category="success")
response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8"
return response

119
cps/render_template.py Normal file
View File

@ -0,0 +1,119 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2020 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from flask import render_template, g, abort, request
from flask_babel import gettext as _
from werkzeug.local import LocalProxy
from flask_login import current_user
from sqlalchemy.sql.expression import or_
from . import config, constants, logger, ub
from .ub import User
log = logger.create()
def get_sidebar_config(kwargs=None):
kwargs = kwargs or []
simple = bool([e for e in ['kindle', 'tolino', "kobo", "bookeen"]
if (e in request.headers.get('User-Agent', "").lower())])
if 'content' in kwargs:
content = kwargs['content']
content = isinstance(content, (User, LocalProxy)) and not content.role_anonymous()
else:
content = 'conf' in kwargs
sidebar = list()
sidebar.append({"glyph": "glyphicon-book", "text": _('Books'), "link": 'web.index', "id": "new",
"visibility": constants.SIDEBAR_RECENT, 'public': True, "page": "root",
"show_text": _('Show recent books'), "config_show":False})
sidebar.append({"glyph": "glyphicon-fire", "text": _('Hot Books'), "link": 'web.books_list', "id": "hot",
"visibility": constants.SIDEBAR_HOT, 'public': True, "page": "hot",
"show_text": _('Show Hot Books'), "config_show": True})
if current_user.role_admin():
sidebar.append({"glyph": "glyphicon-download", "text": _('Downloaded Books'), "link": 'web.download_list',
"id": "download", "visibility": constants.SIDEBAR_DOWNLOAD, 'public': (not current_user.is_anonymous),
"page": "download", "show_text": _('Show Downloaded Books'),
"config_show": content})
else:
sidebar.append({"glyph": "glyphicon-download", "text": _('Downloaded Books'), "link": 'web.books_list',
"id": "download", "visibility": constants.SIDEBAR_DOWNLOAD, 'public': (not current_user.is_anonymous),
"page": "download", "show_text": _('Show Downloaded Books'),
"config_show": content})
sidebar.append(
{"glyph": "glyphicon-star", "text": _('Top Rated Books'), "link": 'web.books_list', "id": "rated",
"visibility": constants.SIDEBAR_BEST_RATED, 'public': True, "page": "rated",
"show_text": _('Show Top Rated Books'), "config_show": True})
sidebar.append({"glyph": "glyphicon-eye-open", "text": _('Read Books'), "link": 'web.books_list', "id": "read",
"visibility": constants.SIDEBAR_READ_AND_UNREAD, 'public': (not current_user.is_anonymous),
"page": "read", "show_text": _('Show Read and Unread'), "config_show": content})
sidebar.append(
{"glyph": "glyphicon-eye-close", "text": _('Unread Books'), "link": 'web.books_list', "id": "unread",
"visibility": constants.SIDEBAR_READ_AND_UNREAD, 'public': (not current_user.is_anonymous), "page": "unread",
"show_text": _('Show unread'), "config_show": False})
sidebar.append({"glyph": "glyphicon-random", "text": _('Discover'), "link": 'web.books_list', "id": "rand",
"visibility": constants.SIDEBAR_RANDOM, 'public': True, "page": "discover",
"show_text": _('Show Random Books'), "config_show": True})
sidebar.append({"glyph": "glyphicon-inbox", "text": _('Categories'), "link": 'web.category_list', "id": "cat",
"visibility": constants.SIDEBAR_CATEGORY, 'public': True, "page": "category",
"show_text": _('Show Category Section'), "config_show": True})
sidebar.append({"glyph": "glyphicon-bookmark", "text": _('Series'), "link": 'web.series_list', "id": "serie",
"visibility": constants.SIDEBAR_SERIES, 'public': True, "page": "series",
"show_text": _('Show Series Section'), "config_show": True})
sidebar.append({"glyph": "glyphicon-user", "text": _('Authors'), "link": 'web.author_list', "id": "author",
"visibility": constants.SIDEBAR_AUTHOR, 'public': True, "page": "author",
"show_text": _('Show Author Section'), "config_show": True})
sidebar.append(
{"glyph": "glyphicon-text-size", "text": _('Publishers'), "link": 'web.publisher_list', "id": "publisher",
"visibility": constants.SIDEBAR_PUBLISHER, 'public': True, "page": "publisher",
"show_text": _('Show Publisher Section'), "config_show":True})
sidebar.append({"glyph": "glyphicon-flag", "text": _('Languages'), "link": 'web.language_overview', "id": "lang",
"visibility": constants.SIDEBAR_LANGUAGE, 'public': (current_user.filter_language() == 'all'),
"page": "language",
"show_text": _('Show Language Section'), "config_show": True})
sidebar.append({"glyph": "glyphicon-star-empty", "text": _('Ratings'), "link": 'web.ratings_list', "id": "rate",
"visibility": constants.SIDEBAR_RATING, 'public': True,
"page": "rating", "show_text": _('Show Ratings Section'), "config_show": True})
sidebar.append({"glyph": "glyphicon-file", "text": _('File formats'), "link": 'web.formats_list', "id": "format",
"visibility": constants.SIDEBAR_FORMAT, 'public': True,
"page": "format", "show_text": _('Show File Formats Section'), "config_show": True})
sidebar.append(
{"glyph": "glyphicon-trash", "text": _('Archived Books'), "link": 'web.books_list', "id": "archived",
"visibility": constants.SIDEBAR_ARCHIVED, 'public': (not current_user.is_anonymous), "page": "archived",
"show_text": _('Show Archived Books'), "config_show": content})
if not simple:
sidebar.append(
{"glyph": "glyphicon-th-list", "text": _('Books List'), "link": 'web.books_table', "id": "list",
"visibility": constants.SIDEBAR_LIST, 'public': (not current_user.is_anonymous), "page": "list",
"show_text": _('Show Books List'), "config_show": content})
g.shelves_access = ub.session.query(ub.Shelf).filter(
or_(ub.Shelf.is_public == 1, ub.Shelf.user_id == current_user.id)).order_by(ub.Shelf.name).all()
return sidebar, simple
# Returns the template for rendering and includes the instance name
def render_title_template(*args, **kwargs):
sidebar, simple = get_sidebar_config(kwargs)
try:
return render_template(instance=config.config_calibre_web_title, sidebar=sidebar, simple=simple,
accept=constants.EXTENSIONS_UPLOAD,
*args, **kwargs)
except PermissionError:
log.error("No permission to access {} file.".format(args[0]))
abort(403)

View File

@ -1,21 +1,41 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018 cervinko, janeczku, OzzieIsaacs
# Flask License
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Copyright © 2010 by the Pallets team, cervinko, janeczku, OzzieIsaacs
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# Some rights reserved.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Redistribution and use in source and binary forms of the software as
# well as documentation, with or without modification, are permitted
# provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# Inspired by http://flask.pocoo.org/snippets/35/
class ReverseProxied(object):
"""Wrap the application in this middleware and configure the
@ -37,10 +57,13 @@ class ReverseProxied(object):
def __init__(self, application):
self.app = application
self.proxied = False
def __call__(self, environ, start_response):
self.proxied = False
script_name = environ.get('HTTP_X_SCRIPT_NAME', '')
if script_name:
self.proxied = True
environ['SCRIPT_NAME'] = script_name
path_info = environ.get('PATH_INFO', '')
if path_info and path_info.startswith(script_name):
@ -52,4 +75,9 @@ class ReverseProxied(object):
servr = environ.get('HTTP_X_FORWARDED_HOST', '')
if servr:
environ['HTTP_HOST'] = servr
self.proxied = True
return self.app(environ, start_response)
@property
def is_proxied(self):
return self.proxied

110
cps/schedule.py Normal file
View File

@ -0,0 +1,110 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2020 mmonkey
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import datetime
from . import config, constants
from .services.background_scheduler import BackgroundScheduler, CronTrigger, use_APScheduler
from .tasks.database import TaskReconnectDatabase
from .tasks.tempFolder import TaskDeleteTempFolder
from .tasks.thumbnail import TaskGenerateCoverThumbnails, TaskGenerateSeriesThumbnails, TaskClearCoverThumbnailCache
from .services.worker import WorkerThread
from .tasks.metadata_backup import TaskBackupMetadata
def get_scheduled_tasks(reconnect=True):
tasks = list()
# Reconnect Calibre database (metadata.db) based on config.schedule_reconnect
if reconnect:
tasks.append([lambda: TaskReconnectDatabase(), 'reconnect', False])
# Delete temp folder
tasks.append([lambda: TaskDeleteTempFolder(), 'delete temp', True])
# Generate metadata.opf file for each changed book
if config.schedule_metadata_backup:
tasks.append([lambda: TaskBackupMetadata("en"), 'backup metadata', False])
# Generate all missing book cover thumbnails
if config.schedule_generate_book_covers:
tasks.append([lambda: TaskClearCoverThumbnailCache(0), 'delete superfluous book covers', True])
tasks.append([lambda: TaskGenerateCoverThumbnails(), 'generate book covers', False])
# Generate all missing series thumbnails
if config.schedule_generate_series_covers:
tasks.append([lambda: TaskGenerateSeriesThumbnails(), 'generate book covers', False])
return tasks
def end_scheduled_tasks():
worker = WorkerThread.get_instance()
for __, __, __, task, __ in worker.tasks:
if task.scheduled and task.is_cancellable:
worker.end_task(task.id)
def register_scheduled_tasks(reconnect=True):
scheduler = BackgroundScheduler()
if scheduler:
# Remove all existing jobs
scheduler.remove_all_jobs()
start = config.schedule_start_time
duration = config.schedule_duration
# Register scheduled tasks
timezone_info = datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo
scheduler.schedule_tasks(tasks=get_scheduled_tasks(reconnect), trigger=CronTrigger(hour=start,
timezone=timezone_info))
end_time = calclulate_end_time(start, duration)
scheduler.schedule(func=end_scheduled_tasks, trigger=CronTrigger(hour=end_time.hour, minute=end_time.minute,
timezone=timezone_info),
name="end scheduled task")
# Kick-off tasks, if they should currently be running
if should_task_be_running(start, duration):
scheduler.schedule_tasks_immediately(tasks=get_scheduled_tasks(reconnect))
def register_startup_tasks():
scheduler = BackgroundScheduler()
if scheduler:
start = config.schedule_start_time
duration = config.schedule_duration
# Run scheduled tasks immediately for development and testing
# Ignore tasks that should currently be running, as these will be added when registering scheduled tasks
if constants.APP_MODE in ['development', 'test'] and not should_task_be_running(start, duration):
scheduler.schedule_tasks_immediately(tasks=get_scheduled_tasks(False))
else:
scheduler.schedule_tasks_immediately(tasks=[[lambda: TaskDeleteTempFolder(), 'delete temp', True]])
def should_task_be_running(start, duration):
now = datetime.datetime.now()
start_time = datetime.datetime.now().replace(hour=start, minute=0, second=0, microsecond=0)
end_time = start_time + datetime.timedelta(hours=duration // 60, minutes=duration % 60)
return start_time < now < end_time
def calclulate_end_time(start, duration):
start_time = datetime.datetime.now().replace(hour=start, minute=0)
return start_time + datetime.timedelta(hours=duration // 60, minutes=duration % 60)

403
cps/search.py Normal file
View File

@ -0,0 +1,403 @@
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2022 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
from datetime import datetime
from flask import Blueprint, request, redirect, url_for, flash
from flask import session as flask_session
from flask_login import current_user
from flask_babel import format_date
from flask_babel import gettext as _
from sqlalchemy.sql.expression import func, not_, and_, or_, text, true
from sqlalchemy.sql.functions import coalesce
from . import logger, db, calibre_db, config, ub
from .usermanagement import login_required_if_no_ano
from .render_template import render_title_template
from .pagination import Pagination
search = Blueprint('search', __name__)
log = logger.create()
@search.route("/search", methods=["GET"])
@login_required_if_no_ano
def simple_search():
term = request.args.get("query")
if term:
return redirect(url_for('web.books_list', data="search", sort_param='stored', query=term.strip()))
else:
return render_title_template('search.html',
searchterm="",
result_count=0,
title=_("Search"),
page="search")
@search.route("/advsearch", methods=['POST'])
@login_required_if_no_ano
def advanced_search():
values = dict(request.form)
params = ['include_tag', 'exclude_tag', 'include_serie', 'exclude_serie', 'include_shelf', 'exclude_shelf',
'include_language', 'exclude_language', 'include_extension', 'exclude_extension']
for param in params:
values[param] = list(request.form.getlist(param))
flask_session['query'] = json.dumps(values)
return redirect(url_for('web.books_list', data="advsearch", sort_param='stored', query=""))
@search.route("/advsearch", methods=['GET'])
@login_required_if_no_ano
def advanced_search_form():
# Build custom columns names
cc = calibre_db.get_cc_columns(config, filter_config_custom_read=True)
return render_prepare_search_form(cc)
def adv_search_custom_columns(cc, term, q):
for c in cc:
if c.datatype == "datetime":
custom_start = term.get('custom_column_' + str(c.id) + '_start')
custom_end = term.get('custom_column_' + str(c.id) + '_end')
if custom_start:
q = q.filter(getattr(db.Books, 'custom_column_' + str(c.id)).any(
func.datetime(db.cc_classes[c.id].value) >= func.datetime(custom_start)))
if custom_end:
q = q.filter(getattr(db.Books, 'custom_column_' + str(c.id)).any(
func.datetime(db.cc_classes[c.id].value) <= func.datetime(custom_end)))
else:
custom_query = term.get('custom_column_' + str(c.id))
if custom_query != '' and custom_query is not None:
if c.datatype == 'bool':
q = q.filter(getattr(db.Books, 'custom_column_' + str(c.id)).any(
db.cc_classes[c.id].value == (custom_query == "True")))
elif c.datatype == 'int' or c.datatype == 'float':
q = q.filter(getattr(db.Books, 'custom_column_' + str(c.id)).any(
db.cc_classes[c.id].value == custom_query))
elif c.datatype == 'rating':
q = q.filter(getattr(db.Books, 'custom_column_' + str(c.id)).any(
db.cc_classes[c.id].value == int(float(custom_query) * 2)))
else:
q = q.filter(getattr(db.Books, 'custom_column_' + str(c.id)).any(
func.lower(db.cc_classes[c.id].value).ilike("%" + custom_query + "%")))
return q
def adv_search_language(q, include_languages_inputs, exclude_languages_inputs):
if current_user.filter_language() != "all":
q = q.filter(db.Books.languages.any(db.Languages.lang_code == current_user.filter_language()))
else:
for language in include_languages_inputs:
q = q.filter(db.Books.languages.any(db.Languages.id == language))
for language in exclude_languages_inputs:
q = q.filter(not_(db.Books.series.any(db.Languages.id == language)))
return q
def adv_search_ratings(q, rating_high, rating_low):
if rating_high:
rating_high = int(rating_high) * 2
q = q.filter(db.Books.ratings.any(db.Ratings.rating <= rating_high))
if rating_low:
rating_low = int(rating_low) * 2
q = q.filter(db.Books.ratings.any(db.Ratings.rating >= rating_low))
return q
def adv_search_read_status(read_status):
if not config.config_read_column:
if read_status == "True":
db_filter = and_(ub.ReadBook.user_id == int(current_user.id),
ub.ReadBook.read_status == ub.ReadBook.STATUS_FINISHED)
else:
db_filter = coalesce(ub.ReadBook.read_status, 0) != ub.ReadBook.STATUS_FINISHED
else:
try:
if read_status == "True":
db_filter = db.cc_classes[config.config_read_column].value == True
else:
db_filter = coalesce(db.cc_classes[config.config_read_column].value, False) != True
except (KeyError, AttributeError, IndexError):
log.error("Custom Column No.{} does not exist in calibre database".format(config.config_read_column))
flash(_("Custom Column No.%(column)d does not exist in calibre database",
column=config.config_read_column),
category="error")
return true()
return db_filter
def adv_search_extension(q, include_extension_inputs, exclude_extension_inputs):
for extension in include_extension_inputs:
q = q.filter(db.Books.data.any(db.Data.format == extension))
for extension in exclude_extension_inputs:
q = q.filter(not_(db.Books.data.any(db.Data.format == extension)))
return q
def adv_search_tag(q, include_tag_inputs, exclude_tag_inputs):
for tag in include_tag_inputs:
q = q.filter(db.Books.tags.any(db.Tags.id == tag))
for tag in exclude_tag_inputs:
q = q.filter(not_(db.Books.tags.any(db.Tags.id == tag)))
return q
def adv_search_serie(q, include_series_inputs, exclude_series_inputs):
for serie in include_series_inputs:
q = q.filter(db.Books.series.any(db.Series.id == serie))
for serie in exclude_series_inputs:
q = q.filter(not_(db.Books.series.any(db.Series.id == serie)))
return q
def adv_search_shelf(q, include_shelf_inputs, exclude_shelf_inputs):
q = q.outerjoin(ub.BookShelf, db.Books.id == ub.BookShelf.book_id)\
.filter(or_(ub.BookShelf.shelf == None, ub.BookShelf.shelf.notin_(exclude_shelf_inputs)))
if len(include_shelf_inputs) > 0:
q = q.filter(ub.BookShelf.shelf.in_(include_shelf_inputs))
return q
def extend_search_term(searchterm,
author_name,
book_title,
publisher,
pub_start,
pub_end,
tags,
rating_high,
rating_low,
read_status,
):
searchterm.extend((author_name.replace('|', ','), book_title, publisher))
if pub_start:
try:
searchterm.extend([_("Published after ") +
format_date(datetime.strptime(pub_start, "%Y-%m-%d"),
format='medium')])
except ValueError:
pub_start = ""
if pub_end:
try:
searchterm.extend([_("Published before ") +
format_date(datetime.strptime(pub_end, "%Y-%m-%d"),
format='medium')])
except ValueError:
pub_end = ""
elements = {'tag': db.Tags, 'serie':db.Series, 'shelf':ub.Shelf}
for key, db_element in elements.items():
tag_names = calibre_db.session.query(db_element).filter(db_element.id.in_(tags['include_' + key])).all()
searchterm.extend(tag.name for tag in tag_names)
tag_names = calibre_db.session.query(db_element).filter(db_element.id.in_(tags['exclude_' + key])).all()
searchterm.extend(tag.name for tag in tag_names)
language_names = calibre_db.session.query(db.Languages). \
filter(db.Languages.id.in_(tags['include_language'])).all()
if language_names:
language_names = calibre_db.speaking_language(language_names)
searchterm.extend(language.name for language in language_names)
language_names = calibre_db.session.query(db.Languages). \
filter(db.Languages.id.in_(tags['exclude_language'])).all()
if language_names:
language_names = calibre_db.speaking_language(language_names)
searchterm.extend(language.name for language in language_names)
if rating_high:
searchterm.extend([_("Rating <= %(rating)s", rating=rating_high)])
if rating_low:
searchterm.extend([_("Rating >= %(rating)s", rating=rating_low)])
if read_status != "Any":
searchterm.extend([_("Read Status = '%(status)s'", status=read_status)])
searchterm.extend(ext for ext in tags['include_extension'])
searchterm.extend(ext for ext in tags['exclude_extension'])
# handle custom columns
searchterm = " + ".join(filter(None, searchterm))
return searchterm, pub_start, pub_end
def render_adv_search_results(term, offset=None, order=None, limit=None):
sort = order[0] if order else [db.Books.sort]
pagination = None
cc = calibre_db.get_cc_columns(config, filter_config_custom_read=True)
calibre_db.session.connection().connection.connection.create_function("lower", 1, db.lcase)
query = calibre_db.generate_linked_query(config.config_read_column, db.Books)
q = query.outerjoin(db.books_series_link, db.Books.id == db.books_series_link.c.book)\
.outerjoin(db.Series)\
.filter(calibre_db.common_filters(True))
# parse multi selects to a complete dict
tags = dict()
elements = ['tag', 'serie', 'shelf', 'language', 'extension']
for element in elements:
tags['include_' + element] = term.get('include_' + element)
tags['exclude_' + element] = term.get('exclude_' + element)
author_name = term.get("author_name")
book_title = term.get("book_title")
publisher = term.get("publisher")
pub_start = term.get("publishstart")
pub_end = term.get("publishend")
rating_low = term.get("ratinghigh")
rating_high = term.get("ratinglow")
description = term.get("comment")
read_status = term.get("read_status")
if author_name:
author_name = author_name.strip().lower().replace(',', '|')
if book_title:
book_title = book_title.strip().lower()
if publisher:
publisher = publisher.strip().lower()
search_term = []
cc_present = False
for c in cc:
if c.datatype == "datetime":
column_start = term.get('custom_column_' + str(c.id) + '_start')
column_end = term.get('custom_column_' + str(c.id) + '_end')
if column_start:
search_term.extend(["{} >= {}".format(c.name,
format_date(datetime.strptime(column_start, "%Y-%m-%d").date(),
format='medium')
)])
cc_present = True
if column_end:
search_term.extend(["{} <= {}".format(c.name,
format_date(datetime.strptime(column_end, "%Y-%m-%d").date(),
format='medium')
)])
cc_present = True
elif term.get('custom_column_' + str(c.id)):
search_term.extend([("{}: {}".format(c.name, term.get('custom_column_' + str(c.id))))])
cc_present = True
if any(tags.values()) or author_name or book_title or publisher or pub_start or pub_end or rating_low \
or rating_high or description or cc_present or read_status != "Any":
search_term, pub_start, pub_end = extend_search_term(search_term,
author_name,
book_title,
publisher,
pub_start,
pub_end,
tags,
rating_high,
rating_low,
read_status)
if author_name:
q = q.filter(db.Books.authors.any(func.lower(db.Authors.name).ilike("%" + author_name + "%")))
if book_title:
q = q.filter(func.lower(db.Books.title).ilike("%" + book_title + "%"))
if pub_start:
q = q.filter(func.datetime(db.Books.pubdate) > func.datetime(pub_start))
if pub_end:
q = q.filter(func.datetime(db.Books.pubdate) < func.datetime(pub_end))
if read_status != "Any":
q = q.filter(adv_search_read_status(read_status))
if publisher:
q = q.filter(db.Books.publishers.any(func.lower(db.Publishers.name).ilike("%" + publisher + "%")))
q = adv_search_tag(q, tags['include_tag'], tags['exclude_tag'])
q = adv_search_serie(q, tags['include_serie'], tags['exclude_serie'])
q = adv_search_shelf(q, tags['include_shelf'], tags['exclude_shelf'])
q = adv_search_extension(q, tags['include_extension'], tags['exclude_extension'])
q = adv_search_language(q, tags['include_language'], tags['exclude_language'])
q = adv_search_ratings(q, rating_high, rating_low)
if description:
q = q.filter(db.Books.comments.any(func.lower(db.Comments.text).ilike("%" + description + "%")))
# search custom columns
try:
q = adv_search_custom_columns(cc, term, q)
except AttributeError as ex:
log.debug_or_exception(ex)
flash(_("Error on search for custom columns, please restart Calibre-Web"), category="error")
q = q.order_by(*sort).all()
flask_session['query'] = json.dumps(term)
ub.store_combo_ids(q)
result_count = len(q)
if offset is not None and limit is not None:
offset = int(offset)
limit_all = offset + int(limit)
pagination = Pagination((offset / (int(limit)) + 1), limit, result_count)
else:
offset = 0
limit_all = result_count
entries = calibre_db.order_authors(q[offset:limit_all], list_return=True, combined=True)
return render_title_template('search.html',
adv_searchterm=search_term,
pagination=pagination,
entries=entries,
result_count=result_count,
title=_("Advanced Search"), page="advsearch",
order=order[1])
def render_prepare_search_form(cc):
# prepare data for search-form
tags = calibre_db.session.query(db.Tags)\
.join(db.books_tags_link)\
.join(db.Books)\
.filter(calibre_db.common_filters()) \
.group_by(text('books_tags_link.tag'))\
.order_by(db.Tags.name).all()
series = calibre_db.session.query(db.Series)\
.join(db.books_series_link)\
.join(db.Books)\
.filter(calibre_db.common_filters()) \
.group_by(text('books_series_link.series'))\
.order_by(db.Series.name)\
.filter(calibre_db.common_filters()).all()
shelves = ub.session.query(ub.Shelf)\
.filter(or_(ub.Shelf.is_public == 1, ub.Shelf.user_id == int(current_user.id)))\
.order_by(ub.Shelf.name).all()
extensions = calibre_db.session.query(db.Data)\
.join(db.Books)\
.filter(calibre_db.common_filters()) \
.group_by(db.Data.format)\
.order_by(db.Data.format).all()
if current_user.filter_language() == "all":
languages = calibre_db.speaking_language()
else:
languages = None
return render_title_template('search_form.html', tags=tags, languages=languages, extensions=extensions,
series=series,shelves=shelves, title=_("Advanced Search"), cc=cc, page="advsearch")
def render_search_results(term, offset=None, order=None, limit=None):
if term:
join = db.books_series_link, db.Books.id == db.books_series_link.c.book, db.Series
entries, result_count, pagination = calibre_db.get_search_results(term,
config,
offset,
order,
limit,
*join)
else:
entries = list()
order = [None, None]
pagination = result_count = None
return render_title_template('search.html',
searchterm=term,
pagination=pagination,
query=term,
adv_searchterm=term,
entries=entries,
result_count=result_count,
title=_("Search"),
page="search",
order=order[1])

143
cps/search_metadata.py Normal file
View File

@ -0,0 +1,143 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import concurrent.futures
import importlib
import inspect
import json
import os
import sys
from flask import Blueprint, Response, request, url_for
from flask_login import current_user
from flask_login import login_required
from flask_babel import get_locale
from sqlalchemy.exc import InvalidRequestError, OperationalError
from sqlalchemy.orm.attributes import flag_modified
from cps.services.Metadata import Metadata
from . import constants, logger, ub, web_server
# current_milli_time = lambda: int(round(time() * 1000))
meta = Blueprint("metadata", __name__)
log = logger.create()
try:
from dataclasses import asdict
except ImportError:
log.info('*** "dataclasses" is needed for calibre-web to run. Please install it using pip: "pip install dataclasses" ***')
print('*** "dataclasses" is needed for calibre-web to run. Please install it using pip: "pip install dataclasses" ***')
web_server.stop(True)
sys.exit(6)
new_list = list()
meta_dir = os.path.join(constants.BASE_DIR, "cps", "metadata_provider")
modules = os.listdir(os.path.join(constants.BASE_DIR, "cps", "metadata_provider"))
for f in modules:
if os.path.isfile(os.path.join(meta_dir, f)) and not f.endswith("__init__.py"):
a = os.path.basename(f)[:-3]
try:
importlib.import_module("cps.metadata_provider." + a)
new_list.append(a)
except (IndentationError, SyntaxError) as e:
log.error("Syntax error for metadata source: {} - {}".format(a, e))
except ImportError as e:
log.debug("Import error for metadata source: {} - {}".format(a, e))
def list_classes(provider_list):
classes = list()
for element in provider_list:
for name, obj in inspect.getmembers(
sys.modules["cps.metadata_provider." + element]
):
if (
inspect.isclass(obj)
and name != "Metadata"
and issubclass(obj, Metadata)
):
classes.append(obj())
return classes
cl = list_classes(new_list)
@meta.route("/metadata/provider")
@login_required
def metadata_provider():
active = current_user.view_settings.get("metadata", {})
provider = list()
for c in cl:
ac = active.get(c.__id__, True)
provider.append(
{"name": c.__name__, "active": ac, "initial": ac, "id": c.__id__}
)
return Response(json.dumps(provider), mimetype="application/json")
@meta.route("/metadata/provider", methods=["POST"])
@meta.route("/metadata/provider/<prov_name>", methods=["POST"])
@login_required
def metadata_change_active_provider(prov_name):
new_state = request.get_json()
active = current_user.view_settings.get("metadata", {})
active[new_state["id"]] = new_state["value"]
current_user.view_settings["metadata"] = active
try:
try:
flag_modified(current_user, "view_settings")
except AttributeError:
pass
ub.session.commit()
except (InvalidRequestError, OperationalError):
log.error("Invalid request received: {}".format(request))
return "Invalid request", 400
if "initial" in new_state and prov_name:
data = []
provider = next((c for c in cl if c.__id__ == prov_name), None)
if provider is not None:
data = provider.search(new_state.get("query", ""))
return Response(
json.dumps([asdict(x) for x in data]), mimetype="application/json"
)
return ""
@meta.route("/metadata/search", methods=["POST"])
@login_required
def metadata_search():
query = request.form.to_dict().get("query")
data = list()
active = current_user.view_settings.get("metadata", {})
locale = get_locale()
if query:
static_cover = url_for("static", filename="generic_cover.jpg")
# start = current_milli_time()
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
meta = {
executor.submit(c.search, query, static_cover, locale): c
for c in cl
if active.get(c.__id__, True)
}
for future in concurrent.futures.as_completed(meta):
data.extend([asdict(x) for x in future.result() if x])
# log.info({'Time elapsed {}'.format(current_milli_time()-start)})
return Response(json.dumps(data), mimetype="application/json")

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
@ -17,148 +16,316 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from socket import error as SocketError
import sys
import os
import errno
import signal
import web
import socket
import asyncio
try:
from gevent.pywsgi import WSGIServer
from .gevent_wsgi import MyWSGIHandler
from gevent.pool import Pool
from gevent import __version__ as geventVersion
gevent_present = True
from gevent.socket import socket as GeventSocket
from gevent import __version__ as _version
from greenlet import GreenletExit
import ssl
VERSION = 'Gevent ' + _version
_GEVENT = True
except ImportError:
from tornado.wsgi import WSGIContainer
from .tornado_wsgi import MyWSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado import version as tornadoVersion
gevent_present = False
from tornado import netutil
from tornado import version as _version
VERSION = 'Tornado ' + _version
_GEVENT = False
from . import logger
log = logger.create()
class server:
wsgiserver = None
restart= False
def _readable_listen_address(address, port):
if ':' in address:
address = "[" + address + "]"
return '%s:%s' % (address, port)
class WebServer(object):
def __init__(self):
signal.signal(signal.SIGINT, self.killServer)
signal.signal(signal.SIGTERM, self.killServer)
signal.signal(signal.SIGINT, self._killServer)
signal.signal(signal.SIGTERM, self._killServer)
self.wsgiserver = None
self.access_logger = None
self.restart = False
self.app = None
self.listen_address = None
self.listen_port = None
self.unix_socket_file = None
self.ssl_args = None
def init_app(self, application, config):
self.app = application
self.listen_address = config.get_config_ipaddress()
self.listen_port = config.config_port
if config.config_access_log:
log_name = "gevent.access" if _GEVENT else "tornado.access"
formatter = logger.ACCESS_FORMATTER_GEVENT if _GEVENT else logger.ACCESS_FORMATTER_TORNADO
self.access_logger, logfile = logger.create_access_log(config.config_access_logfile, log_name, formatter)
if logfile != config.config_access_logfile:
log.warning("Accesslog path %s not valid, falling back to default", config.config_access_logfile)
config.config_access_logfile = logfile
config.save()
else:
if not _GEVENT:
logger.get('tornado.access').disabled = True
certfile_path = config.get_config_certfile()
keyfile_path = config.get_config_keyfile()
if certfile_path and keyfile_path:
if os.path.isfile(certfile_path) and os.path.isfile(keyfile_path):
self.ssl_args = dict(certfile=certfile_path, keyfile=keyfile_path)
else:
log.warning('The specified paths for the ssl certificate file and/or key file seem to be broken. '
'Ignoring ssl.')
log.warning('Cert path: %s', certfile_path)
log.warning('Key path: %s', keyfile_path)
def _make_gevent_socket_activated(self):
# Reuse an already open socket on fd=SD_LISTEN_FDS_START
SD_LISTEN_FDS_START = 3
return GeventSocket(fileno=SD_LISTEN_FDS_START)
def _prepare_unix_socket(self, socket_file):
# the socket file must not exist prior to bind()
if os.path.exists(socket_file):
# avoid nuking regular files and symbolic links (could be a mistype or security issue)
if os.path.isfile(socket_file) or os.path.islink(socket_file):
raise OSError(errno.EEXIST, os.strerror(errno.EEXIST), socket_file)
os.remove(socket_file)
self.unix_socket_file = socket_file
def _make_gevent_listener(self):
if os.name != 'nt':
socket_activated = os.environ.get("LISTEN_FDS")
if socket_activated:
sock = self._make_gevent_socket_activated()
sock_info = sock.getsockname()
return sock, "systemd-socket:" + _readable_listen_address(sock_info[0], sock_info[1])
unix_socket_file = os.environ.get("CALIBRE_UNIX_SOCKET")
if unix_socket_file:
self._prepare_unix_socket(unix_socket_file)
unix_sock = WSGIServer.get_listener(unix_socket_file, family=socket.AF_UNIX)
# ensure current user and group have r/w permissions, no permissions for other users
# this way the socket can be shared in a semi-secure manner
# between the user running calibre-web and the user running the fronting webserver
os.chmod(unix_socket_file, 0o660)
return unix_sock, "unix:" + unix_socket_file
if self.listen_address:
return ((self.listen_address, self.listen_port),
_readable_listen_address(self.listen_address, self.listen_port))
if os.name == 'nt':
self.listen_address = '0.0.0.0'
return ((self.listen_address, self.listen_port),
_readable_listen_address(self.listen_address, self.listen_port))
def start_gevent(self):
try:
ssl_args = dict()
certfile_path = web.ub.config.get_config_certfile()
keyfile_path = web.ub.config.get_config_keyfile()
if certfile_path and keyfile_path:
if os.path.isfile(certfile_path) and os.path.isfile(keyfile_path):
ssl_args = {"certfile": certfile_path,
"keyfile": keyfile_path}
else:
web.app.logger.info('The specified paths for the ssl certificate file and/or key file seem to be broken. Ignoring ssl. Cert path: %s | Key path: %s' % (certfile_path, keyfile_path))
if os.name == 'nt':
self.wsgiserver= WSGIServer(('0.0.0.0', web.ub.config.config_port), web.app, spawn=Pool(), **ssl_args)
else:
self.wsgiserver = WSGIServer(('', web.ub.config.config_port), web.app, spawn=Pool(), **ssl_args)
web.py3_gevent_link = self.wsgiserver
self.wsgiserver.serve_forever()
address = ('::', self.listen_port)
sock = WSGIServer.get_listener(address, family=socket.AF_INET6)
except socket.error as ex:
log.error('%s', ex)
log.warning('Unable to listen on {}, trying on IPv4 only...'.format(address))
address = ('', self.listen_port)
sock = WSGIServer.get_listener(address, family=socket.AF_INET)
except SocketError:
try:
web.app.logger.info('Unable to listen on \'\', trying on IPv4 only...')
self.wsgiserver = WSGIServer(('0.0.0.0', web.ub.config.config_port), web.app, spawn=Pool(), **ssl_args)
web.py3_gevent_link = self.wsgiserver
self.wsgiserver.serve_forever()
except (OSError, SocketError) as e:
web.app.logger.info("Error starting server: %s" % e.strerror)
print("Error starting server: %s" % e.strerror)
web.helper.global_WorkerThread.stop()
sys.exit(1)
except Exception:
web.app.logger.info("Unknown error while starting gevent")
def startServer(self):
if gevent_present:
web.app.logger.info('Starting Gevent server')
# leave subprocess out to allow forking for fetchers and processors
self.start_gevent()
else:
try:
ssl = None
web.app.logger.info('Starting Tornado server')
certfile_path = web.ub.config.get_config_certfile()
keyfile_path = web.ub.config.get_config_keyfile()
if certfile_path and keyfile_path:
if os.path.isfile(certfile_path) and os.path.isfile(keyfile_path):
ssl = {"certfile": certfile_path,
"keyfile": keyfile_path}
else:
web.app.logger.info('The specified paths for the ssl certificate file and/or key file seem to be broken. Ignoring ssl. Cert path: %s | Key path: %s' % (certfile_path, keyfile_path))
# Max Buffersize set to 200MB
http_server = HTTPServer(WSGIContainer(web.app),
max_buffer_size = 209700000,
ssl_options=ssl)
http_server.listen(web.ub.config.config_port)
self.wsgiserver=IOLoop.instance()
self.wsgiserver.start()
# wait for stop signal
self.wsgiserver.close(True)
except SocketError as e:
web.app.logger.info("Error starting server: %s" % e.strerror)
print("Error starting server: %s" % e.strerror)
web.helper.global_WorkerThread.stop()
sys.exit(1)
# ToDo: Somehow caused by circular import under python3 refactor
if sys.version_info > (3, 0):
self.restart = web.py3_restart_Typ
if self.restart == True:
web.app.logger.info("Performing restart of Calibre-Web")
web.helper.global_WorkerThread.stop()
if os.name == 'nt':
arguments = ["\"" + sys.executable + "\""]
for e in sys.argv:
arguments.append("\"" + e + "\"")
os.execv(sys.executable, arguments)
else:
os.execl(sys.executable, sys.executable, *sys.argv)
else:
web.app.logger.info("Performing shutdown of Calibre-Web")
web.helper.global_WorkerThread.stop()
sys.exit(0)
def setRestartTyp(self,starttyp):
self.restart = starttyp
# ToDo: Somehow caused by circular import under python3 refactor
web.py3_restart_Typ = starttyp
def killServer(self, signum, frame):
self.stopServer()
def stopServer(self):
# ToDo: Somehow caused by circular import under python3 refactor
if sys.version_info > (3, 0):
if not self.wsgiserver:
if gevent_present:
self.wsgiserver = web.py3_gevent_link
else:
self.wsgiserver = IOLoop.instance()
if self.wsgiserver:
if gevent_present:
self.wsgiserver.close()
else:
self.wsgiserver.add_callback(self.wsgiserver.stop)
return sock, _readable_listen_address(*address)
@staticmethod
def getNameVersion():
if gevent_present:
return {'Gevent':'v'+geventVersion}
def _get_args_for_reloading():
"""Determine how the script was executed, and return the args needed
to execute it again in a new process.
Code from https://github.com/pyload/pyload. Author GammaC0de, voulter
"""
rv = [sys.executable]
py_script = sys.argv[0]
args = sys.argv[1:]
# Need to look at main module to determine how it was executed.
__main__ = sys.modules["__main__"]
# The value of __package__ indicates how Python was called. It may
# not exist if a setuptools script is installed as an egg. It may be
# set incorrectly for entry points created with pip on Windows.
if getattr(__main__, "__package__", "") in ["", None] or (
os.name == "nt"
and __main__.__package__ == ""
and not os.path.exists(py_script)
and os.path.exists("{}.exe".format(py_script))
):
# Executed a file, like "python app.py".
py_script = os.path.abspath(py_script)
if os.name == "nt":
# Windows entry points have ".exe" extension and should be
# called directly.
if not os.path.exists(py_script) and os.path.exists("{}.exe".format(py_script)):
py_script += ".exe"
if (
os.path.splitext(sys.executable)[1] == ".exe"
and os.path.splitext(py_script)[1] == ".exe"
):
rv.pop(0)
rv.append(py_script)
else:
return {'Tornado':'v'+tornadoVersion}
# Executed a module, like "python -m module".
if sys.argv[0] == "-m":
args = sys.argv
else:
if os.path.isfile(py_script):
# Rewritten by Python from "-m script" to "/path/to/script.py".
py_module = __main__.__package__
name = os.path.splitext(os.path.basename(py_script))[0]
if name != "__main__":
py_module += ".{}".format(name)
else:
# Incorrectly rewritten by pydevd debugger from "-m script" to "script".
py_module = py_script
rv.extend(("-m", py_module.lstrip(".")))
rv.extend(args)
if os.name == 'nt':
rv = ['"{}"'.format(a) for a in rv]
return rv
def _start_gevent(self):
ssl_args = self.ssl_args or {}
try:
sock, output = self._make_gevent_listener()
log.info('Starting Gevent server on %s', output)
self.wsgiserver = WSGIServer(sock, self.app, log=self.access_logger, handler_class=MyWSGIHandler,
error_log=log,
spawn=Pool(), **ssl_args)
if ssl_args:
wrap_socket = self.wsgiserver.wrap_socket
def my_wrap_socket(*args, **kwargs):
try:
return wrap_socket(*args, **kwargs)
except (ssl.SSLError, OSError) as ex:
log.warning('Gevent SSL Error: %s', ex)
raise GreenletExit
self.wsgiserver.wrap_socket = my_wrap_socket
self.wsgiserver.serve_forever()
finally:
if self.unix_socket_file:
os.remove(self.unix_socket_file)
self.unix_socket_file = None
def _start_tornado(self):
if os.name == 'nt' and sys.version_info > (3, 7):
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
try:
# Max Buffersize set to 200MB
http_server = HTTPServer(MyWSGIContainer(self.app),
max_buffer_size=209700000,
ssl_options=self.ssl_args)
unix_socket_file = os.environ.get("CALIBRE_UNIX_SOCKET")
if os.environ.get("LISTEN_FDS") and os.name != 'nt':
SD_LISTEN_FDS_START = 3
sock = socket.socket(fileno=SD_LISTEN_FDS_START)
http_server.add_socket(sock)
sock.setblocking(0)
socket_name =sock.getsockname()
output = "systemd-socket:" + _readable_listen_address(socket_name[0], socket_name[1])
elif unix_socket_file and os.name != 'nt':
self._prepare_unix_socket(unix_socket_file)
output = "unix:" + unix_socket_file
unix_socket = netutil.bind_unix_socket(self.unix_socket_file)
http_server.add_socket(unix_socket)
# ensure current user and group have r/w permissions, no permissions for other users
# this way the socket can be shared in a semi-secure manner
# between the user running calibre-web and the user running the fronting webserver
os.chmod(self.unix_socket_file, 0o660)
else:
output = _readable_listen_address(self.listen_address, self.listen_port)
http_server.listen(self.listen_port, self.listen_address)
log.info('Starting Tornado server on %s', output)
self.wsgiserver = IOLoop.current()
self.wsgiserver.start()
# wait for stop signal
self.wsgiserver.close(True)
finally:
if self.unix_socket_file:
os.remove(self.unix_socket_file)
self.unix_socket_file = None
def start(self):
try:
if _GEVENT:
# leave subprocess out to allow forking for fetchers and processors
self._start_gevent()
else:
self._start_tornado()
except Exception as ex:
log.error("Error starting server: %s", ex)
print("Error starting server: %s" % ex)
self.stop()
return False
finally:
self.wsgiserver = None
# prevent irritating log of pending tasks message from asyncio
logger.get('asyncio').setLevel(logger.logging.CRITICAL)
if not self.restart:
log.info("Performing shutdown of Calibre-Web")
return True
log.info("Performing restart of Calibre-Web")
args = self._get_args_for_reloading()
os.execv(args[0].lstrip('"').rstrip('"'), args)
return True
@staticmethod
def shutdown_scheduler():
from .services.background_scheduler import BackgroundScheduler
scheduler = BackgroundScheduler()
if scheduler:
scheduler.scheduler.shutdown()
def _killServer(self, __, ___):
self.stop()
def stop(self, restart=False):
from . import updater_thread
updater_thread.stop()
log.info("webserver stop (restart=%s)", restart)
self.shutdown_scheduler()
self.restart = restart
if self.wsgiserver:
if _GEVENT:
self.wsgiserver.close()
else:
if restart:
self.wsgiserver.call_later(1.0, self.wsgiserver.stop)
else:
self.wsgiserver.asyncio_loop.call_soon_threadsafe(self.wsgiserver.stop)
# Start Instance of Server
Server=server()

111
cps/services/Metadata.py Normal file
View File

@ -0,0 +1,111 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import abc
import dataclasses
import os
import re
from typing import Dict, Generator, List, Optional, Union
from cps import constants
@dataclasses.dataclass
class MetaSourceInfo:
id: str
description: str
link: str
@dataclasses.dataclass
class MetaRecord:
id: Union[str, int]
title: str
authors: List[str]
url: str
source: MetaSourceInfo
cover: str = os.path.join(constants.STATIC_DIR, 'generic_cover.jpg')
description: Optional[str] = ""
series: Optional[str] = None
series_index: Optional[Union[int, float]] = 0
identifiers: Dict[str, Union[str, int]] = dataclasses.field(default_factory=dict)
publisher: Optional[str] = None
publishedDate: Optional[str] = None
rating: Optional[int] = 0
languages: Optional[List[str]] = dataclasses.field(default_factory=list)
tags: Optional[List[str]] = dataclasses.field(default_factory=list)
class Metadata:
__name__ = "Generic"
__id__ = "generic"
def __init__(self):
self.active = True
def set_status(self, state):
self.active = state
@abc.abstractmethod
def search(
self, query: str, generic_cover: str = "", locale: str = "en"
) -> Optional[List[MetaRecord]]:
pass
@staticmethod
def get_title_tokens(
title: str, strip_joiners: bool = True
) -> Generator[str, None, None]:
"""
Taken from calibre source code
It's a simplified (cut out what is unnecessary) version of
https://github.com/kovidgoyal/calibre/blob/99d85b97918625d172227c8ffb7e0c71794966c0/
src/calibre/ebooks/metadata/sources/base.py#L363-L367
(src/calibre/ebooks/metadata/sources/base.py - lines 363-398)
"""
title_patterns = [
(re.compile(pat, re.IGNORECASE), repl)
for pat, repl in [
# Remove things like: (2010) (Omnibus) etc.
(
r"(?i)[({\[](\d{4}|omnibus|anthology|hardcover|"
r"audiobook|audio\scd|paperback|turtleback|"
r"mass\s*market|edition|ed\.)[\])}]",
"",
),
# Remove any strings that contain the substring edition inside
# parentheses
(r"(?i)[({\[].*?(edition|ed.).*?[\]})]", ""),
# Remove commas used a separators in numbers
(r"(\d+),(\d+)", r"\1\2"),
# Remove hyphens only if they have whitespace before them
(r"(\s-)", " "),
# Replace other special chars with a space
(r"""[:,;!@$%^&*(){}.`~"\s\[\]/]《》「」“”""", " "),
]
]
for pat, repl in title_patterns:
title = pat.sub(repl, title)
tokens = title.split()
for token in tokens:
token = token.strip().strip('"').strip("'")
if token and (
not strip_joiners or token.lower() not in ("a", "and", "the", "&")
):
yield token

180
cps/services/SyncToken.py Normal file
View File

@ -0,0 +1,180 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 shavitmichael, OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from base64 import b64decode, b64encode
from jsonschema import validate, exceptions
from datetime import datetime
from flask import json
from .. import logger
log = logger.create()
def b64encode_json(json_data):
return b64encode(json.dumps(json_data).encode()).decode("utf-8")
# Python3 has a timestamp() method we could be calling, however it's not available in python2.
def to_epoch_timestamp(datetime_object):
return (datetime_object - datetime(1970, 1, 1)).total_seconds()
def get_datetime_from_json(json_object, field_name):
try:
return datetime.utcfromtimestamp(json_object[field_name])
except (KeyError, OSError, OverflowError):
# OSError is thrown on Windows if timestamp is <1970 or >2038
return datetime.min
class SyncToken:
""" The SyncToken is used to persist state across requests.
When serialized over the response headers, the Kobo device will propagate the token onto following
requests to the service. As an example use-case, the SyncToken is used to detect books that have been added
to the library since the last time the device synced to the server.
Attributes:
books_last_created: Datetime representing the newest book that the device knows about.
books_last_modified: Datetime representing the last modified book that the device knows about.
"""
SYNC_TOKEN_HEADER = "x-kobo-synctoken" # nosec
VERSION = "1-1-0"
LAST_MODIFIED_ADDED_VERSION = "1-1-0"
MIN_VERSION = "1-0-0"
token_schema = {
"type": "object",
"properties": {"version": {"type": "string"}, "data": {"type": "object"}, },
}
# This Schema doesn't contain enough information to detect and propagate book deletions from Calibre to the device.
# A potential solution might be to keep a list of all known book uuids in the token, and look for any missing
# from the db.
data_schema_v1 = {
"type": "object",
"properties": {
"raw_kobo_store_token": {"type": "string"},
"books_last_modified": {"type": "string"},
"books_last_created": {"type": "string"},
"archive_last_modified": {"type": "string"},
"reading_state_last_modified": {"type": "string"},
"tags_last_modified": {"type": "string"}
# "books_last_id": {"type": "integer", "optional": True}
},
}
def __init__(
self,
raw_kobo_store_token="",
books_last_created=datetime.min,
books_last_modified=datetime.min,
archive_last_modified=datetime.min,
reading_state_last_modified=datetime.min,
tags_last_modified=datetime.min
# books_last_id=-1
): # nosec
self.raw_kobo_store_token = raw_kobo_store_token
self.books_last_created = books_last_created
self.books_last_modified = books_last_modified
self.archive_last_modified = archive_last_modified
self.reading_state_last_modified = reading_state_last_modified
self.tags_last_modified = tags_last_modified
# self.books_last_id = books_last_id
@staticmethod
def from_headers(headers):
sync_token_header = headers.get(SyncToken.SYNC_TOKEN_HEADER, "")
if sync_token_header == "": # nosec
return SyncToken()
# On the first sync from a Kobo device, we may receive the SyncToken
# from the official Kobo store. Without digging too deep into it, that
# token is of the form [b64encoded blob].[b64encoded blob 2]
if "." in sync_token_header:
return SyncToken(raw_kobo_store_token=sync_token_header)
try:
sync_token_json = json.loads(
b64decode(sync_token_header + "=" * (-len(sync_token_header) % 4))
)
validate(sync_token_json, SyncToken.token_schema)
if sync_token_json["version"] < SyncToken.MIN_VERSION:
raise ValueError
data_json = sync_token_json["data"]
validate(sync_token_json, SyncToken.data_schema_v1)
except (exceptions.ValidationError, ValueError):
log.error("Sync token contents do not follow the expected json schema.")
return SyncToken()
raw_kobo_store_token = data_json["raw_kobo_store_token"]
try:
books_last_modified = get_datetime_from_json(data_json, "books_last_modified")
books_last_created = get_datetime_from_json(data_json, "books_last_created")
archive_last_modified = get_datetime_from_json(data_json, "archive_last_modified")
reading_state_last_modified = get_datetime_from_json(data_json, "reading_state_last_modified")
tags_last_modified = get_datetime_from_json(data_json, "tags_last_modified")
except TypeError:
log.error("SyncToken timestamps don't parse to a datetime.")
return SyncToken(raw_kobo_store_token=raw_kobo_store_token)
return SyncToken(
raw_kobo_store_token=raw_kobo_store_token,
books_last_created=books_last_created,
books_last_modified=books_last_modified,
archive_last_modified=archive_last_modified,
reading_state_last_modified=reading_state_last_modified,
tags_last_modified=tags_last_modified,
)
def set_kobo_store_header(self, store_headers):
store_headers.set(SyncToken.SYNC_TOKEN_HEADER, self.raw_kobo_store_token)
def merge_from_store_response(self, store_response):
self.raw_kobo_store_token = store_response.headers.get(
SyncToken.SYNC_TOKEN_HEADER, ""
)
def to_headers(self, headers):
headers[SyncToken.SYNC_TOKEN_HEADER] = self.build_sync_token()
def build_sync_token(self):
token = {
"version": SyncToken.VERSION,
"data": {
"raw_kobo_store_token": self.raw_kobo_store_token,
"books_last_modified": to_epoch_timestamp(self.books_last_modified),
"books_last_created": to_epoch_timestamp(self.books_last_created),
"archive_last_modified": to_epoch_timestamp(self.archive_last_modified),
"reading_state_last_modified": to_epoch_timestamp(self.reading_state_last_modified),
"tags_last_modified": to_epoch_timestamp(self.tags_last_modified),
},
}
return b64encode_json(token)
def __str__(self):
return "{},{},{},{},{},{}".format(self.books_last_created,
self.books_last_modified,
self.archive_last_modified,
self.reading_state_last_modified,
self.tags_last_modified,
self.raw_kobo_store_token)

50
cps/services/__init__.py Normal file
View File

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2019 pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import logger
log = logger.create()
try:
from . import goodreads_support
except ImportError as err:
log.debug("Cannot import goodreads, showing authors-metadata will not work: %s", err)
goodreads_support = None
try:
from . import simpleldap as ldap
from .simpleldap import ldapVersion
except ImportError as err:
log.debug("Cannot import simpleldap, logging in with ldap will not work: %s", err)
ldap = None
ldapVersion = None
try:
from . import SyncToken as SyncToken
kobo = True
except ImportError as err:
log.debug("Cannot import SyncToken, syncing books with Kobo Devices will not work: %s", err)
kobo = None
SyncToken = None
try:
from . import gmail
except ImportError as err:
log.debug("Cannot import gmail, sending books via Gmail Oauth2 Verification will not work: %s", err)
gmail = None

View File

@ -0,0 +1,84 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2020 mmonkey
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import atexit
from .. import logger
from .worker import WorkerThread
try:
from apscheduler.schedulers.background import BackgroundScheduler as BScheduler
from apscheduler.triggers.cron import CronTrigger
from apscheduler.triggers.date import DateTrigger
use_APScheduler = True
except (ImportError, RuntimeError) as e:
use_APScheduler = False
log = logger.create()
log.info('APScheduler not found. Unable to schedule tasks.')
class BackgroundScheduler:
_instance = None
def __new__(cls):
if not use_APScheduler:
return False
if cls._instance is None:
cls._instance = super(BackgroundScheduler, cls).__new__(cls)
cls.log = logger.create()
cls.scheduler = BScheduler()
cls.scheduler.start()
return cls._instance
def schedule(self, func, trigger, name=None):
if use_APScheduler:
return self.scheduler.add_job(func=func, trigger=trigger, name=name)
# Expects a lambda expression for the task
def schedule_task(self, task, user=None, name=None, hidden=False, trigger=None):
if use_APScheduler:
def scheduled_task():
worker_task = task()
worker_task.scheduled = True
WorkerThread.add(user, worker_task, hidden=hidden)
return self.schedule(func=scheduled_task, trigger=trigger, name=name)
# Expects a list of lambda expressions for the tasks
def schedule_tasks(self, tasks, user=None, trigger=None):
if use_APScheduler:
for task in tasks:
self.schedule_task(task[0], user=user, trigger=trigger, name=task[1], hidden=task[2])
# Expects a lambda expression for the task
def schedule_task_immediately(self, task, user=None, name=None, hidden=False):
if use_APScheduler:
def immediate_task():
WorkerThread.add(user, task(), hidden)
return self.schedule(func=immediate_task, trigger=DateTrigger(), name=name)
# Expects a list of lambda expressions for the tasks
def schedule_tasks_immediately(self, tasks, user=None):
if use_APScheduler:
for task in tasks:
self.schedule_task_immediately(task[0], user, name="immediately " + task[1], hidden=task[2])
# Remove all jobs
def remove_all_jobs(self):
self.scheduler.remove_all_jobs()

100
cps/services/gmail.py Normal file
View File

@ -0,0 +1,100 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2021 OzzieIsaacs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os.path
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
from datetime import datetime
import base64
from flask_babel import gettext as _
from ..constants import CONFIG_DIR
from .. import logger
log = logger.create()
SCOPES = ['openid', 'https://www.googleapis.com/auth/gmail.send', 'https://www.googleapis.com/auth/userinfo.email']
def setup_gmail(token):
# If there are no (valid) credentials available, let the user log in.
creds = None
if "token" in token:
creds = Credentials(
token=token['token'],
refresh_token=token['refresh_token'],
token_uri=token['token_uri'],
client_id=token['client_id'],
client_secret=token['client_secret'],
scopes=token['scopes'],
)
creds.expiry = datetime.fromisoformat(token['expiry'])
if not creds or not creds.valid:
# don't forget to dump one more time after the refresh
# also, some file-locking routines wouldn't be needless
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
cred_file = os.path.join(CONFIG_DIR, 'gmail.json')
if not os.path.exists(cred_file):
raise Exception(_("Found no valid gmail.json file with OAuth information"))
flow = InstalledAppFlow.from_client_secrets_file(
os.path.join(CONFIG_DIR, 'gmail.json'), SCOPES)
creds = flow.run_local_server(port=0)
user_info = get_user_info(creds)
return {
'token': creds.token,
'refresh_token': creds.refresh_token,
'token_uri': creds.token_uri,
'client_id': creds.client_id,
'client_secret': creds.client_secret,
'scopes': creds.scopes,
'expiry': creds.expiry.isoformat(),
'email': user_info
}
return {}
def get_user_info(credentials):
user_info_service = build(serviceName='oauth2', version='v2',credentials=credentials)
user_info = user_info_service.userinfo().get().execute()
return user_info.get('email', "")
def send_messsage(token, msg):
log.debug("Start sending e-mail via Gmail")
creds = Credentials(
token=token['token'],
refresh_token=token['refresh_token'],
token_uri=token['token_uri'],
client_id=token['client_id'],
client_secret=token['client_secret'],
scopes=token['scopes'],
)
creds.expiry = datetime.fromisoformat(token['expiry'])
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
service = build('gmail', 'v1', credentials=creds)
message_as_bytes = msg.as_bytes() # the message should converted from string to bytes.
message_as_base64 = base64.urlsafe_b64encode(message_as_bytes) # encode in base64 (printable letters coding)
raw = message_as_base64.decode() # convert to something JSON serializable
body = {'raw': raw}
(service.users().messages().send(userId='me', body=body).execute())
log.debug("E-mail send successfully via Gmail")

View File

@ -0,0 +1,146 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import time
from functools import reduce
import requests
from goodreads.client import GoodreadsClient
from goodreads.request import GoodreadsRequest
import xmltodict
try:
import Levenshtein
except ImportError:
Levenshtein = False
from .. import logger
from ..clean_html import clean_string
class my_GoodreadsClient(GoodreadsClient):
def request(self, *args, **kwargs):
"""Create a GoodreadsRequest object and make that request"""
req = my_GoodreadsRequest(self, *args, **kwargs)
return req.request()
class GoodreadsRequestException(Exception):
def __init__(self, error_msg, url):
self.error_msg = error_msg
self.url = url
def __str__(self):
return self.url, ':', self.error_msg
class my_GoodreadsRequest(GoodreadsRequest):
def request(self):
resp = requests.get(self.host+self.path, params=self.params,
headers={"User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:125.0) "
"Gecko/20100101 Firefox/125.0"})
if resp.status_code != 200:
raise GoodreadsRequestException(resp.reason, self.path)
if self.req_format == 'xml':
data_dict = xmltodict.parse(resp.content)
return data_dict['GoodreadsResponse']
else:
raise Exception("Invalid format")
log = logger.create()
_client = None # type: GoodreadsClient
# GoodReads TOS allows for 24h caching of data
_CACHE_TIMEOUT = 23 * 60 * 60 # 23 hours (in seconds)
_AUTHORS_CACHE = {}
def connect(key=None, enabled=True):
global _client
if not enabled or not key:
_client = None
return
if _client:
# make sure the configuration has not changed since last we used the client
if _client.client_key != key:
_client = None
if not _client:
_client = my_GoodreadsClient(key, None)
def get_author_info(author_name):
now = time.time()
author_info = _AUTHORS_CACHE.get(author_name, None)
if author_info:
if now < author_info._timestamp + _CACHE_TIMEOUT:
return author_info
# clear expired entries
del _AUTHORS_CACHE[author_name]
if not _client:
log.warning("failed to get a Goodreads client")
return
try:
author_info = _client.find_author(author_name=author_name)
except Exception as ex:
# Skip goodreads, if site is down/inaccessible
log.warning('Goodreads website is down/inaccessible? %s', ex.__str__())
return
if author_info:
author_info._timestamp = now
author_info.safe_about = clean_string(author_info.about)
_AUTHORS_CACHE[author_name] = author_info
return author_info
def get_other_books(author_info, library_books=None):
# Get all identifiers (ISBN, Goodreads, etc) and filter author's books by that list so we show fewer duplicates
# Note: Not all images will be shown, even though they're available on Goodreads.com.
# See https://www.goodreads.com/topic/show/18213769-goodreads-book-images
if not author_info:
return
identifiers = []
library_titles = []
if library_books:
identifiers = list(reduce(lambda acc, book: acc + [i.val for i in book.identifiers if i.val], library_books, []))
library_titles = [book.title for book in library_books]
for book in author_info.books:
if book.isbn in identifiers:
continue
if isinstance(book.gid, int):
if book.gid in identifiers:
continue
else:
if book.gid["#text"] in identifiers:
continue
if Levenshtein and library_titles:
goodreads_title = book._book_dict['title_without_series']
if any(Levenshtein.ratio(goodreads_title, title) > 0.7 for title in library_titles):
continue
yield book

167
cps/services/simpleldap.py Normal file
View File

@ -0,0 +1,167 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import base64
from flask_simpleldap import LDAP, LDAPException
from flask_simpleldap import ldap as pyLDAP
from flask import current_app
from .. import constants, logger
try:
from ldap.pkginfo import __version__ as ldapVersion
except ImportError:
pass
log = logger.create()
class LDAPLogger(object):
def write(self, message):
try:
log.debug(message.strip("\n").replace("\n", ""))
except Exception:
log.debug("Logging Error")
class mySimpleLDap(LDAP):
@staticmethod
def init_app(app):
super(mySimpleLDap, mySimpleLDap).init_app(app)
app.config.setdefault('LDAP_LOGLEVEL', 0)
@property
def initialize(self):
"""Initialize a connection to the LDAP server.
:return: LDAP connection object.
"""
try:
log_level = 2 if current_app.config['LDAP_LOGLEVEL'] == logger.logging.DEBUG else 0
conn = pyLDAP.initialize('{0}://{1}:{2}'.format(
current_app.config['LDAP_SCHEMA'],
current_app.config['LDAP_HOST'],
current_app.config['LDAP_PORT']), trace_level=log_level, trace_file=LDAPLogger())
conn.set_option(pyLDAP.OPT_NETWORK_TIMEOUT,
current_app.config['LDAP_TIMEOUT'])
conn = self._set_custom_options(conn)
conn.protocol_version = pyLDAP.VERSION3
if current_app.config['LDAP_USE_TLS']:
conn.start_tls_s()
return conn
except pyLDAP.LDAPError as e:
raise LDAPException(self.error(e.args))
_ldap = mySimpleLDap()
def init_app(app, config):
if config.config_login_type != constants.LOGIN_LDAP:
return
app.config['LDAP_HOST'] = config.config_ldap_provider_url
app.config['LDAP_PORT'] = config.config_ldap_port
app.config['LDAP_CUSTOM_OPTIONS'] = {pyLDAP.OPT_REFERRALS: 0}
if config.config_ldap_encryption == 2:
app.config['LDAP_SCHEMA'] = 'ldaps'
else:
app.config['LDAP_SCHEMA'] = 'ldap'
if config.config_ldap_authentication > constants.LDAP_AUTH_ANONYMOUS:
if config.config_ldap_authentication > constants.LDAP_AUTH_UNAUTHENTICATE:
if config.config_ldap_serv_password_e is None:
config.config_ldap_serv_password_e = ''
app.config['LDAP_PASSWORD'] = config.config_ldap_serv_password_e
else:
app.config['LDAP_PASSWORD'] = ""
app.config['LDAP_USERNAME'] = config.config_ldap_serv_username
else:
app.config['LDAP_USERNAME'] = ""
app.config['LDAP_PASSWORD'] = ""
if bool(config.config_ldap_cert_path):
app.config['LDAP_CUSTOM_OPTIONS'].update({
pyLDAP.OPT_X_TLS_REQUIRE_CERT: pyLDAP.OPT_X_TLS_DEMAND,
pyLDAP.OPT_X_TLS_CACERTFILE: config.config_ldap_cacert_path,
pyLDAP.OPT_X_TLS_CERTFILE: config.config_ldap_cert_path,
pyLDAP.OPT_X_TLS_KEYFILE: config.config_ldap_key_path,
pyLDAP.OPT_X_TLS_NEWCTX: 0
})
app.config['LDAP_BASE_DN'] = config.config_ldap_dn
app.config['LDAP_USER_OBJECT_FILTER'] = config.config_ldap_user_object
app.config['LDAP_USE_TLS'] = bool(config.config_ldap_encryption == 1)
app.config['LDAP_USE_SSL'] = bool(config.config_ldap_encryption == 2)
app.config['LDAP_OPENLDAP'] = bool(config.config_ldap_openldap)
app.config['LDAP_GROUP_OBJECT_FILTER'] = config.config_ldap_group_object_filter
app.config['LDAP_GROUP_MEMBERS_FIELD'] = config.config_ldap_group_members_field
app.config['LDAP_LOGLEVEL'] = config.config_log_level
try:
_ldap.init_app(app)
except ValueError:
if bool(config.config_ldap_cert_path):
app.config['LDAP_CUSTOM_OPTIONS'].pop(pyLDAP.OPT_X_TLS_NEWCTX)
try:
_ldap.init_app(app)
except RuntimeError as e:
log.error(e)
except RuntimeError as e:
log.error(e)
def get_object_details(user=None,query_filter=None):
return _ldap.get_object_details(user, query_filter=query_filter)
def bind():
return _ldap.bind()
def get_group_members(group):
return _ldap.get_group_members(group)
def basic_auth_required(func):
return _ldap.basic_auth_required(func)
def bind_user(username, password):
'''Attempts a LDAP login.
:returns: True if login succeeded, False if login failed, None if server unavailable.
'''
try:
if _ldap.get_object_details(username):
result = _ldap.bind_user(username, password)
log.debug("LDAP login '%s': %r", username, result)
return result is not None, None
return None, None # User not found
except (TypeError, AttributeError, KeyError) as ex:
error = ("LDAP bind_user: %s" % ex)
return None, error
except LDAPException as ex:
if ex.message == 'Invalid credentials':
error = "LDAP admin login failed"
return None, error
if ex.message == "Can't contact LDAP server":
# log.warning('LDAP Server down: %s', ex)
error = ('LDAP Server down: %s' % ex)
return None, error
else:
error = ('LDAP Server error: %s' % ex.message)
return None, error

271
cps/services/worker.py Normal file
View File

@ -0,0 +1,271 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2020 pwr
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import threading
import abc
import uuid
import time
try:
import queue
except ImportError:
import Queue as queue
from datetime import datetime
from collections import namedtuple
from cps import logger
log = logger.create()
# task 'status' consts
STAT_WAITING = 0
STAT_FAIL = 1
STAT_STARTED = 2
STAT_FINISH_SUCCESS = 3
STAT_ENDED = 4
STAT_CANCELLED = 5
# Only retain this many tasks in dequeued list
TASK_CLEANUP_TRIGGER = 20
QueuedTask = namedtuple('QueuedTask', 'num, user, added, task, hidden')
def _get_main_thread():
for t in threading.enumerate():
if t.__class__.__name__ == '_MainThread':
return t
raise Exception("main thread not found?!")
class ImprovedQueue(queue.Queue):
def to_list(self):
"""
Returns a copy of all items in the queue without removing them.
"""
with self.mutex:
return list(self.queue)
# Class for all worker tasks in the background
class WorkerThread(threading.Thread):
_instance = None
@classmethod
def get_instance(cls):
if cls._instance is None:
cls._instance = WorkerThread()
return cls._instance
def __init__(self):
threading.Thread.__init__(self)
self.dequeued = list()
self.doLock = threading.Lock()
self.queue = ImprovedQueue()
self.num = 0
self.start()
@classmethod
def add(cls, user, task, hidden=False):
ins = cls.get_instance()
ins.num += 1
username = user if user is not None else 'System'
log.debug("Add Task for user: {} - {}".format(username, task))
ins.queue.put(QueuedTask(
num=ins.num,
user=username,
added=datetime.now(),
task=task,
hidden=hidden
))
@property
def tasks(self):
with self.doLock:
tasks = self.queue.to_list() + self.dequeued
return sorted(tasks, key=lambda x: x.num)
def cleanup_tasks(self):
with self.doLock:
dead = []
alive = []
for x in self.dequeued:
(dead if x.task.dead else alive).append(x)
# if the ones that we need to keep are within the trigger, do nothing else
delta = len(self.dequeued) - len(dead)
if delta > TASK_CLEANUP_TRIGGER:
ret = alive
else:
# otherwise, loop off the oldest dead tasks until we hit the target trigger
ret = sorted(dead, key=lambda y: y.task.end_time)[-TASK_CLEANUP_TRIGGER:] + alive
self.dequeued = sorted(ret, key=lambda y: y.num)
# Main thread loop starting the different tasks
def run(self):
main_thread = _get_main_thread()
while main_thread.is_alive():
try:
# this blocks until something is available. This can cause issues when the main thread dies - this
# thread will remain alive. We implement a timeout to unblock every second which allows us to check if
# the main thread is still alive.
# We don't use a daemon here because we don't want the tasks to just be abruptly halted, leading to
# possible file / database corruption
item = self.queue.get(timeout=1)
except queue.Empty:
time.sleep(1)
continue
with self.doLock:
# add to list so that in-progress tasks show up
self.dequeued.append(item)
# once we hit our trigger, start cleaning up dead tasks
if len(self.dequeued) > TASK_CLEANUP_TRIGGER:
self.cleanup_tasks()
# sometimes tasks (like Upload) don't actually have work to do and are created as already finished
if item.task.stat is STAT_WAITING:
# CalibreTask.start() should wrap all exceptions in its own error handling
item.task.start(self)
# remove self_cleanup tasks and hidden "System Tasks" from list
if item.task.self_cleanup or item.hidden:
self.dequeued.remove(item)
self.queue.task_done()
def end_task(self, task_id):
ins = self.get_instance()
for __, __, __, task, __ in ins.tasks:
if str(task.id) == str(task_id) and task.is_cancellable:
task.stat = STAT_CANCELLED if task.stat == STAT_WAITING else STAT_ENDED
class CalibreTask:
__metaclass__ = abc.ABCMeta
def __init__(self, message):
self._progress = 0
self.stat = STAT_WAITING
self.error = None
self.start_time = None
self.end_time = None
self.message = message
self.id = uuid.uuid4()
self.self_cleanup = False
self._scheduled = False
@abc.abstractmethod
def run(self, worker_thread):
"""The main entry-point for this task"""
raise NotImplementedError
@abc.abstractmethod
def name(self):
"""Provides the caller some human-readable name for this class"""
raise NotImplementedError
@abc.abstractmethod
def is_cancellable(self):
"""Does this task gracefully handle being cancelled (STAT_ENDED, STAT_CANCELLED)?"""
raise NotImplementedError
def start(self, *args):
self.start_time = datetime.now()
self.stat = STAT_STARTED
# catch any unhandled exceptions in a task and automatically fail it
try:
self.run(*args)
except Exception as ex:
self._handleError(str(ex))
log.error_or_exception(ex)
self.end_time = datetime.now()
@property
def stat(self):
return self._stat
@stat.setter
def stat(self, x):
self._stat = x
@property
def progress(self):
return self._progress
@progress.setter
def progress(self, x):
if not 0 <= x <= 1:
raise ValueError("Task progress should within [0, 1] range")
self._progress = x
@property
def error(self):
return self._error
@error.setter
def error(self, x):
self._error = x
@property
def runtime(self):
return (self.end_time or datetime.now()) - self.start_time
@property
def dead(self):
"""Determines whether or not this task can be garbage collected
We have a separate dictating this because there may be certain tasks that want to override this
"""
# By default, we're good to clean a task if it's "Done"
return self.stat in (STAT_FINISH_SUCCESS, STAT_FAIL, STAT_ENDED, STAT_CANCELLED)
@property
def self_cleanup(self):
return self._self_cleanup
@self_cleanup.setter
def self_cleanup(self, is_self_cleanup):
self._self_cleanup = is_self_cleanup
@property
def scheduled(self):
return self._scheduled
@scheduled.setter
def scheduled(self, is_scheduled):
self._scheduled = is_scheduled
def _handleError(self, error_message):
self.stat = STAT_FAIL
self.progress = 1
self.error = error_message
def _handleSuccess(self):
self.stat = STAT_FINISH_SUCCESS
self.progress = 1
def __str__(self):
return self.name

478
cps/shelf.py Normal file
View File

@ -0,0 +1,478 @@
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitko, ytils, xybydy, trasba, vrabe,
# ruben-herold, marblepebble, JackED42, SiphonSquirrel,
# apetresc, nanu-c, mutschler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
from datetime import datetime
from flask import Blueprint, flash, redirect, request, url_for, abort
from flask_babel import gettext as _
from flask_login import current_user, login_required
from sqlalchemy.exc import InvalidRequestError, OperationalError
from sqlalchemy.sql.expression import func, true
from . import calibre_db, config, db, logger, ub
from .render_template import render_title_template
from .usermanagement import login_required_if_no_ano
log = logger.create()
shelf = Blueprint('shelf', __name__)
@shelf.route("/shelf/add/<int:shelf_id>/<int:book_id>", methods=["POST"])
@login_required
def add_to_shelf(shelf_id, book_id):
xhr = request.headers.get('X-Requested-With') == 'XMLHttpRequest'
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf is None:
log.error("Invalid shelf specified: %s", shelf_id)
if not xhr:
flash(_("Invalid shelf specified"), category="error")
return redirect(url_for('web.index'))
return "Invalid shelf specified", 400
if not check_shelf_edit_permissions(shelf):
if not xhr:
flash(_("Sorry you are not allowed to add a book to that shelf"), category="error")
return redirect(url_for('web.index'))
return "Sorry you are not allowed to add a book to the that shelf", 403
book_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id,
ub.BookShelf.book_id == book_id).first()
if book_in_shelf:
log.error("Book %s is already part of %s", book_id, shelf)
if not xhr:
flash(_("Book is already part of the shelf: %(shelfname)s", shelfname=shelf.name), category="error")
return redirect(url_for('web.index'))
return "Book is already part of the shelf: %s" % shelf.name, 400
maxOrder = ub.session.query(func.max(ub.BookShelf.order)).filter(ub.BookShelf.shelf == shelf_id).first()
if maxOrder[0] is None:
maxOrder = 0
else:
maxOrder = maxOrder[0]
if not calibre_db.session.query(db.Books).filter(db.Books.id == book_id).one_or_none():
log.error("Invalid Book Id: %s. Could not be added to shelf %s", book_id, shelf.name)
if not xhr:
flash(_("%(book_id)s is a invalid Book Id. Could not be added to Shelf", book_id=book_id),
category="error")
return redirect(url_for('web.index'))
return "%s is a invalid Book Id. Could not be added to Shelf" % book_id, 400
shelf.books.append(ub.BookShelf(shelf=shelf.id, book_id=book_id, order=maxOrder + 1))
shelf.last_modified = datetime.utcnow()
try:
ub.session.merge(shelf)
ub.session.commit()
except (OperationalError, InvalidRequestError) as e:
ub.session.rollback()
log.error_or_exception("Settings Database error: {}".format(e))
flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error")
if "HTTP_REFERER" in request.environ:
return redirect(request.environ["HTTP_REFERER"])
else:
return redirect(url_for('web.index'))
if not xhr:
log.debug("Book has been added to shelf: {}".format(shelf.name))
flash(_("Book has been added to shelf: %(sname)s", sname=shelf.name), category="success")
if "HTTP_REFERER" in request.environ:
return redirect(request.environ["HTTP_REFERER"])
else:
return redirect(url_for('web.index'))
return "", 204
@shelf.route("/shelf/massadd/<int:shelf_id>", methods=["POST"])
@login_required
def search_to_shelf(shelf_id):
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf is None:
log.error("Invalid shelf specified: {}".format(shelf_id))
flash(_("Invalid shelf specified"), category="error")
return redirect(url_for('web.index'))
if not check_shelf_edit_permissions(shelf):
log.warning("You are not allowed to add a book to the shelf".format(shelf.name))
flash(_("You are not allowed to add a book to the shelf"), category="error")
return redirect(url_for('web.index'))
if current_user.id in ub.searched_ids and ub.searched_ids[current_user.id]:
books_for_shelf = list()
books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id).all()
if books_in_shelf:
book_ids = list()
for book_id in books_in_shelf:
book_ids.append(book_id.book_id)
for searchid in ub.searched_ids[current_user.id]:
if searchid not in book_ids:
books_for_shelf.append(searchid)
else:
books_for_shelf = ub.searched_ids[current_user.id]
if not books_for_shelf:
log.error("Books are already part of {}".format(shelf.name))
flash(_("Books are already part of the shelf: %(name)s", name=shelf.name), category="error")
return redirect(url_for('web.index'))
maxOrder = ub.session.query(func.max(ub.BookShelf.order)).filter(ub.BookShelf.shelf == shelf_id).first()[0] or 0
for book in books_for_shelf:
maxOrder += 1
shelf.books.append(ub.BookShelf(shelf=shelf.id, book_id=book, order=maxOrder))
shelf.last_modified = datetime.utcnow()
try:
ub.session.merge(shelf)
ub.session.commit()
flash(_("Books have been added to shelf: %(sname)s", sname=shelf.name), category="success")
except (OperationalError, InvalidRequestError) as e:
ub.session.rollback()
log.error_or_exception("Settings Database error: {}".format(e))
flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error")
else:
log.error("Could not add books to shelf: {}".format(shelf.name))
flash(_("Could not add books to shelf: %(sname)s", sname=shelf.name), category="error")
return redirect(url_for('web.index'))
@shelf.route("/shelf/remove/<int:shelf_id>/<int:book_id>", methods=["POST"])
@login_required
def remove_from_shelf(shelf_id, book_id):
xhr = request.headers.get('X-Requested-With') == 'XMLHttpRequest'
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf is None:
log.error("Invalid shelf specified: {}".format(shelf_id))
if not xhr:
return redirect(url_for('web.index'))
return "Invalid shelf specified", 400
# if shelf is public and use is allowed to edit shelfs, or if shelf is private and user is owner
# allow editing shelfs
# result shelf public user allowed user owner
# false 1 0 x
# true 1 1 x
# true 0 x 1
# false 0 x 0
if check_shelf_edit_permissions(shelf):
book_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id,
ub.BookShelf.book_id == book_id).first()
if book_shelf is None:
log.error("Book %s already removed from %s", book_id, shelf)
if not xhr:
return redirect(url_for('web.index'))
return "Book already removed from shelf", 410
try:
ub.session.delete(book_shelf)
shelf.last_modified = datetime.utcnow()
ub.session.commit()
except (OperationalError, InvalidRequestError) as e:
ub.session.rollback()
log.error_or_exception("Settings Database error: {}".format(e))
flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error")
if "HTTP_REFERER" in request.environ:
return redirect(request.environ["HTTP_REFERER"])
else:
return redirect(url_for('web.index'))
if not xhr:
flash(_("Book has been removed from shelf: %(sname)s", sname=shelf.name), category="success")
if "HTTP_REFERER" in request.environ:
return redirect(request.environ["HTTP_REFERER"])
else:
return redirect(url_for('web.index'))
return "", 204
else:
if not xhr:
log.warning("You are not allowed to remove a book from shelf: {}".format(shelf.name))
flash(_("Sorry you are not allowed to remove a book from this shelf"),
category="error")
return redirect(url_for('web.index'))
return "Sorry you are not allowed to remove a book from this shelf", 403
@shelf.route("/shelf/create", methods=["GET", "POST"])
@login_required
def create_shelf():
shelf = ub.Shelf()
return create_edit_shelf(shelf, page_title=_("Create a Shelf"), page="shelfcreate")
@shelf.route("/shelf/edit/<int:shelf_id>", methods=["GET", "POST"])
@login_required
def edit_shelf(shelf_id):
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if not check_shelf_edit_permissions(shelf):
flash(_("Sorry you are not allowed to edit this shelf"), category="error")
return redirect(url_for('web.index'))
return create_edit_shelf(shelf, page_title=_("Edit a shelf"), page="shelfedit", shelf_id=shelf_id)
@shelf.route("/shelf/delete/<int:shelf_id>", methods=["POST"])
@login_required
def delete_shelf(shelf_id):
cur_shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
try:
if not delete_shelf_helper(cur_shelf):
flash(_("Error deleting Shelf"), category="error")
else:
flash(_("Shelf successfully deleted"), category="success")
except InvalidRequestError as e:
ub.session.rollback()
log.error_or_exception("Settings Database error: {}".format(e))
flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error")
return redirect(url_for('web.index'))
@shelf.route("/simpleshelf/<int:shelf_id>")
@login_required_if_no_ano
def show_simpleshelf(shelf_id):
return render_show_shelf(2, shelf_id, 1, None)
@shelf.route("/shelf/<int:shelf_id>", defaults={"sort_param": "order", 'page': 1})
@shelf.route("/shelf/<int:shelf_id>/<sort_param>", defaults={'page': 1})
@shelf.route("/shelf/<int:shelf_id>/<sort_param>/<int:page>")
@login_required_if_no_ano
def show_shelf(shelf_id, sort_param, page):
return render_show_shelf(1, shelf_id, page, sort_param)
@shelf.route("/shelf/order/<int:shelf_id>", methods=["GET", "POST"])
@login_required
def order_shelf(shelf_id):
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf and check_shelf_view_permissions(shelf):
if request.method == "POST":
to_save = request.form.to_dict()
books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id).order_by(
ub.BookShelf.order.asc()).all()
counter = 0
for book in books_in_shelf:
setattr(book, 'order', to_save[str(book.book_id)])
counter += 1
# if order different from before -> shelf.last_modified = datetime.utcnow()
try:
ub.session.commit()
except (OperationalError, InvalidRequestError) as e:
ub.session.rollback()
log.error_or_exception("Settings Database error: {}".format(e))
flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error")
result = list()
if shelf:
result = calibre_db.session.query(db.Books) \
.join(ub.BookShelf, ub.BookShelf.book_id == db.Books.id, isouter=True) \
.add_columns(calibre_db.common_filters().label("visible")) \
.filter(ub.BookShelf.shelf == shelf_id).order_by(ub.BookShelf.order.asc()).all()
return render_title_template('shelf_order.html', entries=result,
title=_("Change order of Shelf: '%(name)s'", name=shelf.name),
shelf=shelf, page="shelforder")
else:
abort(404)
def check_shelf_edit_permissions(cur_shelf):
if not cur_shelf.is_public and not cur_shelf.user_id == int(current_user.id):
log.error("User {} not allowed to edit shelf: {}".format(current_user.id, cur_shelf.name))
return False
if cur_shelf.is_public and not current_user.role_edit_shelfs():
log.info("User {} not allowed to edit public shelves".format(current_user.id))
return False
return True
def check_shelf_view_permissions(cur_shelf):
try:
if cur_shelf.is_public:
return True
if current_user.is_anonymous or cur_shelf.user_id != current_user.id:
log.error("User is unauthorized to view non-public shelf: {}".format(cur_shelf.name))
return False
except Exception as e:
log.error(e)
return True
# if shelf ID is set, we are editing a shelf
def create_edit_shelf(shelf, page_title, page, shelf_id=False):
sync_only_selected_shelves = current_user.kobo_only_shelves_sync
# calibre_db.session.query(ub.Shelf).filter(ub.Shelf.user_id == current_user.id).filter(ub.Shelf.kobo_sync).count()
if request.method == "POST":
to_save = request.form.to_dict()
if not current_user.role_edit_shelfs() and to_save.get("is_public") == "on":
flash(_("Sorry you are not allowed to create a public shelf"), category="error")
return redirect(url_for('web.index'))
is_public = 1 if to_save.get("is_public") == "on" else 0
if config.config_kobo_sync:
shelf.kobo_sync = True if to_save.get("kobo_sync") else False
if shelf.kobo_sync:
ub.session.query(ub.ShelfArchive).filter(ub.ShelfArchive.user_id == current_user.id).filter(
ub.ShelfArchive.uuid == shelf.uuid).delete()
ub.session_commit()
shelf_title = to_save.get("title", "")
if check_shelf_is_unique(shelf_title, is_public, shelf_id):
shelf.name = shelf_title
shelf.is_public = is_public
if not shelf_id:
shelf.user_id = int(current_user.id)
ub.session.add(shelf)
shelf_action = "created"
flash_text = _("Shelf %(title)s created", title=shelf_title)
else:
shelf_action = "changed"
flash_text = _("Shelf %(title)s changed", title=shelf_title)
try:
ub.session.commit()
log.info("Shelf {} {}".format(shelf_title, shelf_action))
flash(flash_text, category="success")
return redirect(url_for('shelf.show_shelf', shelf_id=shelf.id))
except (OperationalError, InvalidRequestError) as ex:
ub.session.rollback()
log.error_or_exception(ex)
log.error_or_exception("Settings Database error: {}".format(ex))
flash(_("Oops! Database Error: %(error)s.", error=ex.orig), category="error")
except Exception as ex:
ub.session.rollback()
log.error_or_exception(ex)
flash(_("There was an error"), category="error")
return render_title_template('shelf_edit.html',
shelf=shelf,
title=page_title,
page=page,
kobo_sync_enabled=config.config_kobo_sync,
sync_only_selected_shelves=sync_only_selected_shelves)
def check_shelf_is_unique(title, is_public, shelf_id=False):
if shelf_id:
ident = ub.Shelf.id != shelf_id
else:
ident = true()
if is_public == 1:
is_shelf_name_unique = ub.session.query(ub.Shelf) \
.filter((ub.Shelf.name == title) & (ub.Shelf.is_public == 1)) \
.filter(ident) \
.first() is None
if not is_shelf_name_unique:
log.error("A public shelf with the name '{}' already exists.".format(title))
flash(_("A public shelf with the name '%(title)s' already exists.", title=title),
category="error")
else:
is_shelf_name_unique = ub.session.query(ub.Shelf) \
.filter((ub.Shelf.name == title) & (ub.Shelf.is_public == 0) &
(ub.Shelf.user_id == int(current_user.id))) \
.filter(ident) \
.first() is None
if not is_shelf_name_unique:
log.error("A private shelf with the name '{}' already exists.".format(title))
flash(_("A private shelf with the name '%(title)s' already exists.", title=title),
category="error")
return is_shelf_name_unique
def delete_shelf_helper(cur_shelf):
if not cur_shelf or not check_shelf_edit_permissions(cur_shelf):
return False
shelf_id = cur_shelf.id
ub.session.delete(cur_shelf)
ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id).delete()
ub.session.add(ub.ShelfArchive(uuid=cur_shelf.uuid, user_id=cur_shelf.user_id))
ub.session_commit("successfully deleted Shelf {}".format(cur_shelf.name))
return True
def change_shelf_order(shelf_id, order):
result = calibre_db.session.query(db.Books).outerjoin(db.books_series_link,
db.Books.id == db.books_series_link.c.book)\
.outerjoin(db.Series).join(ub.BookShelf, ub.BookShelf.book_id == db.Books.id) \
.filter(ub.BookShelf.shelf == shelf_id).order_by(*order).all()
for index, entry in enumerate(result):
book = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id) \
.filter(ub.BookShelf.book_id == entry.id).first()
book.order = index
ub.session_commit("Shelf-id:{} - Order changed".format(shelf_id))
def render_show_shelf(shelf_type, shelf_id, page_no, sort_param):
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
# check user is allowed to access shelf
if shelf and check_shelf_view_permissions(shelf):
if shelf_type == 1:
# order = [ub.BookShelf.order.asc()]
if sort_param == 'pubnew':
change_shelf_order(shelf_id, [db.Books.pubdate.desc()])
if sort_param == 'pubold':
change_shelf_order(shelf_id, [db.Books.pubdate])
if sort_param == 'abc':
change_shelf_order(shelf_id, [db.Books.sort])
if sort_param == 'zyx':
change_shelf_order(shelf_id, [db.Books.sort.desc()])
if sort_param == 'new':
change_shelf_order(shelf_id, [db.Books.timestamp.desc()])
if sort_param == 'old':
change_shelf_order(shelf_id, [db.Books.timestamp])
if sort_param == 'authaz':
change_shelf_order(shelf_id, [db.Books.author_sort.asc(), db.Series.name, db.Books.series_index])
if sort_param == 'authza':
change_shelf_order(shelf_id, [db.Books.author_sort.desc(),
db.Series.name.desc(),
db.Books.series_index.desc()])
page = "shelf.html"
pagesize = 0
else:
pagesize = sys.maxsize
page = 'shelfdown.html'
result, __, pagination = calibre_db.fill_indexpage(page_no, pagesize,
db.Books,
ub.BookShelf.shelf == shelf_id,
[ub.BookShelf.order.asc()],
True, config.config_read_column,
ub.BookShelf, ub.BookShelf.book_id == db.Books.id)
# delete chelf entries where book is not existent anymore, can happen if book is deleted outside calibre-web
wrong_entries = calibre_db.session.query(ub.BookShelf) \
.join(db.Books, ub.BookShelf.book_id == db.Books.id, isouter=True) \
.filter(db.Books.id == None).all()
for entry in wrong_entries:
log.info('Not existing book {} in {} deleted'.format(entry.book_id, shelf))
try:
ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == entry.book_id).delete()
ub.session.commit()
except (OperationalError, InvalidRequestError) as e:
ub.session.rollback()
log.error_or_exception("Settings Database error: {}".format(e))
flash(_("Oops! Database Error: %(error)s.", error=e.orig), category="error")
return render_title_template(page,
entries=result,
pagination=pagination,
title=_("Shelf: '%(name)s'", name=shelf.name),
shelf=shelf,
page="shelf")
else:
flash(_("Error opening shelf. Shelf does not exist or is not accessible"), category="error")
return redirect(url_for("web.index"))

Binary file not shown.

Binary file not shown.

BIN
cps/static/cmaps/78-H.bcmap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
cps/static/cmaps/78-V.bcmap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More