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

Add convenience method to return filter choice items #1353

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plexapi/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -2927,6 +2927,10 @@ def _loadData(self, data):
self.title = data.attrib.get('title')
self.type = data.attrib.get('type')

def items(self):
""" Returns a list of items for this filter choice. """
return self.fetchItems(self.fastKey)


class ManagedHub(PlexObject):
""" Represents a Managed Hub (recommendation) inside a library.
Expand Down
3 changes: 3 additions & 0 deletions tests/test_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,9 @@ def test_library_MovieSection_search_FilterChoice(movies, collection):
movie = collection.items()[0]
assert movie in results

items = filterChoice.items()
assert movie in items


def test_library_MovieSection_advancedSearch(movies, movie):
advancedFilters = {
Expand Down
Loading