From 7f11a12f99a65d1d6756ed801b1a5a31a97d6c3f Mon Sep 17 00:00:00 2001 From: Arne Hamann Date: Sat, 7 Jan 2023 23:45:14 +0100 Subject: [PATCH 1/3] Performance Improvements Photos Signed-off-by: Arne Hamann --- lib/Service/GeophotoService.php | 1 - src/components/AppNavigationPhotosItem.vue | 27 +- src/components/Map.vue | 7 +- src/components/map/PhotoSuggestionsLayer.vue | 8 +- src/components/map/PhotosLayer.vue | 261 +++++++++++++++--- .../map/Vue2LeafletDelayedMarkerCluster.vue | 6 +- src/views/App.vue | 45 ++- 7 files changed, 287 insertions(+), 68 deletions(-) diff --git a/lib/Service/GeophotoService.php b/lib/Service/GeophotoService.php index 137f2b8c0..f08aac924 100644 --- a/lib/Service/GeophotoService.php +++ b/lib/Service/GeophotoService.php @@ -158,7 +158,6 @@ public function getAllFromDB(string $userId, $folder=null, bool $respectNomediaA } $this->photosCache->set($key, $filesById, 60 * 60 * 24); } - shuffle($filesById); return $filesById; } diff --git a/src/components/AppNavigationPhotosItem.vue b/src/components/AppNavigationPhotosItem.vue index 3b61e471e..35dd3d131 100644 --- a/src/components/AppNavigationPhotosItem.vue +++ b/src/components/AppNavigationPhotosItem.vue @@ -6,9 +6,16 @@ :allow-collapse="false" :force-menu="enabled" @click="$emit('photos-clicked')"> - - {{ photos.length > 1000 ? Math.floor(photos.length/1000).toString() + 'k' : photos.length > 99 ? '99+' : photos.length }} + {{ + (loadedPhotos > 1000 ? Math.floor(loadedPhotos/1000).toString() + 'k' : loadedPhotos > 99 ? '99+' : loadedPhotos) + '/' + + (totalPhotos > 1000 ? Math.floor(totalPhotos/1000).toString() + 'k' : totalPhotos > 99 ? '99+' : totalPhotos) + }} + + + {{ totalPhotos > 1000 ? Math.floor(totalPhotos/1000).toString() + 'k' : totalPhotos > 99 ? '99+' : totalPhotos }}