Skip to content

Commit

Permalink
Update AITHER.py
Browse files Browse the repository at this point in the history
correct issue when dual audio of only the 1st audio track being used when determining the aither release name
  • Loading branch information
Kha-kis authored Sep 24, 2024
1 parent 9102057 commit ed70941
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/trackers/AITHER.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,15 @@ async def get_flag(self, meta, flag_name):
async def edit_name(self, meta):
aither_name = meta['name']

# Helper function to check if English audio is present
def has_english_audio(tracks=None, media_info_text=None):
if meta['is_disc'] == "BDMV" and tracks:
for track in tracks:
if track.get('language', '').lower() == 'english':
return True
elif media_info_text:
audio_section = re.search(r'Audio[\s\S]+?Language\s+:\s+(\w+)', media_info_text)
if audio_section:
language = audio_section.group(1)
audio_section = re.findall(r'Audio[\s\S]+?Language\s+:\s+(\w+)', media_info_text)
for i, language in enumerate(audio_section):
language = language.lower().strip()
if language.lower().startswith('en'): # Check if it's English
return True
return False
Expand Down

0 comments on commit ed70941

Please sign in to comment.