update fzf list and sqash some bugs

This commit is contained in:
sudacode 2025-03-07 05:05:02 -08:00
parent c7cab59898
commit 9cec56ef73
2 changed files with 6 additions and 6 deletions

View File

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

View File

@ -676,8 +676,8 @@ class JimakuDownloader:
# Present entries in fzf for selection # Present entries in fzf for selection
entry_options = [] entry_options = []
entry_mapping = {} entry_mapping = {}
for entry in entries: for i, entry in enumerate(entries, start=1):
opt = f"{entry.get('name', 'No Title')} - {entry.get('flags', {}).get('japanese_name', 'Unknown')}" opt = f"{i}. {entry.get('english_name', 'No Eng Name')} - {entry.get('japanese_name', 'None')}"
entry_options.append(opt) entry_options.append(opt)
entry_mapping[opt] = entry entry_mapping[opt] = entry
@ -708,8 +708,8 @@ class JimakuDownloader:
# Present available subtitle files for selection # Present available subtitle files for selection
file_options = [] file_options = []
file_mapping = {} file_mapping = {}
for file_info in files: for i, file_info in enumerate(files, start=1):
display = f"{file_info.get('name', 'Unknown')}" display = f"{i}. {file_info.get('name', 'Unknown')}"
file_options.append(display) file_options.append(display)
file_mapping[display] = file_info file_mapping[display] = file_info
@ -750,7 +750,7 @@ class JimakuDownloader:
continue continue
# Use provided filename if available; otherwise, default to base video name + suffix. # 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 not filename:
if is_directory: if is_directory:
# For directory input, use the file's own name or ID # For directory input, use the file's own name or ID