Uh oh!
There was an error while loading. Please reload this page.
Add ability to retrieve playlist items by libtype - #1604
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for filtering playlist items by library type (libtype) when retrieving items from a playlist.
Changes:
- Extend
Playlist.items()to accept an optionallibtypefilter and passtype=<searchType>to the/playlists/<id>/itemsquery. - Refactor item-fetching logic into a helper and keep the unfiltered result cached via
@cached_data_property. - Add a new test validating
items(libtype=...)behavior for show/season/episode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
plexapi/playlist.py | Adds optional libtype filtering when fetching playlist items (via type query param) while preserving cached unfiltered results. |
tests/test_playlist.py | Renames the playlist items test and adds coverage for retrieving playlist items filtered by libtype. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
454ecc3 to
a33c41aCompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| finally: | ||
| playlist.delete() |
There was a problem hiding this comment.
playlist.delete() in the finally block can raise UnboundLocalError if plex.createPlaylist(...) fails before playlist is assigned. Initialize playlist = None before the try and guard the delete (e.g., if playlist: playlist.delete()).
a33c41a to
336876dCompareUh oh!
There was an error while loading. Please reload this page.
Description
Add ability to retrieve playlist items by libtype.
Type of change
Please delete options that are not relevant.
Checklist: