Skip to content

Commit

Permalink
Fix: Fixed issue where smart extraction would not work correctly for …
Browse files Browse the repository at this point in the history
…one folder (files-community#14395)
  • Loading branch information
hishitetsu authored Jan 9, 2024
1 parent 97fa781 commit 0cf6e5a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Files.App/Utils/Archives/DecompressHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,14 @@ private static async Task<bool> IsMultipleItems(BaseStorageFile archive)
if (zipFile is null)
return true;

return zipFile.ArchiveFileData.Count > 1;
return zipFile.ArchiveFileData.Select(file =>
{
var pathCharIndex = file.FileName.IndexOfAny(['/', '\\']);
if (pathCharIndex == -1)
return file.FileName;
else
return file.FileName.Substring(0, pathCharIndex);
}).Distinct().Count() > 1;
}
}
}

0 comments on commit 0cf6e5a

Please sign in to comment.