diff --git a/plexapi/library.py b/plexapi/library.py index e27df9876..ce0e0ec61 100644 --- a/plexapi/library.py +++ b/plexapi/library.py @@ -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. diff --git a/tests/test_library.py b/tests/test_library.py index 3958a8e32..b081df14e 100644 --- a/tests/test_library.py +++ b/tests/test_library.py @@ -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)