Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 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
14 changes: 14 additions & 0 deletions scripts/xklb-patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# FILE_PATH="$HOME/.local/pipx/venvs/xklb/lib/python3.12/site-packages/xklb/createdb/tube_add.py"
updatedb
Comment thread
deldesir marked this conversation as resolved.
Outdated
FILE_PATH=$(locate /site-packages/xklb/createdb/tube_add.py | grep /pipx/venvs/xklb/lib/ | grep /root/.local/ | head -1)

# Have both lines been patched in?
if grep -q '"live_status": None,' "$FILE_PATH" && grep -q '"error": None,' "$FILE_PATH"; then
echo "tube_add.py already patched (to help add columns live_status and error). No changes necessary."
else
echo "Patching tube_add.py, to help add columns live_status and error (needed when xklb-metadata.db is created or REcreated!)"
sed -i '/"time_deleted": 0,/a\ "live_status": None,\n "error": None,' "$FILE_PATH"
echo "tube_add.py has been successfully patched."
fi