From 3596176d7d71abbca34a717216d7f4632e1f4938 Mon Sep 17 00:00:00 2001 From: crocodilestick <105450872+crocodilestick@users.noreply.github.com> Date: Sat, 2 Nov 2024 00:05:25 +0000 Subject: [PATCH] Applied minor bugfixes for bugs in V2.1.0 that could effect brand new users: - Calibre Binary location now set by default to /usr/bin in app.db - Restored split setting option in config_db to prevent 500 errors some users were having - Fixed dependency issues introduced in convert-library - Added isfile check for convert-library.log to prevent crash on first run that could result if a log file didn't already exist --- README.md | 20 ++++++------------ empty_library/app.db | Bin 118784 -> 118784 bytes root/app/calibre-web/cps/admin.py | 2 +- root/app/calibre-web/cps/cwa_functions.py | 6 +++++- .../calibre-web/cps/templates/config_db.html | 6 +++--- scripts/convert-library.py | 2 ++ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 066cef3..83672f6 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ After discovering that using the DOCKER_MODS universal-calibre environment varia - **Bio**nic **read**ing **wa**s **initi**ally **rele**ased **i**n **20**22 **a**s **a** **met**hod **o**f **forma**tting **te**xt **t**o **ma**ke **i**t **eas**ier **fo**r **peo**ple **wi**th **AD**HD **an**d **oth**er **concent**ration **&** **read**ing **iss**ues **t**o **re**ad **fast**er, **eas**ier **an**d **t**o **ret**ain **mo**re **o**f **wh**at **they**'ve **rea**d. - **W**e **we**re **insp**ired **b**y **th**e **conc**ept **an**d **ha**ve **crea**ted **a** **eP**ub **conve**rsion **algor**ithm **insp**ired **b**y **th**e **orig**inal **Bio**nic **Read**ing **fo**r **tho**se **wh**o **li**ke **i**t **o**r **wh**o **ma**y **wa**nt **t**o **gi**ve **i**t **a** **g**o -- [View upcoming releases here](https://github.com/crocodilestick/Calibre-Web-Automated/releases) + ### Additional Features on our Roadmap 🛣️🌱 @@ -194,24 +194,16 @@ we recommend carrying out these [Post-Install Tasks Here](#post-install-tasks). 2. Log in with the default admin credentials (_below_) 3. Configure your Calibre-Web instance via the admin page, referring to the Basic Configuration and UI Configuration guides 4. Add books by having them placed in the folder you bound to `cwa-book-ingest` in your Docker Compose +5. CWA currently requires all books in the library to be in `.epub` format. If your existing library contains any books of different filetypes, navigate to the Admin panel and scroll until you see the "Convert Library to EPUB" option. + - A live log page will then be loaded to allow you to monitor the progress of the conversion process. + - All files processed during this process, whether successfully converted or not, will be backed up to `/config/processed_books` +6. Drop a book into your ingest folder to check everything is working and enjoy! ## Default Admin Login: > **Username:** admin\ > **Password:** admin123 -## Configuring CWA ⚙️ - -- If your Calibre Library contains any ebooks not in the `.epub` format, from within the container run the `convert-library` command. - - Calibre-Web Automated's extra features only work with epubs and so **failure to complete this step could result in unforeseen errors and general unreliability** - - Full usage can be found below in the Usage Section however the following command will automatically convert any non-epubs to epubs and store the original files in `/config/processed_books`: - -``` -convert-library --keep -``` - -- Drop a book into your ingest folder and check everything is working correctly! - # Usage 🔧 ## Adding Books to Your Library @@ -222,6 +214,8 @@ convert-library --keep - Be sure that the books you are transferring to `/cwa-book-ingest` are owned by your user rather than root. Otherwise, permission errors may occur and may result in incomplete importing. - In the event you're expecting a book to be ingested and it hasn't been, use the "Library Refresh" button on the Upper Navbar to manually trigger the ingest process +# CWA CLI Tools 🧑‍💻 + ## The Cover-Enforcer CLI Tool ``` diff --git a/empty_library/app.db b/empty_library/app.db index 9074993277a528fb471650c4c77a97a96790bb09..9028e1fd9517c372e70f6afab852dc7cc262c7b0 100644 GIT binary patch delta 53 zcmV-50LuS>pa+1U2ap>9B9Rpa+1U2ap>9A(0$I0U?24wO|3JuLPw44W+Sxn+*blSeKu@0Zai6x9q(E Lhyk~JzX600^2ifR diff --git a/root/app/calibre-web/cps/admin.py b/root/app/calibre-web/cps/admin.py index f1d79ba..53548fd 100644 --- a/root/app/calibre-web/cps/admin.py +++ b/root/app/calibre-web/cps/admin.py @@ -212,7 +212,7 @@ def cwa_get_package_versions() -> tuple[str, str, str, str]: kepubify_version = "Unknown" try: - with open("/config/.CALIBRE_RELEASE", "r") as f: + with open("/CALIBRE_RELEASE", "r") as f: calibre_version = f.read() except Exception: calibre_version = "Unknown" diff --git a/root/app/calibre-web/cps/cwa_functions.py b/root/app/calibre-web/cps/cwa_functions.py index ce1ed44..fbba97b 100644 --- a/root/app/calibre-web/cps/cwa_functions.py +++ b/root/app/calibre-web/cps/cwa_functions.py @@ -8,6 +8,8 @@ import subprocess import sqlite3 +import os.path +from time import sleep import sys sys.path.insert(1, '/app/calibre-web-automated/scripts/') @@ -180,10 +182,12 @@ def cwa_flash_status(): return redirect(url_for('admin.admin')) -from time import sleep def flask_logger(): subprocess.Popen(['python3', '/app/calibre-web-automated/scripts/convert-library.py']) + if os.path.isfile("/config/convert-library.log") == False: + with open('/config/convert-library.log', 'w') as create_new_log: + pass with open("/config/convert-library.log", 'r') as log_info: while True: data = log_info.read() diff --git a/root/app/calibre-web/cps/templates/config_db.html b/root/app/calibre-web/cps/templates/config_db.html index 407a7e6..f9ef1cc 100644 --- a/root/app/calibre-web/cps/templates/config_db.html +++ b/root/app/calibre-web/cps/templates/config_db.html @@ -16,9 +16,9 @@

{{title}}

- + {% if feature_support['gdrive'] %}
diff --git a/scripts/convert-library.py b/scripts/convert-library.py index 65f5024..6f7451f 100644 --- a/scripts/convert-library.py +++ b/scripts/convert-library.py @@ -7,6 +7,8 @@ import shutil from pathlib import Path import subprocess +import tempfile +import atexit from cwa_db import CWA_DB