7 Commits

Author SHA1 Message Date
a66e3ab455 Merge pull request 'fix workflow' (#2) from update-workflow into master
Reviewed-on: #2
2025-03-07 05:23:21 -08:00
7e221f74bd fix workflow
All checks were successful
Build and Upload Python Package / build (pull_request) Successful in 4m36s
2025-03-07 05:22:32 -08:00
14d680da18 Merge pull request 'change workflow to be merge based' (#1) from update-workflow into master
Reviewed-on: #1
2025-03-07 05:20:55 -08:00
d23e713d7a change workflow to be merge based 2025-03-07 05:20:11 -08:00
550e9c0ac8 fix play command for files 2025-03-07 05:14:58 -08:00
9cec56ef73 update fzf list and sqash some bugs 2025-03-07 05:05:02 -08:00
c7cab59898 fix bug 2025-03-07 04:38:00 -08:00
4 changed files with 9 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
name: Build and Upload Python Package
on:
release:
pull_request:
branches:
- master
types: [closed]
jobs:
build:
runs-on: ubuntu-latest

View File

@@ -1,6 +1,6 @@
[metadata]
name = jimaku-dl
version = 0.1.1
version = 0.1.3
author = InsaneDesperado
author_email = insane@lmaoxd.lol
description = Download japanese anime subtitles from Jimaku

View File

@@ -5,7 +5,6 @@ from argparse import ArgumentParser
from os import environ
from sys import exit as sysexit
s
from jimaku_dl.downloader import JimakuDownloader

View File

@@ -676,8 +676,8 @@ class JimakuDownloader:
# Present entries in fzf for selection
entry_options = []
entry_mapping = {}
for entry in entries:
opt = f"{entry.get('name', 'No Title')} - {entry.get('flags', {}).get('japanese_name', 'Unknown')}"
for i, entry in enumerate(entries, start=1):
opt = f"{i}. {entry.get('english_name', 'No Eng Name')} - {entry.get('japanese_name', 'None')}"
entry_options.append(opt)
entry_mapping[opt] = entry
@@ -708,8 +708,8 @@ class JimakuDownloader:
# Present available subtitle files for selection
file_options = []
file_mapping = {}
for file_info in files:
display = f"{file_info.get('name', 'Unknown')}"
for i, file_info in enumerate(files, start=1):
display = f"{i}. {file_info.get('name', 'Unknown')}"
file_options.append(display)
file_mapping[display] = file_info
@@ -750,7 +750,7 @@ class JimakuDownloader:
continue
# Use provided filename if available; otherwise, default to base video name + suffix.
filename = file_info.get("filename")
filename = file_info.get("name")
if not filename:
if is_directory:
# For directory input, use the file's own name or ID
@@ -766,8 +766,7 @@ class JimakuDownloader:
if play and not is_directory:
self.logger.info("Launching MPV with the subtitle files...")
mpv_cmd = ["mpv", media_file]
for sub in downloaded_files:
mpv_cmd.extend(["--sub-file", sub])
mpv_cmd.extend([f"--sub-file={filename}"])
try:
self.logger.debug(f"Running command: {' '.join(mpv_cmd)}")
subprocess_run(mpv_cmd)