Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from .cli import CliParameter
from .constants import CONFIG_DIR
from .reverseproxy import ReverseProxied
from .subproc_wrapper import process_open
from .server import WebServer
from .dep_check import dependency_check
from .updater import Updater
Expand Down Expand Up @@ -152,6 +153,11 @@ def create_app():
db.CalibreDB.setup_db(config.config_calibre_dir, cli_param.settings_path)
calibre_db.init_db()

p = process_open("xklb-patch", newlines=True)
while p.poll is None:
log.info(p.stdout.readline())
p.wait()

updater_thread.init_updater(config, web_server)
# Perform dry run of updater and exit afterward
if cli_param.dry_run:
Expand Down
16 changes: 16 additions & 0 deletions scripts/xklb-patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

FILE_PATH="$HOME/.local/pipx/venvs/xklb/lib/python3.12/site-packages/xklb/createdb/tube_add.py"

# Check if the patch flag exists
if ! grep -q "# PATCHED by IIAB: so live_status and error columns can be added" "$FILE_PATH"; then
echo "Patch to tube_add.py seems missing. Reapplying patch... (helps add columns live_status and error)"
else
echo "tube_add.py is already patched (helps add columns live_status and error). No changes necessary."
exit 0
fi

# Logic to add 'live_status' and 'error' columns (needed when xklb-metadata.db is created or REcreated!)
sed -i '/"time_deleted": 0,/a \ \ \ \ \ \ \ \ "live_status": None, \n\ \ \ \ \ \ \ \ "error": None,' "$FILE_PATH"
echo "# PATCHED by IIAB: so live_status and error columns can be added" >> "$FILE_PATH"
Comment thread
deldesir marked this conversation as resolved.
Outdated
echo "tube_add.py has been successfully patched"