try to get preview from peers, fixes #79

This commit is contained in:
j 2016-01-21 12:35:49 +05:30
commit 5f8094bba3
5 changed files with 33 additions and 12 deletions

View file

@ -127,9 +127,8 @@ class Handler(http.server.SimpleHTTPRequestHandler):
self.wfile.write(b'404 - Not Found')
return
if preview:
from item.icons import icons
key = 'preview:' + id
data = icons[key]
from item.icons import get_icon_sync
data = get_icon_sync(id, 'preview', 512)
if data:
self.send_response(200, 'ok')
self.send_header('Content-type', 'image/jpg')