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

Code Improvement: Fix class Playable #1290

Open
Dr-Blank opened this issue Nov 8, 2023 · 0 comments · May be fixed by #1301
Open

Code Improvement: Fix class Playable #1290

Dr-Blank opened this issue Nov 8, 2023 · 0 comments · May be fixed by #1301

Comments

@Dr-Blank
Copy link
Contributor

Dr-Blank commented Nov 8, 2023

Describe the Bug

Currently Playlist inherits Playable but cannot use any of it public methods since except play which itself calls client.playMedia

which expects a class of Media and has a separate case for Playlist.

also Playable implements attributes specific to only Playlist while each of its child classes implements atrribute media which is expected to be a part of Playable and is used in all of its methods but isn't present.

Code Snippets

def _loadData(self, data):
self.playlistItemID = utils.cast(int, data.attrib.get('playlistItemID')) # playlist
self.playQueueItemID = utils.cast(int, data.attrib.get('playQueueItemID')) # playqueue

if self.TYPE not in ('movie', 'episode', 'track', 'clip'):
raise Unsupported(f'Fetching stream URL for {self.TYPE} is unsupported.')

Expected Behavior

transfer attributes to their own classes, and bring in common attributes into Playable from its children

Additional Context

No response

Operating System and Version

Windows 10 64-bit

Plex Media Server Version

1.32.7.7621

Python Version

3.11.0b1

PlexAPI Version

4.15.5

@Dr-Blank Dr-Blank linked a pull request Nov 16, 2023 that will close this issue
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant