Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for visualImpaired Attribute #1494

Open
JourneyOver opened this issue Jan 15, 2025 · 6 comments · May be fixed by #1495
Open

Add Support for visualImpaired Attribute #1494

JourneyOver opened this issue Jan 15, 2025 · 6 comments · May be fixed by #1495

Comments

@JourneyOver
Copy link

What is your feature request?

Currently, PlexAPI supports the hearingImpaired attribute with a boolean member in plexapi.media.SubtitleStream, allowing developers to easily identify and use this information. However, there is no equivalent boolean member for the visualImpaired attribute, which would be useful for identifying content designed for visually impaired users, such as those with audio descriptions.

I propose adding support for a visualImpaired boolean member to make it easier to work with this attribute in PlexAPI, similar to how hearingImpaired is implemented.

Are there any workarounds?

No response

Code Snippets

No response

Additional Context

Adding support for the visualImpaired attribute would align PlexAPI with Plex's accessibility features and improve its usability for developers building applications with accessibility in mind.

This enhancement would also create parity between hearingImpaired and visualImpaired attributes, making PlexAPI more consistent and robust.

@JonnyWong16
Copy link
Collaborator

Could you provide a sample subtitle file with the attribute?

@JourneyOver
Copy link
Author

@JonnyWong16, I'll see if I can get a sample provided (as I currently don't have one myself) by @gotson, who initially brought this to my attention in my repo for Plex Auto Languages.

The XML example he shared with me is as follows:

<Stream id="121952" streamType="2" default="1" codec="eac3" index="1" channels="2" bitrate="384" language="French" languageTag="fr" languageCode="fra" audioChannelLayout="stereo" requiredBandwidths="384,384,384,384,384,384,384,384" samplingRate="48000" displayTitle="French (EAC3 Stereo)" extendedDisplayTitle="French (EAC3 Stereo)">
</Stream>
<Stream id="121953" streamType="2" selected="1" codec="aac" index="2" channels="2" bitrate="128" language="French" languageTag="fr" languageCode="fra" audioChannelLayout="stereo" profile="lc" requiredBandwidths="129,129,129,129,129,129,129,129" samplingRate="48000" title="AD" visualImpaired="1" displayTitle="French Descriptive (AAC Stereo)" extendedDisplayTitle="AD (French AAC Stereo Descriptive)">
</Stream>

However, I’m hoping @gotson can provide an actual file with the required attribute for further validation.

@JonnyWong16
Copy link
Collaborator

Wait, is it audio or subtitle? You mention SubtitleStream but the XML is for AudioStream.

@JourneyOver
Copy link
Author

JourneyOver commented Jan 15, 2025

Oh my, I just noticed that myself! I’ve been sick and barely getting any sleep this past week, so I’ve been in a bit of a fog and didn’t catch that until now and it even says Audio stream in the issue thread on my repo >.<

Guess I should check https://python-plexapi.readthedocs.io/en/latest/modules/media.html#plexapi.media.MediaPartStream and https://python-plexapi.readthedocs.io/en/latest/modules/media.html#plexapi.media.AudioStream instead.

@JonnyWong16
Copy link
Collaborator

The XML you provided is enough info.

@JonnyWong16 JonnyWong16 linked a pull request Jan 15, 2025 that will close this issue
7 tasks
@JourneyOver
Copy link
Author

JourneyOver commented Jan 15, 2025

Yea at first, I thought it was for Subtitle rather than Audio, but I'm glad you caught that haha. Thanks for adding the attribute check to AudioStream! 😊

In the meantime, I've added extendedDisplayTitle and displayTitle checks in my code as before it was just checking against title and idk if ad is always going to be the same for every visualImpaired audio stream out there or not to address the issue in my repo. Once #1495 is fully implemented, it’ll definitely make things easier for me. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants