# HG changeset patch # User Goffi # Date 1597390292 -7200 # Node ID b525fdcb393bd02143cbeb624ac4b0013fe56e0b # Parent ed28ad7d484c0c35820addd90dfb4c1ec7f7635d browser (photos/album): used biggest thumbnails instead of original image for slideshow: biggest thumbnail should be adapted to fullscreen slideshow, and it's better to use than original image which may have a size of several megabytes. diff -r ed28ad7d484c -r b525fdcb393b libervia/pages/photos/album/_browser/__init__.py --- a/libervia/pages/photos/album/_browser/__init__.py Fri Aug 14 09:31:32 2020 +0200 +++ b/libervia/pages/photos/album/_browser/__init__.py Fri Aug 14 09:31:32 2020 +0200 @@ -161,7 +161,13 @@ slideshow.attach() for idx, item_elt in enumerate(document.select('.item')): item = JSON.parse(item_elt.dataset.item) - slideshow.add_slide(html.IMG(src=item['url'], Class="slide_img"), item) + try: + biggest_thumb = item['extra']['thumbnails'][-1] + thumb_url = f"{cache_path}{biggest_thumb['filename']}" + except (KeyError, IndexError) as e: + print(f"Can't get full screen thumbnail URL: {e}") + thumb_url = item['url'] + slideshow.add_slide(html.IMG(src=thumb_url, Class="slide_img"), item) if item_elt == clicked_item_elt: slideshow.index = idx