Fix compilation without gfvs feature

This commit is contained in:
Jeremy Soller 2025-06-18 20:54:58 -06:00
parent 1ad5ec0398
commit b7d3d16d28
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA

View file

@ -5421,8 +5421,13 @@ impl Tab {
}; };
let metadata = item.metadata.clone(); let metadata = item.metadata.clone();
match metadata { let can_thumbnail = match metadata {
ItemMetadata::Path { .. } | ItemMetadata::GvfsPath { .. } => { ItemMetadata::Path { .. } => true,
#[cfg(feature = "gvfs")]
ItemMetadata::GvfsPath { .. } => true,
_ => false,
};
if can_thumbnail {
let mime = item.mime.clone(); let mime = item.mime.clone();
subscriptions.push(Subscription::run_with_id( subscriptions.push(Subscription::run_with_id(
@ -5432,17 +5437,9 @@ impl Tab {
let path = path.clone(); let path = path.clone();
tokio::task::spawn_blocking(move || { tokio::task::spawn_blocking(move || {
let start = Instant::now(); let start = Instant::now();
let thumbnail = ItemThumbnail::new( let thumbnail =
&path, ItemThumbnail::new(&path, metadata, mime, THUMBNAIL_SIZE);
metadata, log::debug!("thumbnailed {:?} in {:?}", path, start.elapsed());
mime,
THUMBNAIL_SIZE,
);
log::debug!(
"thumbnailed {:?} in {:?}",
path,
start.elapsed()
);
Message::Thumbnail(path.clone(), thumbnail) Message::Thumbnail(path.clone(), thumbnail)
}) })
.await .await
@ -5452,11 +5449,7 @@ impl Tab {
match output.send(message).await { match output.send(message).await {
Ok(()) => {} Ok(()) => {}
Err(err) => { Err(err) => {
log::warn!( log::warn!("failed to send thumbnail for {:?}: {}", &path, err);
"failed to send thumbnail for {:?}: {}",
&path,
err
);
} }
} }
@ -5464,8 +5457,6 @@ impl Tab {
}), }),
)); ));
} }
_ => {}
}
if subscriptions.len() >= jobs { if subscriptions.len() >= jobs {
break; break;