python-plexapi icon indicating copy to clipboard operation
python-plexapi copied to clipboard

Code Improvement: Fix class `Playable`

Open Dr-Blank opened this issue 2 years ago • 0 comments

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

https://github.com/pkkid/python-plexapi/blob/47f11f04eb14d52d1396d7dac2ca7ed987616c0c/plexapi/base.py#L714-L716 https://github.com/pkkid/python-plexapi/blob/47f11f04eb14d52d1396d7dac2ca7ed987616c0c/plexapi/base.py#L729-L730

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 avatar Nov 08 '23 20:11 Dr-Blank