mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-11-27 06:10:08 +08: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);
|
||||
items.setAll(files.stream()
|
||||
.filter(file -> file.getGameVersion().contains(gameVersion.get()))
|
||||
.sorted(Comparator.comparing(CurseAddon.LatestFile::getParsedFileDate).reversed())
|
||||
.collect(Collectors.toList()));
|
||||
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());
|
||||
|
||||
public interface Project {
|
||||
|
||||
}
|
||||
|
||||
public interface ProjectVersion {
|
||||
|
||||
}
|
||||
|
||||
public interface DownloadSource {
|
||||
|
||||
}
|
||||
|
||||
public interface DownloadCallback {
|
||||
void download(Profile profile, @Nullable String version, CurseAddon.LatestFile file);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user