Skip to content

Commit

Permalink
no log: small fixes to my latest commit
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Aug 28, 2024
1 parent 74f2c66 commit f1f3850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bazarr/subtitles/indexer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import os
import logging
import re

from guess_language import guess_language
from subliminal_patch import core
Expand Down Expand Up @@ -136,6 +135,7 @@ def guess_external_subtitles(dest_folder, subtitles, media_type, previously_inde
continue
text = text.decode(encoding)

if core.parse_for_hi_regex(subtitle_text=text, alpha3_language=language.alpha3):
if core.parse_for_hi_regex(subtitle_text=text,
alpha3_language=language.alpha3 if hasattr(language, 'alpha3') else None):
subtitles[subtitle] = Language.rebuild(subtitles[subtitle], forced=False, hi=True)
return subtitles
5 changes: 4 additions & 1 deletion custom_libs/subliminal_patch/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,10 @@ def save_subtitles(file_path, subtitles, single=False, directory=None, chmod=Non
continue

# create subtitle path
if subtitle.text and parse_for_hi_regex(subtitle_text=subtitle.text, alpha3_language=subtitle.language.alpha3):
if subtitle.text and parse_for_hi_regex(subtitle_text=subtitle.text,
alpha3_language=subtitle.language.alpha3 if
(hasattr(subtitle, 'language') and hasattr(subtitle.language, 'alpha3'))
else None):
subtitle.language.hi = True
subtitle_path = get_subtitle_path(file_path, None if single else subtitle.language,
forced_tag=subtitle.language.forced,
Expand Down

0 comments on commit f1f3850

Please sign in to comment.