Skip to content

Commit

Permalink
Fix thumb reactivity in non indexed locations
Browse files Browse the repository at this point in the history
  • Loading branch information
HeavenVolkoff committed May 9, 2024
1 parent 6451a78 commit f043ae4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions core/src/location/non_indexed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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?;
}
Expand Down

0 comments on commit f043ae4

Please sign in to comment.