Skip to content

Commit a74198a

Browse files
committed
2.5.011
1 parent 040f1b1 commit a74198a

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

.github/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ To stop playing press Ctrl+C in either the terminal or mpv
9595
<details><summary>List all subcommands</summary>
9696

9797
$ library
98-
xk media library subcommands (v2.5.010)
98+
xk media library subcommands (v2.5.011)
9999

100100
Create database subcommands:
101101
╭───────────────┬────────────────────────────────────────────────────╮

xklb/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.5.010"
1+
__version__ = "2.5.011"

xklb/fs_extract.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,12 @@ def extract_metadata(mp_args, path) -> Optional[Dict[str, int]]:
208208
dest_path = bytes(Path(mp_args.move) / Path(path).relative_to(mp_args.playlist_path))
209209
dest_path = path_utils.clean_path(dest_path)
210210
file_utils.rename_move_file(path, dest_path)
211-
media["path"] = dest_path
211+
path = media["path"] = dest_path
212212

213213
if getattr(mp_args, "process", False):
214214
if objects.is_profile(mp_args, DBType.audio) and Path(path).suffix not in [".opus", ".mka"]:
215-
path = media["path"] = process_audio.process_path(
216-
path, split_longer_than=2160 if "audiobook" in path.lower() else None
215+
path = media["path"] = str(
216+
process_audio.process_path(path, split_longer_than=2160 if "audiobook" in path.lower() else None)
217217
)
218218

219219
return media

xklb/scripts/cluster_sort.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def cluster_dicts(args, media):
233233
s for d in groups for s in d["grouped_paths"] if not bool(media_keyed[s].get("time_deleted"))
234234
)
235235

236-
if args.print_groups:
236+
if getattr(args, "print_groups", False):
237237
print_groups(groups)
238238

239239
media = [media_keyed[p] for p in sorted_paths]
@@ -359,7 +359,7 @@ def cluster_sort() -> None:
359359
elif args.unique_only:
360360
groups = [d for d in groups if len(d["grouped_paths"]) == 1]
361361

362-
if args.print_groups:
362+
if getattr(args, "print_groups", False):
363363
print_groups(groups)
364364
elif args.move_groups:
365365
min_len = len(str(len(groups) + 1))

xklb/scripts/open_links.py

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def parse_args() -> argparse.Namespace:
4343
parser.add_argument("--skip")
4444

4545
parser.add_argument("--cluster-sort", "--cluster", "-C", action="store_true", help=argparse.SUPPRESS)
46+
parser.add_argument("--print-groups", "--groups", "-g", action="store_true", help="Print groups")
4647
parser.add_argument("--clusters", "--n-clusters", type=int, help="Number of KMeans clusters")
4748
parser.add_argument("--related", "-R", action="count", default=0, help=argparse.SUPPRESS)
4849

xklb/scripts/process_audio.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def process_path(
3737
delete_video=False,
3838
):
3939
path = Path(path)
40+
assert path.exists()
4041
ffprobe_cmd = ["ffprobe", "-v", "error", "-print_format", "json", "-show_format", "-show_streams", path]
4142
result = subprocess.run(ffprobe_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
4243
info = json.loads(result.stdout)

0 commit comments

Comments
 (0)