Merge remote-tracking branch 'tempo/RAWPictureTranscoding' into develop

This commit is contained in:
tomkat83 2017-01-15 17:34:38 +01:00
commit ccaeca0019

View file

@ -2361,6 +2361,13 @@ class API():
listItem.setProperty('IsPlayable', 'true') listItem.setProperty('IsPlayable', 'true')
if settings('useDirectPaths') == '0': if settings('useDirectPaths') == '0':
# Addon paths # Addon paths
if not self.item[0][0].attrib['key'][self.item[0][0].attrib['key'].rfind('.'):].lower() in ('.bmp', '.jpg', '.jpeg', '.gif', '.png', '.tiff', '.mng', '.ico', '.pcx', '.tga'):
# Check if Kodi supports the file, if not transcode it by Plex
# extensions from: http://kodi.wiki/view/Features_and_supported_codecs#Format_support (RAW image formats, BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX and Targa/TGA)
path = str(self.server) + str(PlexAPI().getTranscodeImagePath(self.item[0][0].attrib.get('key'), window('pms_token'), "%s%s" % (self.server, self.item[0][0].attrib.get('key')), 1920, 1080))
# max width/height supported by plex image transcoder is 1920x1080
else:
# Just give the path of the file to Kodi
path = self.addPlexCredentialsToUrl( path = self.addPlexCredentialsToUrl(
'%s%s' % (window('pms_server'), '%s%s' % (window('pms_server'),
self.item[0][0].attrib['key'])) self.item[0][0].attrib['key']))