Skip to content

Commit 073eb78

Browse files
committed
2.5.004
1 parent 420a599 commit 073eb78

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.github/README.md

+2-2
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.003)
98+
xk media library subcommands (v2.5.004)
9999

100100
Create database subcommands:
101101
╭───────────────┬────────────────────────────────────────────────────╮
@@ -282,9 +282,9 @@ To stop playing press Ctrl+C in either the terminal or mpv
282282

283283
### Organize via separate databases
284284

285-
library fsadd --audio both.db ./audiobooks/ ./podcasts/
286285
library fsadd --audio audiobooks.db ./audiobooks/
287286
library fsadd --audio podcasts.db ./podcasts/ ./another/more/secret/podcasts_folder/
287+
library merge-dbs --pk path -t playlists,media both.db audiobooks.db podcasts.db
288288

289289
## Guides
290290

xklb/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.5.003"
1+
__version__ = "2.5.004"

xklb/media/media_printer.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
from tabulate import tabulate
99

10-
import xklb.db_media
11-
from xklb import history
10+
from xklb import db_media, history
1211
from xklb.utils import consts, iterables, printing, processes, sql_utils, strings
1312
from xklb.utils.consts import SC
1413
from xklb.utils.log_utils import log
@@ -141,10 +140,10 @@ def media_printer(args, data, units=None, media_len=None) -> None:
141140

142141
else:
143142
if "r" in print_args:
144-
marked = xklb.db_media.mark_media_deleted(args, [d["path"] for d in media if not Path(d["path"]).exists()])
143+
marked = db_media.mark_media_deleted(args, [d["path"] for d in media if not Path(d["path"]).exists()])
145144
log.warning(f"Marked {marked} metadata records as deleted")
146145
elif "d" in print_args:
147-
marked = xklb.db_media.mark_media_deleted(args, [d["path"] for d in media])
146+
marked = db_media.mark_media_deleted(args, [d["path"] for d in media])
148147
log.warning(f"Marked {marked} metadata records as deleted")
149148

150149
if "w" in print_args:
@@ -185,9 +184,9 @@ def should_align_right(k, v):
185184
media = iterables.list_dict_filter_bool(media)
186185

187186
if "f" in print_args:
188-
if len(media) <= 1000 and args.action not in [consts.SC.open_links]:
187+
if len(media) <= 1000 and getattr(args, "action", "") not in [consts.SC.open_links]:
189188
media, deleted_paths = filter_deleted(media)
190-
xklb.db_media.mark_media_deleted(args, deleted_paths)
189+
db_media.mark_media_deleted(args, deleted_paths)
191190
if len(media) == 0:
192191
raise FileNotFoundError
193192

xklb/scripts/open_links.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import argparse, webbrowser
1+
import argparse, shlex, webbrowser
22
from pathlib import Path
33
from time import sleep
44
from typing import Tuple
@@ -66,6 +66,9 @@ def parse_args() -> argparse.Namespace:
6666
args.title_prefix = ["https://www.google.com/search?q=%"]
6767
args.title_prefix = [s if "%" in s else s + "%" for s in args.title_prefix]
6868

69+
if args.browser:
70+
args.browser = shlex.split(args.browser)
71+
6972
if args.db:
7073
args.database = args.db
7174

@@ -173,7 +176,7 @@ def construct_links_query(args) -> Tuple[str, dict]:
173176

174177
def play(args, path, url) -> None:
175178
if args.browser:
176-
cmd(*shlex.split(args.browser), url)
179+
processes.cmd(*args.browser, url)
177180
else:
178181
webbrowser.open(url, 2, autoraise=False)
179182
history.add(args, [path], time_played=consts.today_stamp(), mark_done=True)

0 commit comments

Comments
 (0)