Below snippet will be adequate
Be sure to search for all channel_s in use pertaining to mediainfo and update it
@staticmethod
def get_channels(mi_audio_obj: Track) -> int:
"""
Get the number of audio channels for the specified track.
The added complexity for 'check_other' is to ensure we get a report
of the highest potential channel count.
Returns:
The number of audio channels as an integer.
"""
if isinstance(mi_audio_obj.channel_s, int):
base_channels = mi_audio_obj.channel_s
else:
base_channels = max(
int(x) for x in re.findall(r"\d+", str(mi_audio_obj.channel_s)) if x
)
check_other = re.search(r"\d+", str(mi_audio_obj.other_channel_s[0]))
check_other_2 = str(mi_audio_obj.channel_s__original)
# create a list of values to find the maximum
values = [int(base_channels)]
if check_other:
values.append(int(check_other.group()))
if check_other_2.isdigit():
values.append(int(check_other_2))
return max(values)
Below snippet will be adequate
Be sure to search for all
channel_sin use pertaining to mediainfo and update it