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,50 +5421,41 @@ 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,
let mime = item.mime.clone(); #[cfg(feature = "gvfs")]
ItemMetadata::GvfsPath { .. } => true,
_ => false,
};
if can_thumbnail {
let mime = item.mime.clone();
subscriptions.push(Subscription::run_with_id( subscriptions.push(Subscription::run_with_id(
("thumbnail", path.clone()), ("thumbnail", path.clone()),
stream::channel(1, |mut output| async move { stream::channel(1, |mut output| async move {
let message = { let message = {
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, Message::Thumbnail(path.clone(), thumbnail)
THUMBNAIL_SIZE, })
); .await
log::debug!( .unwrap()
"thumbnailed {:?} in {:?}", };
path,
start.elapsed()
);
Message::Thumbnail(path.clone(), thumbnail)
})
.await
.unwrap()
};
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
);
}
} }
}
std::future::pending().await std::future::pending().await
}), }),
)); ));
}
_ => {}
} }
if subscriptions.len() >= jobs { if subscriptions.len() >= jobs {