mirror of
https://github.com/Qortal/qortal.git
synced 2025-02-14 11:15:49 +00:00
Add "percentLoaded" to resource statuses.
This commit is contained in:
parent
a83e332c11
commit
073d124aef
@ -34,6 +34,7 @@ public class ArbitraryResourceStatus {
|
|||||||
|
|
||||||
private Integer localChunkCount;
|
private Integer localChunkCount;
|
||||||
private Integer totalChunkCount;
|
private Integer totalChunkCount;
|
||||||
|
private Float percentLoaded;
|
||||||
|
|
||||||
public ArbitraryResourceStatus() {
|
public ArbitraryResourceStatus() {
|
||||||
}
|
}
|
||||||
@ -45,6 +46,7 @@ public class ArbitraryResourceStatus {
|
|||||||
this.description = status.description;
|
this.description = status.description;
|
||||||
this.localChunkCount = localChunkCount;
|
this.localChunkCount = localChunkCount;
|
||||||
this.totalChunkCount = totalChunkCount;
|
this.totalChunkCount = totalChunkCount;
|
||||||
|
this.percentLoaded = (this.localChunkCount != null && this.totalChunkCount != null) ? this.localChunkCount / (float)this.totalChunkCount * 100.0f : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArbitraryResourceStatus(Status status) {
|
public ArbitraryResourceStatus(Status status) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user