Skip to content

Commit

Permalink
3.0.012
Browse files Browse the repository at this point in the history
  • Loading branch information
chapmanjacobd committed Oct 23, 2024
1 parent 2a14dd4 commit 8957f8b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
36 changes: 26 additions & 10 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To stop playing press Ctrl+C in either the terminal or mpv
<details><summary>List all subcommands</summary>

$ library
library (v3.0.011; 87 subcommands)
library (v3.0.012; 88 subcommands)

Create database subcommands:
╭─────────────────┬──────────────────────────────────────────╮
Expand Down Expand Up @@ -207,15 +207,17 @@ To stop playing press Ctrl+C in either the terminal or mpv
╰──────────────────┴───────────────────────────────────────────────╯

Media File subcommands:
╭────────────────┬───────────────────────────────────────────────────────╮
│ media-check │ Check video and audio files for corruption via ffmpeg │
├────────────────┼───────────────────────────────────────────────────────┤
│ process-media │ Estimate and execute potential disk space savings │
├────────────────┼───────────────────────────────────────────────────────┤
│ process-ffmpeg │ Shrink video/audio to AV1/Opus format (.mkv, .mka) │
├────────────────┼───────────────────────────────────────────────────────┤
│ process-image │ Shrink images to AV1 image format (.avif) │
╰────────────────┴───────────────────────────────────────────────────────╯
╭────────────────┬──────────────────────────────────────────────────────────────╮
│ media-check │ Check video and audio files for corruption via ffmpeg │
├────────────────┼──────────────────────────────────────────────────────────────┤
│ process-media │ Estimate and execute potential disk space savings │
├────────────────┼──────────────────────────────────────────────────────────────┤
│ process-ffmpeg │ Shrink video/audio to AV1/Opus format (.mkv, .mka) │
├────────────────┼──────────────────────────────────────────────────────────────┤
│ process-image │ Shrink images to AV1 image format (.avif) │
├────────────────┼──────────────────────────────────────────────────────────────┤
│ process-text │ Shrink documents to HTML+AV1 image format (requires Calibre) │
╰────────────────┴──────────────────────────────────────────────────────────────╯

Multi-database subcommands:
╭──────────────────┬────────────────────────╮
Expand Down Expand Up @@ -1991,6 +1993,20 @@ Inspired somewhat by https://nikkhokkho.sourceforge.io/?page=FileOptimizer
numfmt --to=iec (sqlite-utils --no-headers --raw-lines image.db "select sum(size)-sum(100000) from media where time_deleted=0 and type like 'image/%' and type != 'image/avif' and size > 100000")


</details>

###### process-text

<details><summary>Shrink documents to HTML+AV1 image format (requires Calibre)</summary>

$ library process-text -h
usage: library process-text PATH ...

Repackage documents (PDF, ePub, etc) into HTML+AVIF to save space

Requires Calibre


</details>

### Multi-database subcommands
Expand Down
4 changes: 2 additions & 2 deletions tests/mediafiles/test_process_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

from xklb.__main__ import library as lb
from xklb.utils import nums, path_utils, strings
from xklb.utils import nums, path_utils


@pytest.mark.skipif(not which("calibre"), reason="requires calibre")
Expand All @@ -19,7 +19,7 @@ def test_process_text_too_small():
]
)

assert path_utils.folder_size(temp_dir.name) < nums.human_to_bytes('163Ki')
assert path_utils.folder_size(temp_dir.name) < nums.human_to_bytes("163Ki")
# TODO: add test for large enough source file

try:
Expand Down
2 changes: 1 addition & 1 deletion xklb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from xklb.utils import argparse_utils, iterables
from xklb.utils.log_utils import log

__version__ = "3.0.011"
__version__ = "3.0.012"

progs = {
"Create database subcommands": {
Expand Down
4 changes: 3 additions & 1 deletion xklb/utils/arggroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,9 @@ def download(parent_parser):
default=5,
help="Skip links that have failed more than N times (ie. previous sessions, requires DB)",
)
parser.add_argument("--http-download-retries", type=int, default=10, help="Use N retries for downloads (current session)")
parser.add_argument(
"--http-download-retries", type=int, default=10, help="Use N retries for downloads (current session)"
)
parser.add_argument("--download-chunk-size", type=nums.human_to_bytes, default="8MB")
parser.add_argument(
"--force",
Expand Down

0 comments on commit 8957f8b

Please sign in to comment.