Skip to content

Commit 0b4b9c4

Browse files
committed
update setPoster method in base, library.Collection, playlist
use media.Poster select method instead
1 parent 8320359 commit 0b4b9c4

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

plexapi/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,7 @@ def uploadPoster(self, url=None, filepath=None):
446446

447447
def setPoster(self, poster):
448448
""" Set . :class:`~plexapi.media.Poster` to :class:`~plexapi.video.Video` """
449-
key = poster._initpath[:-1]
450-
data = '%s?url=%s' % (key, quote_plus(poster.ratingKey))
451-
self._server.query(data, method=self._server._session.put)
449+
poster.select()
452450

453451
# The photo tag cant be built atm. TODO
454452
# def arts(self):

plexapi/library.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,9 +1087,7 @@ def uploadPoster(self, url=None, filepath=None):
10871087

10881088
def setPoster(self, poster):
10891089
""" Set . :class:`~plexapi.media.Poster` to :class:`~plexapi.video.Video` """
1090-
key = poster._initpath[:-1]
1091-
data = '%s?url=%s' % (key, quote_plus(poster.ratingKey))
1092-
self._server.query(data, method=self._server._session.put)
1090+
poster.select()
10931091

10941092
# def edit(self, **kwargs):
10951093
# TODO

plexapi/playlist.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,4 @@ def uploadPoster(self, url=None, filepath=None):
286286

287287
def setPoster(self, poster):
288288
""" Set . :class:`~plexapi.media.Poster` to :class:`~plexapi.video.Video` """
289-
key = poster._initpath[:-1]
290-
data = '%s?url=%s' % (key, quote_plus(poster.ratingKey))
291-
self._server.query(data, method=self._server._session.put)
289+
poster.select()

0 commit comments

Comments
 (0)