From f043ae4a6149bc9aefad8f62765121097f84f879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Vasconcellos?= Date: Wed, 8 May 2024 22:39:05 -0300 Subject: [PATCH] Fix thumb reactivity in non indexed locations --- core/src/location/non_indexed.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/src/location/non_indexed.rs b/core/src/location/non_indexed.rs index 5c93ff650838..6c69cc7b3f70 100644 --- a/core/src/location/non_indexed.rs +++ b/core/src/location/non_indexed.rs @@ -198,7 +198,7 @@ pub async fn walk( } }; - let thumbnail_key = if should_generate_thumbnail { + let (thumbnail_key, has_created_thumbnail) = if should_generate_thumbnail { if let Ok(cas_id) = generate_cas_id(&path, entry.metadata.len()) .await @@ -221,12 +221,18 @@ pub async fn walk( )); } - Some(get_ephemeral_thumb_key(&cas_id)) + ( + Some(get_ephemeral_thumb_key(&cas_id)), + library + .thumbnail_exists(&node, &cas_id) + .await + .map_err(NonIndexedLocationError::from)?, + ) } else { - None + (None, false) } } else { - None + (None, false) }; tx.send(Ok(ExplorerItem::NonIndexedPath { @@ -242,7 +248,7 @@ pub async fn walk( date_modified: entry.metadata.modified_or_now().into(), size_in_bytes_bytes: entry.metadata.len().to_be_bytes().to_vec(), }, - has_created_thumbnail: true, + has_created_thumbnail, })) .await?; }