Skip to content

Conversation

Alindil
Copy link
Contributor

@Alindil Alindil commented May 6, 2021

Description

There can be several videos in an optimization. In the current code we only loop on one.

  • Deprecates PlexServer.optimizedItem().
  • Adds Optimized.items() method to return all videos that are part of the optimization.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

There can be several videos in an optimization. In the current code we only loop on one
@JonnyWong16
Copy link
Collaborator

I would rather deprecate plex.optimizedItem() and add an items() method to plexapi.media.Optimized instead. This mimics the rest of Plex API.

~plexapi.media.Optimized

    def items(self):
        """ Returns a list of all :class:`~plexapi.media.Video` objects
            in this optimized item.
        """
        key = '%s/%s/items' % (self._initpath, self.id)
        return self.fetchItems(key)

@JonnyWong16 JonnyWong16 changed the title Update server.py Return list of all optimized items May 10, 2021
@JonnyWong16 JonnyWong16 changed the title Return list of all optimized items Add method to return a list of all optimized items May 14, 2021
@JonnyWong16 JonnyWong16 merged commit 893a992 into pushingkarmaorg:master May 24, 2021
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 this pull request may close these issues.

2 participants