Skip to content
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
12 changes: 11 additions & 1 deletion plexapi/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,17 @@ def _loadData(self, data):
@deprecated('use "items" instead')
def children(self):
return self.fetchItems(self.key)


@property
def thumbUrl(self):
""" Return the thumbnail url for the collection."""
return self._server.url(self.thumb, includeToken=True) if self.thumb else None

@property
def artUrl(self):
""" Return the art url for the collection."""
return self._server.url(self.art, includeToken=True) if self.art else None

def item(self, title):
""" Returns the item in the collection that matches the specified title.

Expand Down
10 changes: 10 additions & 0 deletions tests/test_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@ def test_library_Collection_items(collection):
assert len(items) == 1


def test_library_Collection_thumbUrl(collection):
assert utils.SERVER_BASEURL in collection.thumbUrl
assert "/library/collections/" in collection.thumbUrl
assert "/composite/" in collection.thumbUrl


def test_library_Collection_artUrl(collection):
assert collection.artUrl is None # Collections don't have default art


def test_search_with_weird_a(plex):
ep_title = "Coup de Grâce"
result_root = plex.search(ep_title)
Expand Down