mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-11 21:06:37 -04:00
fix: sort mod download list page items. Closes #1001.
This commit is contained in:
parent
b3e3192876
commit
c844a77f02
@ -89,6 +89,7 @@ public class ModDownloadPage extends Control implements DecoratorPage {
|
|||||||
List<CurseAddon.LatestFile> files = CurseModManager.getFiles(addon);
|
List<CurseAddon.LatestFile> files = CurseModManager.getFiles(addon);
|
||||||
items.setAll(files.stream()
|
items.setAll(files.stream()
|
||||||
.filter(file -> file.getGameVersion().contains(gameVersion.get()))
|
.filter(file -> file.getGameVersion().contains(gameVersion.get()))
|
||||||
|
.sorted(Comparator.comparing(CurseAddon.LatestFile::getParsedFileDate).reversed())
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -276,6 +277,18 @@ public class ModDownloadPage extends Control implements DecoratorPage {
|
|||||||
|
|
||||||
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL).withLocale(Locale.getDefault()).withZone(ZoneId.systemDefault());
|
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL).withLocale(Locale.getDefault()).withZone(ZoneId.systemDefault());
|
||||||
|
|
||||||
|
public interface Project {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ProjectVersion {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface DownloadSource {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public interface DownloadCallback {
|
public interface DownloadCallback {
|
||||||
void download(Profile profile, @Nullable String version, CurseAddon.LatestFile file);
|
void download(Profile profile, @Nullable String version, CurseAddon.LatestFile file);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user