Skip to content

Commit 0cf6e5a

Browse files
authored
Fix: Fixed issue where smart extraction would not work correctly for one folder (#14395)
1 parent 97fa781 commit 0cf6e5a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Files.App/Utils/Archives/DecompressHelper.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,14 @@ private static async Task<bool> IsMultipleItems(BaseStorageFile archive)
287287
if (zipFile is null)
288288
return true;
289289

290-
return zipFile.ArchiveFileData.Count > 1;
290+
return zipFile.ArchiveFileData.Select(file =>
291+
{
292+
var pathCharIndex = file.FileName.IndexOfAny(['/', '\\']);
293+
if (pathCharIndex == -1)
294+
return file.FileName;
295+
else
296+
return file.FileName.Substring(0, pathCharIndex);
297+
}).Distinct().Count() > 1;
291298
}
292299
}
293300
}

0 commit comments

Comments
 (0)