Skip to content

Commit

Permalink
Merge pull request #599 from bloerwald/issue_597-thumbnails_and_cover…
Browse files Browse the repository at this point in the history
…_art_missing

API: getTranscodeImagePath: adopt to less lenient PMS API

Thank you very much.
  • Loading branch information
moodyblue authored Jun 11, 2021
2 parents ec16bce + b142706 commit 25c8681
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions PlexAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,10 +877,6 @@ def getTranscodeImagePath(key, AuthToken, path, width, height):
path = 'http://127.0.0.1:32400' + path + '/' + key
path = path.encode('utf8')

# This is bogus (note the extra path component) but ATV is stupid when it comes to caching images, it doesn't use querystrings.
# Fortunately PMS is lenient...
transcodePath = '/photo/:/transcode/' +str(width)+'x'+str(height)+ '/' + quote_plus(path)

args = dict()
args['width'] = width
args['height'] = height
Expand All @@ -889,7 +885,8 @@ def getTranscodeImagePath(key, AuthToken, path, width, height):
if not AuthToken=='':
args['X-Plex-Token'] = AuthToken

return transcodePath + '?' + urlencode(args)
# ATV's cache ignores query strings, it does not ignore fragments though, so append the query as fragment as well.
return '/photo/:/transcode' + '?' + urlencode(args) + '#' + urlencode(args)



Expand Down

0 comments on commit 25c8681

Please sign in to comment.