Skip to content

Commit

Permalink
store temp files extensionless
Browse files Browse the repository at this point in the history
  • Loading branch information
pannal committed Sep 9, 2018
1 parent 0ea5fe0 commit 023b39e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/_included_packages/plexnet/plexplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ def build(self, item=None):
path = part.key or part.thumb
server = item.getServer()

obj.path = path
obj.url = server.buildUrl(path, True)
obj.enableBlur = server.supportsPhotoTranscoding

Expand Down
9 changes: 4 additions & 5 deletions lib/windows/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def _showPhoto(self):
if isCurrent and not self.initialLoad:
self.setBoolProperty('is.updating', True)

path, background = self.getCachedPhotoData(meta.path, url, bgURL)
path, background = self.getCachedPhotoData(url, bgURL)
if not (path and background):
return

Expand Down Expand Up @@ -327,14 +327,13 @@ def _showPhoto(self):
finally:
self.setBoolProperty('is.updating', False)

def getCachedPhotoData(self, path, url, bgURL):
def getCachedPhotoData(self, url, bgURL):
if not url:
return

ext = os.path.splitext(path)[1]
basename = hashlib.sha1(url).hexdigest()
tmpPath = os.path.join(self.tempFolder, basename + ext)
tmpBgPath = os.path.join(self.tempFolder, "%s_bg%s" % (basename, ext))
tmpPath = os.path.join(self.tempFolder, basename)
tmpBgPath = os.path.join(self.tempFolder, "%s_bg" % basename)

for p, url in ((tmpPath, url), (tmpBgPath, bgURL)):
if not os.path.exists(p):# and not xbmc.getCacheThumbName(tmpFn):
Expand Down

0 comments on commit 023b39e

Please sign in to comment.