This commit is contained in:
Kovid Goyal 2017-02-14 09:05:50 +05:30
parent b294583b1f
commit 342a63244f

View File

@ -128,7 +128,7 @@ class ThumbnailCache:
def get(self, book_id, width, height, callback): def get(self, book_id, width, height, callback):
url = thumbnail_url(book_id, width, height) url = thumbnail_url(book_id, width, height)
item = self.cache.get(url) item = self.cache.get(url)
if item is None: if not item:
img = new Image() img = new Image()
item = {'img':img, 'load_type':None, 'callbacks':v'[callback]'} item = {'img':img, 'load_type':None, 'callbacks':v'[callback]'}
img.onerror = self.load_finished.bind(None, item, 'error') img.onerror = self.load_finished.bind(None, item, 'error')