forked from janeczku/calibre-web
-
Notifications
You must be signed in to change notification settings - Fork 12
Ensure xklb-metadata.db has live_status and error columns #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b7055b3
Merge pull request #28 from iiab/master
deldesir 715e1ad
Create xklb-patch
deldesir b106292
Define the file path and path flag
deldesir 08387ea
Check if the patch flag exists
deldesir 53abb10
Insert the 'live_status' and 'error' columns
deldesir 3a24e90
Set xklb-patch script to run on Calibre-Web [re]start
deldesir 5b3ccdc
Strengthen scripts/xklb-patch
deldesir ebc4097
Enhance scripts/xklb-patch
deldesir d1be970
Enhance scripts/xklb-patch
deldesir 75c0e98
Add comment for Debian 12 and Ubuntu 23.10
deldesir 229d593
Make script findable
deldesir 2319003
Adjust script to patch db_media instead of tube_add
deldesir 5c64eb0
Strengthen xklb-patch
deldesir c1651ac
Change Base Dir
deldesir 57e9752
Search for files only
deldesir 3b0967b
Fix typo
deldesir b60f40c
Remove /dev/null redirection in scripts/xklb-patch
deldesir 56e61b3
Fix syntax error
deldesir 62ea58f
Add explanatory comment
deldesir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
|
|
||
| # FILE_PATH="$HOME/.local/pipx/venvs/xklb/lib/python3.12/site-packages/xklb/createdb/tube_add.py" | ||
| # Debian 12 and Ubuntu 23.10 use: /root/.local/pipx/... | ||
| # Debian 13 and Ubuntu 24.04 use: /root/.local/share/pipx/... | ||
| # Running 'updatedb' is an ugly hack that might be very slow (optimize later!) | ||
| # but at least fixes (a) "share" in path on new OS's (b) Python version in path | ||
| updatedb | ||
| FILE_PATH=$(locate /site-packages/xklb/mediadb/db_media.py | grep /pipx/venvs/xklb/lib/ | grep '/root/.local' | head -1) | ||
|
|
||
| # Check if the patch has already been applied | ||
| if grep -q 'entry = {k: v for k, v in entry.items() if v is not None or k == "error"}' "$FILE_PATH"; then | ||
| echo "db_media.py already patched to retain 'error' key when value is None. No changes necessary." | ||
| else | ||
| echo "Patching db_media.py to ensure 'error' key is retained even when its value is None." | ||
| sed -i.bak 's/entry = objects\.dict_filter_bool(entry)/entry = {k: v for k, v in entry.items() if v is not None or k == "error"}/' "$FILE_PATH" | ||
|
|
||
| echo "db_media.py has been successfully patched." | ||
| fi | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.