forked from Qortal/qortal
Fixed bugs causing websites to report as "Not published" when listed in the UI.
This commit is contained in:
parent
4ba2f7ad6a
commit
3077810ea8
@ -43,6 +43,7 @@ public class ArbitraryDataResource {
|
|||||||
private int layerCount;
|
private int layerCount;
|
||||||
private Integer localChunkCount = null;
|
private Integer localChunkCount = null;
|
||||||
private Integer totalChunkCount = null;
|
private Integer totalChunkCount = null;
|
||||||
|
private boolean exists = false;
|
||||||
|
|
||||||
public ArbitraryDataResource(String resourceId, ResourceIdType resourceIdType, Service service, String identifier) {
|
public ArbitraryDataResource(String resourceId, ResourceIdType resourceIdType, Service service, String identifier) {
|
||||||
this.resourceId = resourceId.toLowerCase();
|
this.resourceId = resourceId.toLowerCase();
|
||||||
@ -61,11 +62,10 @@ public class ArbitraryDataResource {
|
|||||||
// Avoid this for "quick" statuses, to speed things up
|
// Avoid this for "quick" statuses, to speed things up
|
||||||
if (!quick) {
|
if (!quick) {
|
||||||
this.calculateChunkCounts();
|
this.calculateChunkCounts();
|
||||||
}
|
|
||||||
|
|
||||||
if (this.totalChunkCount == null || this.totalChunkCount == 0) {
|
if (!this.exists) {
|
||||||
// Assume not published
|
return new ArbitraryResourceStatus(Status.NOT_PUBLISHED, this.localChunkCount, this.totalChunkCount);
|
||||||
return new ArbitraryResourceStatus(Status.NOT_PUBLISHED, this.localChunkCount, this.totalChunkCount);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resourceIdType != ResourceIdType.NAME) {
|
if (resourceIdType != ResourceIdType.NAME) {
|
||||||
@ -224,11 +224,14 @@ public class ArbitraryDataResource {
|
|||||||
try {
|
try {
|
||||||
this.fetchTransactions();
|
this.fetchTransactions();
|
||||||
if (this.transactions == null) {
|
if (this.transactions == null) {
|
||||||
|
this.exists = false;
|
||||||
this.localChunkCount = 0;
|
this.localChunkCount = 0;
|
||||||
this.totalChunkCount = 0;
|
this.totalChunkCount = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.exists = true;
|
||||||
|
|
||||||
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
List<ArbitraryTransactionData> transactionDataList = new ArrayList<>(this.transactions);
|
||||||
int localChunkCount = 0;
|
int localChunkCount = 0;
|
||||||
int totalChunkCount = 0;
|
int totalChunkCount = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user