Skip to content

Commit 235232f

Browse files
committed
Add sqaureArt property
1 parent 90aa3a5 commit 235232f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plexapi/mixins.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,15 @@ def setPoster(self, poster):
523523
class SquareArtUrlMixin:
524524
""" Mixin for Plex objects that can have a square art url. """
525525

526+
@property
527+
def squareArt(self):
528+
""" Return the API path to the square art image. """
529+
return next((i.url for i in self.images if i.type == 'backgroundSquare'), None)
530+
526531
@property
527532
def squareArtUrl(self):
528533
""" Return the square art url for the Plex object. """
529-
image = next((i for i in self.images if i.type == 'squareArt'), None)
530-
return self._server.url(image.url, includeToken=True) if image else None
534+
return self._server.url(self.squareArt, includeToken=True) if self.squareArt else None
531535

532536

533537
class SquareArtLockMixin:

0 commit comments

Comments
 (0)