fix: sort mod downloads. Closes #942.

This commit is contained in:
huanghongxun
2021-08-05 01:50:59 +08:00
parent 1ad8beb49e
commit b8ca9a3b09
2 changed files with 19 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package org.jackhuang.hmcl.mod.curse;
import org.jackhuang.hmcl.util.Immutable;
import java.time.Instant;
import java.util.List;
@Immutable
@@ -293,6 +294,8 @@ public class CurseAddon {
private final boolean isServerPack;
private final int serverPackFileId;
private transient Instant fileDataInstant;
public LatestFile(int id, String displayName, String fileName, String fileDate, int fileLength, int releaseType, int fileStatus, String downloadUrl, boolean isAlternate, int alternateFileId, List<Dependency> dependencies, boolean isAvailable, List<String> gameVersion, boolean hasInstallScript, boolean isCompatibleWIthClient, int categorySectionPackageType, int restrictProjectFileAccess, int projectStatus, int projectId, boolean isServerPack, int serverPackFileId) {
this.id = id;
this.displayName = displayName;
@@ -400,6 +403,13 @@ public class CurseAddon {
public int getServerPackFileId() {
return serverPackFileId;
}
public Instant getParsedFileDate() {
if (fileDataInstant == null) {
fileDataInstant = Instant.parse(fileDate);
}
return fileDataInstant;
}
}
@Immutable