Skip to content

Will need to upgrade audio track count detection since using legacy streams #213

@jesterr0

Description

@jesterr0

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdonecompleted on dev

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions