mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2025-10-23 15:11:08 +00:00
fix: use keyword arguments for Attachment constructor in font attachment
Fixes #24 When attaching fonts for ASS/SSA subtitles, the Attachment class was being called with positional arguments instead of keyword arguments. This caused the font Path object to be incorrectly interpreted, leading to an error: "Invalid URL 'Arial (arial)': No scheme supplied." Changed Attachment(font, name) to Attachment(path=font, name=name) to explicitly pass arguments by keyword, ensuring proper parameter handling.
This commit is contained in:
@@ -1106,11 +1106,11 @@ class dl:
|
|||||||
if family_dir.exists():
|
if family_dir.exists():
|
||||||
fonts = family_dir.glob("*.*tf")
|
fonts = family_dir.glob("*.*tf")
|
||||||
for font in fonts:
|
for font in fonts:
|
||||||
title.tracks.add(Attachment(font, f"{font_name} ({font.stem})"))
|
title.tracks.add(Attachment(path=font, name=f"{font_name} ({font.stem})"))
|
||||||
font_count += 1
|
font_count += 1
|
||||||
elif fonts_from_system:
|
elif fonts_from_system:
|
||||||
for font in fonts_from_system:
|
for font in fonts_from_system:
|
||||||
title.tracks.add(Attachment(font, f"{font_name} ({font.stem})"))
|
title.tracks.add(Attachment(path=font, name=f"{font_name} ({font.stem})"))
|
||||||
font_count += 1
|
font_count += 1
|
||||||
else:
|
else:
|
||||||
self.log.warning(f"Subtitle uses font [text2]{font_name}[/] but it could not be found...")
|
self.log.warning(f"Subtitle uses font [text2]{font_name}[/] but it could not be found...")
|
||||||
|
|||||||
Reference in New Issue
Block a user