feat: add disk stall detection
This commit is contained in:
@@ -13,6 +13,7 @@ from .naming import build_scene_name, get_source_tag, get_volume_label
|
||||
from .encode import build_handbrake_cmd, run_encode
|
||||
from .metadata import lookup_imdb, generate_nfo
|
||||
from .library import list_library
|
||||
from .disc import check_disc_readable, unstuck_disc
|
||||
|
||||
|
||||
def main():
|
||||
@@ -59,6 +60,11 @@ def main():
|
||||
action="store_true",
|
||||
help="List all ripped movies in the output directory.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--check-disc",
|
||||
action="store_true",
|
||||
help="Check disc readability and attempt recovery if stuck.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--init-config",
|
||||
action="store_true",
|
||||
@@ -76,6 +82,12 @@ def main():
|
||||
list_library(args.output_base)
|
||||
return
|
||||
|
||||
# ── Disc health check ────────────────────────────────────────────────
|
||||
if args.check_disc:
|
||||
if not unstuck_disc(args.input):
|
||||
sys.exit(1)
|
||||
return
|
||||
|
||||
# ── Banner ───────────────────────────────────────────────────────────
|
||||
console.print()
|
||||
console.print(
|
||||
@@ -154,7 +166,7 @@ def main():
|
||||
args.input, output_file, title, audio_sel, subtitle_sel, encoder,
|
||||
)
|
||||
|
||||
returncode = run_encode(cmd)
|
||||
returncode = run_encode(cmd, input_path=args.input)
|
||||
if returncode != 0:
|
||||
console.print(f"\n[bold red]ERROR:[/] HandBrakeCLI exited with code {returncode}")
|
||||
sys.exit(returncode)
|
||||
|
||||
Reference in New Issue
Block a user