Skip to content

Commit

Permalink
Applied minor bugfixes for bugs in V2.1.0 that could effect brand new…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
crocodilestick committed Nov 2, 2024
1 parent cbef98d commit 3596176
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- - [View upcoming releases here](https://github.com/crocodilestick/Calibre-Web-Automated/releases) -->

### Additional Features on our Roadmap 🛣️🌱

Expand Down Expand Up @@ -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
Expand All @@ -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

```
Expand Down
Binary file modified empty_library/app.db
Binary file not shown.
2 changes: 1 addition & 1 deletion root/app/calibre-web/cps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion root/app/calibre-web/cps/cwa_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions root/app/calibre-web/cps/templates/config_db.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ <h2>{{title}}</h2>
<button type="button" data-toggle="modal" id="calibre_modal_path" data-link="config_calibre_dir" data-filefilter="metadata.db" data-target="#fileModal" id="library_path" class="btn btn-default"><span class="glyphicon glyphicon-folder-open"></span></button>
</span>
</div>
<!-- <div class="form-group required">
<div class="form-group required">
<input type="checkbox" id="config_calibre_split" name="config_calibre_split" data-control="split_settings" data-t ="{{ config.config_calibre_split_dir }}" {% if config.config_calibre_split %}checked{% endif %} >
<label for="config_calibre_split">{{_('Separate Book Files from Library')}}</label>
<label for="config_calibre_split">{{_('Separate Book Files from Library - DO NOT USE! COMING IN CWA V2.2.0!')}}</label>
</div>
<div data-related="split_settings">
<div class="form-group required input-group">
Expand All @@ -27,7 +27,7 @@ <h2>{{title}}</h2>
<button type="button" data-toggle="modal" id="calibre_modal_split_path" data-link="config_calibre_split_dir" data-filefilter="" data-target="#fileModal" id="book_path" class="btn btn-default"><span class="glyphicon glyphicon-folder-open"></span></button>
</span>
</div>
</div> -->
</div>
{% if feature_support['gdrive'] %}
<div class="form-group required">
<input type="checkbox" id="config_use_google_drive" name="config_use_google_drive" data-control="gdrive_settings" {% if config.config_use_google_drive %}checked{% endif %} >
Expand Down
2 changes: 2 additions & 0 deletions scripts/convert-library.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import shutil
from pathlib import Path
import subprocess
import tempfile
import atexit

from cwa_db import CWA_DB

Expand Down

0 comments on commit 3596176

Please sign in to comment.