File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1595,7 +1595,17 @@ def _loadData(self, data):
15951595 @deprecated ('use "items" instead' )
15961596 def children (self ):
15971597 return self .fetchItems (self .key )
1598-
1598+
1599+ @property
1600+ def thumbUrl (self ):
1601+ """ Return the thumbnail url for the collection."""
1602+ return self ._server .url (self .thumb , includeToken = True ) if self .thumb else None
1603+
1604+ @property
1605+ def artUrl (self ):
1606+ """ Return the art url for the collection."""
1607+ return self ._server .url (self .art , includeToken = True ) if self .art else None
1608+
15991609 def item (self , title ):
16001610 """ Returns the item in the collection that matches the specified title.
16011611
Original file line number Diff line number Diff line change @@ -313,6 +313,16 @@ def test_library_Collection_items(collection):
313313 assert len (items ) == 1
314314
315315
316+ def test_library_Collection_thumbUrl (collection ):
317+ assert utils .SERVER_BASEURL in collection .thumbUrl
318+ assert "/library/collections/" in collection .thumbUrl
319+ assert "/composite/" in collection .thumbUrl
320+
321+
322+ def test_library_Collection_artUrl (collection ):
323+ assert collection .artUrl is None # Collections don't have default art
324+
325+
316326def test_search_with_weird_a (plex ):
317327 ep_title = "Coup de Grâce"
318328 result_root = plex .search (ep_title )
You can’t perform that action at this time.
0 commit comments