This commit is contained in:
sxyazi 2023-09-14 09:49:35 +08:00
parent 15eed55a54
commit b73f3fc01a
No known key found for this signature in database

View file

@ -33,14 +33,14 @@ impl FilesSorter {
match self.by {
SortBy::Alphabetical => items.sort_unstable_by(|a, b| {
if self.sensitive {
return self.cmp(&*a.url, &*b.url, self.promote(a, b));
}
self.cmp(
a.url.deref().as_os_str().to_ascii_lowercase(),
b.url.deref().as_os_str().to_ascii_lowercase(),
a.url.as_os_str().to_ascii_lowercase(),
b.url.as_os_str().to_ascii_lowercase(),
self.promote(a, b),
)
} else {
self.cmp(&*a.url, &*b.url, self.promote(a, b))
}
}),
SortBy::Created => items.sort_unstable_by(|a, b| {
if let (Ok(aa), Ok(bb)) = (a.meta.created(), b.meta.created()) {