From 285979b68d649a0307ac7f42c730666c176b0ec8 Mon Sep 17 00:00:00 2001 From: Ghighi Eftimie Date: Mon, 4 Dec 2023 16:00:00 +0200 Subject: [PATCH 1/9] fix for 2931 --- cps/static/css/caliBlur.css | 9 +++++---- cps/static/js/caliBlur.js | 7 +++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cps/static/css/caliBlur.css b/cps/static/css/caliBlur.css index cf743761..60a5e4c5 100644 --- a/cps/static/css/caliBlur.css +++ b/cps/static/css/caliBlur.css @@ -3296,6 +3296,7 @@ div.btn-group[role=group][aria-label="Download, send to Kindle, reading"] .dropd left: 0 !important; } #add-to-shelves { + min-height: 48px; max-height: calc(100% - 120px); overflow-y: auto; } @@ -4812,8 +4813,8 @@ body.advsearch:not(.blur) > div.container-fluid > div.row-fluid > div.col-sm-10 z-index: 999999999999999999999999999999999999 } -.search #shelf-actions, body.login .home-btn { - display: none +.search #shelf-actions button#add-to-shelf { + height: 40px; } body.read:not(.blur) a[href*=readbooks] { @@ -5134,7 +5135,7 @@ body.login > div.navbar.navbar-default.navbar-static-top > div > div.navbar-head right: 5px } -#shelf-actions > .btn-group.open, .downloadBtn.open, .profileDrop[aria-expanded=true] { +body:not(.search) #shelf-actions > .btn-group.open, .downloadBtn.open, .profileDrop[aria-expanded=true] { pointer-events: none } @@ -5151,7 +5152,7 @@ body.login > div.navbar.navbar-default.navbar-static-top > div > div.navbar-head color: var(--color-primary) } -#shelf-actions, #shelf-actions > .btn-group, #shelf-actions > .btn-group > .empty-ul { +body:not(.search) #shelf-actions, body:not(.search) #shelf-actions > .btn-group, body:not(.search) #shelf-actions > .btn-group > .empty-ul { pointer-events: none } diff --git a/cps/static/js/caliBlur.js b/cps/static/js/caliBlur.js index cc4116cf..909a3d22 100755 --- a/cps/static/js/caliBlur.js +++ b/cps/static/js/caliBlur.js @@ -369,6 +369,13 @@ $("div.comments").readmore({ // End of Global Work // /////////////////////////////// +// Search Results +if($("body.search").length > 0) { + $('div[aria-label="Add to shelves"]').click(function () { + $("#add-to-shelves").toggle(); + }); +} + // Advanced Search Results if($("body.advsearch").length > 0) { $("#loader + .container-fluid") From 389e3f09f55ef24770293a09cc4ba27bbd07b25d Mon Sep 17 00:00:00 2001 From: Ghighi Eftimie Date: Mon, 4 Dec 2023 16:40:56 +0200 Subject: [PATCH 2/9] small fix for mobile resolution - add to shelf button --- cps/static/css/caliBlur.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cps/static/css/caliBlur.css b/cps/static/css/caliBlur.css index 60a5e4c5..3647b871 100644 --- a/cps/static/css/caliBlur.css +++ b/cps/static/css/caliBlur.css @@ -4813,9 +4813,15 @@ body.advsearch:not(.blur) > div.container-fluid > div.row-fluid > div.col-sm-10 z-index: 999999999999999999999999999999999999 } -.search #shelf-actions button#add-to-shelf { +body.search #shelf-actions button#add-to-shelf { height: 40px; } +@media screen and (max-width: 767px) { + body.search .discover, body.advsearch .discover { + display: flex; + flex-direction: column; + } +} body.read:not(.blur) a[href*=readbooks] { color: hsla(0, 0%, 100%, .7) !important From d353c9b6d3c605780bc37754db603d80c4d7be58 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 16 Dec 2023 10:48:49 +0100 Subject: [PATCH 3/9] Fix #2945 (handle illegal multibyte sequence) --- cps/web.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cps/web.py b/cps/web.py index 4430dd90..d9c54016 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1195,8 +1195,15 @@ def serve_book(book_id, book_format, anyname): rawdata = open(os.path.join(config.config_calibre_dir, book.path, data.name + "." + book_format), "rb").read() result = chardet.detect(rawdata) - return make_response( - rawdata.decode(result['encoding'], 'surrogatepass').encode('utf-8', 'surrogatepass')) + try: + text_data = rawdata.decode(result['encoding']).encode('utf-8') + except UnicodeDecodeError as e: + log.error("Encoding error in text file {}: {}".format(book.id, e)) + if "surrogate" in e.reason: + text_data = rawdata.decode(result['encoding'], 'surrogatepass').encode('utf-8', 'surrogatepass') + else: + text_data = rawdata.decode(result['encoding'], 'ignore').encode('utf-8', 'ignore') + return make_response(text_data) except FileNotFoundError: log.error("File Not Found") return "File Not Found" From bc0ebdb78d61311abccca4c1ec658ca9e0f64b79 Mon Sep 17 00:00:00 2001 From: Michiel Cornelissen Date: Wed, 20 Dec 2023 21:52:09 +0100 Subject: [PATCH 4/9] Updated Dutch translation. --- cps/translations/nl/LC_MESSAGES/messages.po | 164 ++++++++++---------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/cps/translations/nl/LC_MESSAGES/messages.po b/cps/translations/nl/LC_MESSAGES/messages.po index 3aa4fb8f..4769a6e2 100644 --- a/cps/translations/nl/LC_MESSAGES/messages.po +++ b/cps/translations/nl/LC_MESSAGES/messages.po @@ -9,8 +9,8 @@ msgstr "" "Project-Id-Version: Calibre-Web (GPLV3)\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "POT-Creation-Date: 2023-11-06 16:47+0100\n" -"PO-Revision-Date: 2020-12-12 08:20+0100\n" -"Last-Translator: Marcel Maas \n" +"PO-Revision-Date: 2023-12-20 22:00+0100\n" +"Last-Translator: Michiel Cornelissen \n" "Language: nl\n" "Language-Team: ed.driesen@telenet.be\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -35,7 +35,7 @@ msgstr "Bezig met het afsluiten van de server, sluit het venster" #: cps/admin.py:156 msgid "Success! Database Reconnected" -msgstr "" +msgstr "Gelukt! Database opnieuw verbonden" #: cps/admin.py:159 msgid "Unknown command" @@ -197,11 +197,11 @@ msgstr "Weet je zeker dat je de locatie van de Calibre-bibliotheek wil verandere #: cps/admin.py:629 msgid "Calibre-Web will search for updated Covers and update Cover Thumbnails, this may take a while?" -msgstr "" +msgstr "Calibre-web gaat zoeken naar bijgewerkte omslagen en miniaturen bijwerken, dit kan even duren?" #: cps/admin.py:632 msgid "Are you sure you want delete Calibre-Web's sync database to force a full sync with your Kobo Reader?" -msgstr "" +msgstr "Weet u zeker dat u de volledige Calibre-Web synchronisatiedatabase wilt verwijderen om een volledige synchronisatie met uw Kobo Reader te forceren?" #: cps/admin.py:875 cps/admin.py:881 cps/admin.py:891 cps/admin.py:901 #: cps/templates/modal_dialogs.html:29 cps/templates/user_table.html:41 @@ -217,7 +217,7 @@ msgstr "Toestaan" #: cps/admin.py:918 msgid "{} sync entries deleted" -msgstr "" +msgstr "{} synchronisatie objecten verwijderd" #: cps/admin.py:966 msgid "Tag not found" @@ -292,7 +292,7 @@ msgstr "SMTP-instellingen bewerken" #: cps/admin.py:1290 msgid "Success! Gmail Account Verified." -msgstr "" +msgstr "Gelukt! Gmail account geverifieerd." #: cps/admin.py:1310 cps/admin.py:1313 cps/admin.py:1695 cps/admin.py:1829 #: cps/admin.py:1927 cps/admin.py:2048 cps/editbooks.py:230 @@ -323,19 +323,19 @@ msgstr "E-mailserver-instellingen bijgewerkt" #: cps/admin.py:1350 cps/templates/admin.html:195 msgid "Edit Scheduled Tasks Settings" -msgstr "" +msgstr "Bewerk instellingen van geplande taken" #: cps/admin.py:1362 msgid "Invalid start time for task specified" -msgstr "" +msgstr "De starttijd van de taak is ongeldig" #: cps/admin.py:1367 msgid "Invalid duration for task specified" -msgstr "" +msgstr "De duur van de taak is ongeldig" #: cps/admin.py:1377 msgid "Scheduled tasks settings updated" -msgstr "" +msgstr "Instellingen van geplande taken bijgewerkt" #: cps/admin.py:1387 cps/admin.py:1436 cps/admin.py:2044 cps/web.py:1289 msgid "Oops! An unknown error occurred. Please try again later." @@ -343,7 +343,7 @@ msgstr "Onbekende fout opgetreden. Probeer het later nog eens." #: cps/admin.py:1391 msgid "Settings DB is not Writeable" -msgstr "" +msgstr "Instellingen database is niet schrijfbaar." #: cps/admin.py:1421 cps/admin.py:2036 #, python-format @@ -420,7 +420,7 @@ msgstr "Geüpload bestand kon niet opgeslagen worden in de tijdelijke map" #: cps/admin.py:1528 msgid "Files could not be replaced during update" -msgstr "" +msgstr "Bestanden kunnen niet vervangen worden tijdens een update" #: cps/admin.py:1552 #, fuzzy @@ -466,7 +466,7 @@ msgstr "SSL-certificaatlocatie is niet geldig, voer een geldig pad in" #: cps/admin.py:1816 msgid "Password length has to be between 1 and 40" -msgstr "" +msgstr "Het wachtwoord moet tussen de 1 en 40 tekens lang zijn" #: cps/admin.py:1868 #, fuzzy @@ -515,7 +515,7 @@ msgstr "Kan laatste systeembeheerder niet verwijderen" #: cps/admin.py:2014 cps/web.py:1438 msgid "Email can't be empty and has to be a valid Email" -msgstr "" +msgstr "E-mail kan niet leeg zijn en moet geldig zijn" #: cps/admin.py:2040 #, python-format @@ -549,7 +549,7 @@ msgstr "Oeps! Geselecteerd boek is niet beschikbaar. Bestand bestaat niet of is #: cps/editbooks.py:155 cps/editbooks.py:1227 msgid "User has no rights to upload cover" -msgstr "" +msgstr "Gebruiker mist rechten om de omslag te uploaden" #: cps/editbooks.py:175 cps/editbooks.py:720 msgid "Identifiers are not Case Sensitive, Overwriting Old Identifier" @@ -561,7 +561,7 @@ msgstr "De metagegevens zijn bijgewerkt" #: cps/editbooks.py:235 msgid "Error editing book: {}" -msgstr "" +msgstr "Fout tijdens bijwerken van boek: {}" #: cps/editbooks.py:292 #, python-format @@ -620,7 +620,7 @@ msgstr "Het boek is verwijderd" #: cps/editbooks.py:884 msgid "You are missing permissions to delete books" -msgstr "" +msgstr "U mist rechten om boeken te verwijderen" #: cps/editbooks.py:934 msgid "edit metadata" @@ -633,7 +633,7 @@ msgstr "%(seriesindex)s is geen geldig nummer, sla het over" #: cps/editbooks.py:1162 msgid "User has no rights to upload additional file formats" -msgstr "" +msgstr "Gebruiker mist rechten om extra bestandsformaten te uploaden" #: cps/editbooks.py:1183 #, python-format @@ -723,7 +723,7 @@ msgstr "Het opgevraagde bestand kan niet worden gelezen. Ben je hiertoe gemachti #: cps/helper.py:342 msgid "Read status could not set: {}" -msgstr "" +msgstr "Gelezen/ongelezen status kan niet aangepast worden: {}" #: cps/helper.py:365 #, python-format @@ -757,7 +757,7 @@ msgstr "Kan de titel '%(src)s' niet wijzigen in '%(dest)s': %(error)s" #: cps/helper.py:582 msgid "Error in rename file in path: {}" -msgstr "" +msgstr "Fout bij hernoemen bestand op bestandslocatie: {}" #: cps/helper.py:600 #, python-format @@ -766,7 +766,7 @@ msgstr "Boeken locatie '%(path)s' niet aangetroffen op Google Drive" #: cps/helper.py:665 msgid "Found an existing account for this Email address" -msgstr "" +msgstr "Bestaand account gevondne met dit e-mailadres" #: cps/helper.py:673 msgid "This username is already taken" @@ -779,11 +779,11 @@ msgstr "Ongeldig E-Mail adres" #: cps/helper.py:703 msgid "Password doesn't comply with password validation rules" -msgstr "" +msgstr "Het wachtwoord voldoet niet aan de validatieregels" #: cps/helper.py:852 msgid "Python module 'advocate' is not installed but is needed for cover uploads" -msgstr "" +msgstr "Pythonmodule 'advocate' is niet geïnstalleerd maar is nodig omslag uploads" #: cps/helper.py:862 msgid "Error Downloading Cover" @@ -795,7 +795,7 @@ msgstr "Onjuist omslagformaat" #: cps/helper.py:868 msgid "You are not allowed to access localhost or the local network for cover uploads" -msgstr "" +msgstr "Toegang tot localhost of het lokale netwerk niet toegestaant voor omslag uploaden" #: cps/helper.py:878 msgid "Failed to create path for cover" @@ -811,7 +811,7 @@ msgstr "Alleen jpg/jpeg/png/webp/bmp bestanden worden ondersteund als omslag" #: cps/helper.py:917 msgid "Invalid cover file content" -msgstr "" +msgstr "Ongeldig omslagbestand" #: cps/helper.py:921 msgid "Only jpg/jpeg files are supported as coverfile" @@ -833,7 +833,7 @@ msgstr "Willekeurige boeken" #: cps/helper.py:1079 cps/templates/admin.html:216 msgid "Queue all books for metadata backup" -msgstr "" +msgstr "Voeg alle boeken toe aan de wachtrij voor het maken van een metagegevens backup" #: cps/kobo_auth.py:90 #, fuzzy @@ -1139,7 +1139,7 @@ msgstr "Het boek is toegevoegd aan boekenplank: %(sname)s" #: cps/shelf.py:108 msgid "You are not allowed to add a book to the shelf" -msgstr "" +msgstr "U heeft niet voldoende rechten om een boek aan deze boekenplank toe te voegen" #: cps/shelf.py:126 #, python-format @@ -1163,7 +1163,7 @@ msgstr "Het boek is verwijderd van boekenplank: %(sname)s" #: cps/shelf.py:200 msgid "Sorry you are not allowed to remove a book from this shelf" -msgstr "" +msgstr "U heeft niet voldoende rechten om een boek van deze boekenplank te verwijderen" #: cps/shelf.py:210 cps/templates/layout.html:157 msgid "Create a Shelf" @@ -1180,7 +1180,7 @@ msgstr "Pas een boekenplank aan" #: cps/shelf.py:229 msgid "Error deleting Shelf" -msgstr "" +msgstr "Fout bij verwijderen boekenplank!" #: cps/shelf.py:231 #, fuzzy @@ -1194,7 +1194,7 @@ msgstr "Volgorde van boekenplank veranderen: '%(name)s'" #: cps/shelf.py:316 msgid "Sorry you are not allowed to create a public shelf" -msgstr "" +msgstr "Je mist rechten om een openbare boekenplank te maken " #: cps/shelf.py:333 #, python-format @@ -1252,11 +1252,11 @@ msgstr "Voltooid" #: cps/tasks_status.py:70 msgid "Ended" -msgstr "" +msgstr "Beëindigd" #: cps/tasks_status.py:72 msgid "Cancelled" -msgstr "" +msgstr "Geannuleerd" #: cps/tasks_status.py:74 msgid "Unknown Status" @@ -1321,7 +1321,7 @@ msgstr "Reeks: %(serie)s" #: cps/web.py:620 msgid "Rating: None" -msgstr "" +msgstr "Beoordeling: geen" #: cps/web.py:629 #, python-format @@ -1377,7 +1377,7 @@ msgstr "Stel je kindle-e-mailadres in..." #: cps/web.py:1254 msgid "Please wait one minute to register next user" -msgstr "" +msgstr "Wacht alstublieft één minuut voor het registreren van de volgende gebruiker" #: cps/templates/layout.html:68 cps/templates/layout.html:102 #: cps/templates/login.html:27 cps/templates/register.html:17 cps/web.py:1255 @@ -1405,7 +1405,7 @@ msgstr "Kan de LDAP authenticatie niet activeren" #: cps/web.py:1353 msgid "Please wait one minute before next login" -msgstr "" +msgstr "Wacht alstublieft één minuut voor de volgende inlogpoging" #: cps/web.py:1369 #, fuzzy, python-format @@ -1507,15 +1507,15 @@ msgstr "Calibre mislukt met foutmelding: %(error)s" #: cps/tasks/convert.py:275 msgid "Convert" -msgstr "" +msgstr "Overzetten" #: cps/tasks/database.py:28 msgid "Reconnecting Calibre database" -msgstr "" +msgstr "Opnieuw verbinding aan het maken met Calibre database" #: cps/tasks/mail.py:269 msgid "E-mail" -msgstr "" +msgstr "E-mail" #: cps/tasks/metadata_backup.py:46 #, fuzzy @@ -1525,20 +1525,20 @@ msgstr "metagegevens bewerken" #: cps/tasks/thumbnail.py:96 #, python-format msgid "Generated %(count)s cover thumbnails" -msgstr "" +msgstr "%{count}s omslagminiaturen gegenereerd" #: cps/tasks/thumbnail.py:230 cps/tasks/thumbnail.py:443 #: cps/tasks/thumbnail.py:511 msgid "Cover Thumbnails" -msgstr "" +msgstr "Omslag miniaturen" #: cps/tasks/thumbnail.py:289 msgid "Generated {0} series thumbnails" -msgstr "" +msgstr "{0} serieminiaturen gegenereerd" #: cps/tasks/thumbnail.py:454 msgid "Clearing cover thumbnail cache" -msgstr "" +msgstr "Cache met omslagminiaturen aan het opschonen" #: cps/tasks/upload.py:38 cps/templates/admin.html:20 #: cps/templates/layout.html:81 cps/templates/user_table.html:145 @@ -1702,37 +1702,37 @@ msgstr "Bewerk gebruikersinterface configuratie" #: cps/templates/admin.html:167 msgid "Scheduled Tasks" -msgstr "" +msgstr "Geplande taken" #: cps/templates/admin.html:170 cps/templates/schedule_edit.html:12 #: cps/templates/tasks.html:18 msgid "Start Time" -msgstr "" +msgstr "Starttijd" #: cps/templates/admin.html:174 cps/templates/schedule_edit.html:20 msgid "Maximum Duration" -msgstr "" +msgstr "Maximale duur" #: cps/templates/admin.html:178 cps/templates/schedule_edit.html:29 msgid "Generate Thumbnails" -msgstr "" +msgstr "Genereer miniaturen" #: cps/templates/admin.html:182 msgid "Generate series cover thumbnails" -msgstr "" +msgstr "Genereer serie miniaturen" #: cps/templates/admin.html:186 cps/templates/admin.html:208 #: cps/templates/schedule_edit.html:37 msgid "Reconnect Calibre Database" -msgstr "" +msgstr "Opnieuw verbinding maken met Calibre database" #: cps/templates/admin.html:190 cps/templates/schedule_edit.html:41 msgid "Generate Metadata Backup Files" -msgstr "" +msgstr "Genereer backupbestanden voor metagegevens" #: cps/templates/admin.html:197 msgid "Refresh Thumbnail Cache" -msgstr "" +msgstr "Ververs cache met omslagminiaturen" #: cps/templates/admin.html:203 msgid "Administration" @@ -1756,7 +1756,7 @@ msgstr "Calibre-Web stoppen" #: cps/templates/admin.html:221 msgid "Version Information" -msgstr "" +msgstr "Versie informatie" #: cps/templates/admin.html:225 msgid "Version" @@ -2103,11 +2103,11 @@ msgstr "Voer domeinnaam in" #: cps/templates/book_table.html:73 msgid "Comments" -msgstr "" +msgstr "Opmerkingen" #: cps/templates/book_table.html:75 msgid "Archive Status" -msgstr "" +msgstr "Archiefstatus" #: cps/templates/book_table.html:77 cps/templates/search_form.html:42 msgid "Read Status" @@ -2197,7 +2197,7 @@ msgstr "Bèta" #: cps/templates/config_edit.html:50 msgid "Trusted Hosts (Comma Separated)" -msgstr "" +msgstr "Vertrouwde hosts (komma gescheiden)" #: cps/templates/config_edit.html:61 msgid "Logfile Configuration" @@ -2221,7 +2221,7 @@ msgstr "Geavanceerde opties" #: cps/templates/config_edit.html:104 msgid "Convert non-English characters in title and author while saving to disk" -msgstr "" +msgstr "Zet niet Engelse tekens in titel en auteur om tijdens het opslaan" #: cps/templates/config_edit.html:108 msgid "Enable Uploads" @@ -2229,7 +2229,7 @@ msgstr "Uploaden inschakelen" #: cps/templates/config_edit.html:108 msgid "(Please ensure that users also have upload permissions)" -msgstr "" +msgstr "(Zorg dat gebruikers uploadrechten hebben)" #: cps/templates/config_edit.html:112 msgid "Allowed Upload Fileformats" @@ -2441,19 +2441,19 @@ msgstr "OAuth Instellingen" #: cps/templates/config_edit.html:369 msgid "Limit failed login attempts" -msgstr "" +msgstr "Beperk aantal mislukte inlogpogingen" #: cps/templates/config_edit.html:372 msgid "Session protection" -msgstr "" +msgstr "Sessiebescherming" #: cps/templates/config_edit.html:374 msgid "Basic" -msgstr "" +msgstr "Basis" #: cps/templates/config_edit.html:375 msgid "Strong" -msgstr "" +msgstr "Sterk" #: cps/templates/config_edit.html:380 #, fuzzy @@ -2462,23 +2462,23 @@ msgstr "Gebruikerswachtwoord herstellen" #: cps/templates/config_edit.html:384 msgid "Minimum password length" -msgstr "" +msgstr "Minimale wachtwoordlengte" #: cps/templates/config_edit.html:389 msgid "Enforce number" -msgstr "" +msgstr "Forceer getal" #: cps/templates/config_edit.html:393 msgid "Enforce lowercase characters" -msgstr "" +msgstr "Forceer kleine letter" #: cps/templates/config_edit.html:397 msgid "Enforce uppercase characters" -msgstr "" +msgstr "Forceer hoofdletter" #: cps/templates/config_edit.html:401 msgid "Enforce special characters" -msgstr "" +msgstr "Forceer speciaal teken" #: cps/templates/config_view_edit.html:17 msgid "View Configuration" @@ -2660,7 +2660,7 @@ msgstr "Kies Server Type" #: cps/templates/email_edit.html:22 msgid "Setup Gmail Account" -msgstr "" +msgstr "Gmail account instellen" #: cps/templates/email_edit.html:24 msgid "Revoke Gmail Access" @@ -2728,7 +2728,7 @@ msgstr "Kobo Sync Token" #: cps/templates/grid.html:21 msgid "List" -msgstr "" +msgstr "Lijst" #: cps/templates/http_error.html:34 #, fuzzy @@ -2749,11 +2749,11 @@ msgstr "Gebruiker uitloggen" #: cps/templates/index.html:71 msgid "Sort ascending according to download count" -msgstr "" +msgstr "Sorteer oplopend volgens aantal downloads" #: cps/templates/index.html:72 msgid "Sort descending according to download count" -msgstr "" +msgstr "Sorteer aflopend volgens aantal downloads" #: cps/templates/index.html:78 cps/templates/search.html:35 #: cps/templates/shelf.html:24 @@ -2901,7 +2901,7 @@ msgstr "Boekgegevens" #: cps/templates/list.html:22 msgid "Grid" -msgstr "" +msgstr "Raster" #: cps/templates/login.html:18 msgid "Remember Me" @@ -3031,7 +3031,7 @@ msgstr "Donker" #: cps/templates/read.html:83 msgid "Sepia" -msgstr "" +msgstr "Sepia" #: cps/templates/read.html:84 #, fuzzy @@ -3044,7 +3044,7 @@ msgstr "Tekstindeling automatisch aanpassen als het zijpaneel geopend is." #: cps/templates/read.html:93 msgid "Font Sizes" -msgstr "" +msgstr "Lettertypegrootte" #: cps/templates/readcbr.html:8 #, fuzzy @@ -3065,7 +3065,7 @@ msgstr "Volgende pagina" #: cps/templates/readcbr.html:80 msgid "Single Page Display" -msgstr "" +msgstr "Weergave van één pagina" #: cps/templates/readcbr.html:81 msgid "Long Strip Display" @@ -3101,7 +3101,7 @@ msgstr "Afbeelding omdraaien" #: cps/templates/readcbr.html:110 msgid "Display" -msgstr "" +msgstr "Weergeven" #: cps/templates/readcbr.html:113 #, fuzzy @@ -3162,11 +3162,11 @@ msgstr "Rechts-naar-links" #: cps/templates/readcbr.html:162 msgid "Reset to Top" -msgstr "" +msgstr "Terug naar boven" #: cps/templates/readcbr.html:163 msgid "Remember Position" -msgstr "" +msgstr "Onthoud positie" #: cps/templates/readcbr.html:168 msgid "Scrollbar" @@ -3225,7 +3225,7 @@ msgstr "De link vervalt na 10 minuten." #: cps/templates/schedule_edit.html:33 msgid "Generate Series Cover Thumbnails" -msgstr "" +msgstr "Genereer serie omslagminiaturen" #: cps/templates/search.html:6 msgid "No Results Found" @@ -3378,15 +3378,15 @@ msgstr "Looptijd" #: cps/templates/tasks.html:20 msgid "Actions" -msgstr "" +msgstr "Acties" #: cps/templates/tasks.html:40 msgid "This task will be cancelled. Any progress made by this task will be saved." -msgstr "" +msgstr "Deze taak wordt geannuleerd. De voortgang van deze taak wordt opgeslagen." #: cps/templates/tasks.html:41 msgid "If this is a scheduled task, it will be re-ran during the next scheduled time." -msgstr "" +msgstr "Als dit een geplande taak is wordt deze opnieuw uitgevoerd tijdens de volgende geplande tijd." #: cps/templates/user_edit.html:20 msgid "Reset user Password" @@ -3418,7 +3418,7 @@ msgstr "Aanmaken/Bekijken" #: cps/templates/user_edit.html:70 msgid "Force full kobo sync" -msgstr "" +msgstr "Forceer volledige Kobo synchronisatie." #: cps/templates/user_edit.html:88 msgid "Add allowed/Denied Custom Column Values" From 3aa75ef4a7ce240bf9c60ac885b682986fa93e11 Mon Sep 17 00:00:00 2001 From: Johannes H Date: Sun, 24 Dec 2023 14:07:02 +0100 Subject: [PATCH 5/9] 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 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d30ba8d..db8efe31 100755 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Calibre-Web is a web app that offers a clean and intuitive interface for browsin *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). +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 From d272f434249e084e17776b3ec13a74e5f6fb552e Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Tue, 26 Dec 2023 09:31:23 +0100 Subject: [PATCH 6/9] Show error message if user is missing download permission for kobo sync --- cps/kobo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cps/kobo.py b/cps/kobo.py index 76530797..061977de 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -137,10 +137,13 @@ def convert_to_kobo_timestamp_string(timestamp): @kobo.route("/v1/library/sync") @requires_kobo_auth -@download_required +# @download_required def HandleSyncRequest(): + if not current_user.role_download(): + log.info("User needs download permissions for syncing library with Kobo") + return abort(403) sync_token = SyncToken.SyncToken.from_headers(request.headers) - log.info("Kobo library sync request received.") + log.info("Kobo library sync request received") log.debug("SyncToken: {}".format(sync_token)) log.debug("Download link format {}".format(get_download_url_for_book('[bookid]','[bookformat]'))) if not current_app.wsgi_app.is_proxied: From 00acd745f4327a4444936c87fe8c69ede9eb604b Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 30 Dec 2023 19:08:57 +0100 Subject: [PATCH 7/9] Fix tornado deprecation warning --- cps/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cps/server.py b/cps/server.py index 0b6d2fb3..ebf967e9 100644 --- a/cps/server.py +++ b/cps/server.py @@ -21,6 +21,7 @@ import os import errno import signal import socket +import asyncio try: from gevent.pywsgi import WSGIServer @@ -326,4 +327,5 @@ class WebServer(object): if restart: self.wsgiserver.call_later(1.0, self.wsgiserver.stop) else: - self.wsgiserver.add_callback_from_signal(self.wsgiserver.stop) + self.wsgiserver.asyncio_loop.call_soon_threadsafe(self.wsgiserver.stop) + From 977f07364be4f47d9aa50fffc0f7169e1ba9d674 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 31 Dec 2023 19:48:47 +0100 Subject: [PATCH 8/9] Fix for #2961 (empty comment with newline causes error 500 on upload) Language of error message for kobo sync improved --- cps/editbooks.py | 14 ++++++++++---- cps/epub.py | 2 +- cps/kobo.py | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cps/editbooks.py b/cps/editbooks.py index 723f72a3..4b33f15e 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -27,8 +27,10 @@ from shutil import copyfile from uuid import uuid4 from markupsafe import escape, Markup # dependency of flask from functools import wraps +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: @@ -1001,10 +1003,14 @@ def edit_book_series_index(series_index, book): def edit_book_comments(comments, book): modify_date = False if comments: - if BLEACH: - comments = clean_html(comments, tags=None, attributes=None) - else: - comments = clean_html(comments) + try: + if BLEACH: + comments = clean_html(comments, tags=set(), attributes=set()) + else: + comments = clean_html(comments) + except ParserError as e: + log.error("Comments of book {} are corrupted: {}".format(book.id, e)) + comments = "" if len(book.comments): if book.comments[0].text != comments: book.comments[0].text = comments diff --git a/cps/epub.py b/cps/epub.py index 50adba59..ca6820b1 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -102,7 +102,7 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): elif s == 'date': epub_metadata[s] = tmp[0][:10] else: - epub_metadata[s] = tmp[0] + epub_metadata[s] = tmp[0].strip() else: epub_metadata[s] = 'Unknown' diff --git a/cps/kobo.py b/cps/kobo.py index 061977de..5f8c72e1 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -140,7 +140,7 @@ def convert_to_kobo_timestamp_string(timestamp): # @download_required def HandleSyncRequest(): if not current_user.role_download(): - log.info("User needs download permissions for syncing library with Kobo") + log.info("Users need download permissions for syncing library to Kobo reader") return abort(403) sync_token = SyncToken.SyncToken.from_headers(request.headers) log.info("Kobo library sync request received") From f0cc93abd3ecd369d91f3d76118c142c058edb6e Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 6 Jan 2024 16:07:43 +0100 Subject: [PATCH 9/9] Sanitze username for logging --- cps/web.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cps/web.py b/cps/web.py index d9c54016..67d22ec7 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1354,21 +1354,21 @@ def login(): @limiter.limit("3/minute", key_func=lambda: request.form.get('username', "").strip().lower()) def login_post(): form = request.form.to_dict() + username = form.get('username', "").strip().lower().replace("\n","\\n").replace("\r","") try: limiter.check() except RateLimitExceeded: flash(_(u"Please wait one minute before next login"), category="error") - return render_login(form.get("username", ""), form.get("password", "")) + return render_login(username, form.get("password", "")) if current_user is not None and current_user.is_authenticated: return redirect(url_for('web.index')) if config.config_login_type == constants.LOGIN_LDAP and not services.ldap: log.error(u"Cannot activate LDAP authentication") flash(_(u"Cannot activate LDAP authentication"), category="error") - user = ub.session.query(ub.User).filter(func.lower(ub.User.name) == form.get('username', "").strip().lower()) \ - .first() + user = ub.session.query(ub.User).filter(func.lower(ub.User.name) == username).first() remember_me = bool(form.get('remember_me')) if config.config_login_type == constants.LOGIN_LDAP and services.ldap and user and form['password'] != "": - login_result, error = services.ldap.bind_user(form['username'], form['password']) + login_result, error = services.ldap.bind_user(username, form['password']) if login_result: log.debug(u"You are now logged in as: '{}'".format(user.name)) return handle_login_user(user, @@ -1388,7 +1388,7 @@ def login_post(): flash(_(u"Could not login: %(message)s", message=error), category="error") else: ip_address = request.headers.get('X-Forwarded-For', request.remote_addr) - log.warning('LDAP Login failed for user "%s" IP-address: %s', form['username'], ip_address) + log.warning('LDAP Login failed for user "%s" IP-address: %s', username, ip_address) flash(_(u"Wrong Username or Password"), category="error") else: ip_address = request.headers.get('X-Forwarded-For', request.remote_addr) @@ -1397,7 +1397,7 @@ def login_post(): ret, __ = reset_password(user.id) if ret == 1: flash(_(u"New Password was send to your email address"), category="info") - log.info('Password reset for user "%s" IP-address: %s', form['username'], ip_address) + log.info('Password reset for user "%s" IP-address: %s', username, ip_address) else: log.error(u"An unknown error occurred. Please try again later") flash(_(u"An unknown error occurred. Please try again later."), category="error") @@ -1413,9 +1413,9 @@ def login_post(): _(u"You are now logged in as: '%(nickname)s'", nickname=user.name), "success") else: - log.warning('Login failed for user "{}" IP-address: {}'.format(form['username'], ip_address)) + log.warning('Login failed for user "{}" IP-address: {}'.format(username, ip_address)) flash(_(u"Wrong Username or Password"), category="error") - return render_login(form.get("username", ""), form.get("password", "")) + return render_login(username, form.get("password", "")) @web.route('/logout')