Skip to content

Update to MediaPartStream and inheriting classes - #590

Merged
jjlawren merged 40 commits into
masterfrom
mediaSubtitle_attribs
Jan 24, 2021
Merged

Update to MediaPartStream and inheriting classes#590
jjlawren merged 40 commits into
masterfrom
mediaSubtitle_attribs

Conversation

@blacktwin

@blacktwinblacktwin commented Oct 23, 2020

Copy link
Copy Markdown
Collaborator

Description

Clean up of MediaPartStream and it's inheriting classes (video, audio, subtitle).
Moving common attribs among video, audio, and subtitle streams into parent MediaPartStream.
Removal of no longer present attribs from video, audio, subtitle, and MediaPartStream.

Addresses #536

Type of change

  • Bug fix (non-breaking change which fixes an issue)
    Technically not a bug fix, but code clean up.

@JonnyWong16JonnyWong16 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also added the following attributes to my forked plexapi-3.6.0:

~plexapi.media.Media

self.audioProfile=data.attrib.get('videoProfile')
self.proxyType=cast(int, data.attrib.get('proxyType'))
self.optimizedVersion=self.proxyType==SEARCHTYPES['optimizedVersion']
# For Photo onlyself.aperture=data.attrib.get('aperture')
self.exposure=data.attrib.get('exposure')
self.iso=cast(int, data.attrib.get('iso'))
self.lens=data.attrib.get('lens')
self.make=data.attrib.get('make')
self.model=data.attrib.get('model')

~plexapi.media.MediaPart

self.audioProfile=data.attrib.get('audioProfile')
self.deepAnalysisVersion=cast(int, data.attrib.get('deepAnalysisVersion'))
self.has64bitOffsets=cast(bool, data.attrib.get('has64bitOffsets'))
self.hasThumbnail=cast(bool, data.attrib.get('hasThumbnail'))
self.packetLength=cast(int, data.attrib.get('packetLength'))
self.requiredBandwidths=data.attrib.get('requiredBandwidths')

~plexapi.media.VideoStream

self.anamorphic=data.attrib.get('anamorphic')
self.chromaLocation=data.attrib.get('chromaLocation')
self.DOVIBLCompatID=cast(int, data.attrib.get('DOVIBLCompatID'))
self.DOVIBLPresent=cast(bool, data.attrib.get('DOVIBLPresent'))
self.DOVIELPresent=cast(bool, data.attrib.get('DOVIELPresent'))
self.DOVILevel=cast(int, data.attrib.get('DOVILevel'))
self.DOVIPresent=cast(bool, data.attrib.get('DOVIPresent'))
self.DOVIProfile=cast(int, data.attrib.get('DOVIProfile'))
self.DOVIRPUPresent=cast(bool, data.attrib.get('DOVIRPUPresent'))
self.DOVIVersion=cast(float, data.attrib.get('DOVIVersion'))
self.pixelAspectRatio=data.attrib.get('pixelAspectRatio')
self.pixelFormat=data.attrib.get('pixelFormat')
self.streamIdentifier=cast(int, data.attrib.get('streamIdentifier'))

~plexapi.media.AudioStream

self.profile=data.attrib.get('profile')
# For Track onlyself.albumGain=cast(float, data.attrib.get('albumGain'))
self.albumPeak=cast(float, data.attrib.get('albumPeak'))
self.albumRange=cast(float, data.attrib.get('albumRange'))
self.endRamp=data.attrib.get('endRamp')
self.gain=cast(float, data.attrib.get('gain'))
self.loudness=cast(float, data.attrib.get('loudness'))
self.lra=cast(float, data.attrib.get('lra'))
self.peak=cast(float, data.attrib.get('peak'))
self.startRamp=data.attrib.get('startRamp')

~plexapi.media.SubtitleStream

self.container=data.attrib.get('container')
self.forced=cast(bool, data.attrib.get('forced', '0'))
self.format=data.attrib.get('format')
self.headerCompression=data.attrib.get('headerCompression')

~plexapi.media.LyricStream (STREAMTYPE = 4)

self.format=data.attrib.get('format')
self.minLines=cast(int, data.attrib.get('minLines'))
self.provider=data.attrib.get('provider')
self.timed=cast(bool, data.attrib.get('timed', '0'))

Comment threadplexapi/media.py

@JonnyWong16JonnyWong16 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Update doc strings.

Comment threadplexapi/media.py Outdated
Comment threadplexapi/media.py Outdated
Comment threadplexapi/media.py Outdated
Comment threadplexapi/media.py
Comment threadplexapi/media.py Outdated
Comment threadplexapi/media.py
Comment threadplexapi/media.py Outdated
Comment threadplexapi/media.py
@JonnyWong16

Copy link
Copy Markdown
Collaborator

Cherrypick this commit.
JonnyWong16@e346f0b

Comment threadplexapi/media.py
@JonnyWong16

Copy link
Copy Markdown
Collaborator

Tests have been updated with the new attributes

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@blacktwin@JonnyWong16@jjlawren