Skip to content

Commit 8eb827b

Browse files
committed
2.5.010
1 parent 096db10 commit 8eb827b

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
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.009)
98+
xk media library subcommands (v2.5.010)
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.009"
1+
__version__ = "2.5.010"

xklb/fs_extract.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,18 @@ def extract_metadata(mp_args, path) -> Optional[Dict[str, int]]:
204204
# TODO: it would be better if this was saved to and checked against an external global file
205205
media["hash"] = sample_hash.sample_hash_file(path)
206206

207-
if getattr(mp_args, "process", False):
208-
if objects.is_profile(mp_args, DBType.audio) and Path(path).suffix not in [".opus", ".mka"]:
209-
path = media["path"] = process_audio.process_path(
210-
path, split_longer_than=2160 if "audiobook" in path.lower() else None
211-
)
212-
213207
if getattr(mp_args, "move", False) and not file_utils.is_file_open(path):
214208
dest_path = bytes(Path(mp_args.move) / Path(path).relative_to(mp_args.playlist_path))
215209
dest_path = path_utils.clean_path(dest_path)
216210
file_utils.rename_move_file(path, dest_path)
217211
media["path"] = dest_path
218212

213+
if getattr(mp_args, "process", False):
214+
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
217+
)
218+
219219
return media
220220

221221

xklb/scripts/process_audio.py

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def process_path(
129129
path.unlink() # Remove original
130130
elif is_split:
131131
path.unlink() # Remove original
132+
return path.with_suffix(".000.mka") # TODO: return multiple paths...
132133
else:
133134
if output_path.stat().st_size > path.stat().st_size:
134135
output_path.unlink() # Remove transcode

xklb/tube_backend.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def tube_opts(args, func_opts=None, playlist_opts: Optional[str] = None) -> dict
5050
"youtube_include_dash_manifest": False,
5151
"youtube_include_hls_manifest": False,
5252
"no_check_certificate": True,
53-
"check_formats": False,
5453
"ignore_no_formats_error": True,
5554
"skip_playlist_after_errors": 21,
5655
"clean_infojson": False,
@@ -347,7 +346,9 @@ def out_dir(p):
347346
}
348347

349348
if args.verbose >= consts.LOG_DEBUG:
350-
func_opts["progress_hooks"] = [lambda d: log.debug(f"downloading {d['_percent_str']} {d['_speed_str']} {d['downloaded_bytes']} bytes")]
349+
func_opts["progress_hooks"] = [
350+
lambda d: log.debug(f"downloading {d['_percent_str']} {d['_speed_str']} {d['downloaded_bytes']} bytes")
351+
]
351352

352353
if args.profile != DBType.audio:
353354
func_opts["subtitlesformat"] = "srt/best"

0 commit comments

Comments
 (0)