Plex-Meta-Manager icon indicating copy to clipboard operation
Plex-Meta-Manager copied to clipboard

Audio codec regexes are matching with commentary tracks

Open Spazholio opened this issue 1 year ago • 0 comments

Version Number

1.19.0-nightly66 (Docker)

What branch are you on?

nightly

Describe the Bug

If I have a file that has a commentary track, it will show up in the XML as such:

<Stream id="371337" streamType="2" selected="1" default="1" codec="opus" index="1" channels="6" bitrate="361" language="English" languageTag="en" languageCode="eng" audioChannelLayout="5.1" requiredBandwidths="366,366,366,366,366,366,366,366" samplingRate="48000" title="Surround" displayTitle="English (OPUS 5.1)" extendedDisplayTitle="Surround (English OPUS 5.1)">
</Stream>
<Stream id="371338" streamType="2" codec="opus" index="2" channels="2" bitrate="164" language="English" languageTag="en" languageCode="eng" audioChannelLayout="stereo" requiredBandwidths="165,165,165,165,165,165,165,165" samplingRate="48000" title="Commentary" displayTitle="English (OPUS Stereo)" extendedDisplayTitle="Commentary (English OPUS Stereo)">
</Stream>

I've already submitted a Defaults ticket to address the regex for using the word "stereo" to mean "AAC" for the purpose of overlays so won't address that here. But looking at the XML, it appears that all audio tracks are streamType="2" (with video being 1, and subtitles being 3) and the primary is index="1" and possibly default="1". All of this information is available via the PlexAPI, so maybe it would be possible to stop looking if default="True" (assuming "default means what I think it does here) or if index="1"? Or possibly if there's more than one stream, try to guess which one is the primary stream based on the audio quality?

Relevant Collection/Overlay/Playlist Definition

No response

Logs

No response

Spazholio avatar Jun 13 '23 18:06 Spazholio