Skip to content

Commit

Permalink
Add convenience method to return filter choice items (#1353)
Browse files Browse the repository at this point in the history
* Add convenience method to return filter choice items

* Add test for filter choice items
  • Loading branch information
JonnyWong16 committed Feb 5, 2024
1 parent 36cbcd0 commit a85291e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plexapi/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -2949,6 +2949,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

0 comments on commit a85291e

Please sign in to comment.