Disallow indexing (#320)

* Remove indexing

* Introduce replace_with_dosdevices

* Remove all direct indexing
This commit is contained in:
Philip Kristoffersen
2023-01-08 11:58:50 +01:00
committed by GitHub
parent 7b9966b4ff
commit 7dfbc01ed2
12 changed files with 117 additions and 98 deletions
+10 -5
View File
@@ -242,10 +242,15 @@ async fn search_for_images_to_download<T: SearchSettings>(
.await;
match image_search_result {
Ok(images) => {
let images = images
.iter()
.enumerate()
.map(|(index, image)| (image, shortcuts[index], image_ids[index]));
let images = images.iter().enumerate().filter_map(|(index, image)| {
if let (Some(shortcut), Some(image_id)) =
(shortcuts.get(index), image_ids.get(index))
{
Some((image, shortcut, image_id))
} else {
None
}
});
let download_for_this_type = stream::iter(images)
.filter_map(|(image, shortcut, game_id)| {
let extension = image
@@ -257,7 +262,7 @@ async fn search_for_images_to_download<T: SearchSettings>(
async move {
let image_url = match image {
Ok(img) => Some(img.url.clone()),
Err(_) => get_steam_image_url(game_id, &image_type).await,
Err(_) => get_steam_image_url(*game_id, &image_type).await,
};
image_url.map(|url| ToDownload {
path,