forked from Qortal/qortal
Added "BLACKLISTED" status for arbitrary data resources.
This commit is contained in:
parent
3860c5d8ec
commit
7f41c7ab0e
@ -14,7 +14,8 @@ public class ArbitraryResourceSummary {
|
||||
READY,
|
||||
DOWNLOAD_FAILED,
|
||||
BUILD_FAILED,
|
||||
UNSUPPORTED
|
||||
UNSUPPORTED,
|
||||
BLACKLISTED
|
||||
}
|
||||
|
||||
public ArbitraryResourceStatus status;
|
||||
|
@ -6,6 +6,7 @@ import org.qortal.arbitrary.ArbitraryDataFile.ResourceIdType;
|
||||
import org.qortal.arbitrary.exception.MissingDataException;
|
||||
import org.qortal.arbitrary.misc.Service;
|
||||
import org.qortal.controller.arbitrary.ArbitraryDataBuildManager;
|
||||
import org.qortal.list.ResourceListManager;
|
||||
import org.qortal.repository.DataException;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -49,6 +50,12 @@ public class ArbitraryDataResource {
|
||||
return new ArbitraryResourceSummary(ArbitraryResourceStatus.BUILD_FAILED);
|
||||
}
|
||||
|
||||
// Check if the name is blacklisted
|
||||
if (ResourceListManager.getInstance()
|
||||
.listContains("blacklist", "names", this.resourceId, false)) {
|
||||
return new ArbitraryResourceSummary(ArbitraryResourceStatus.BLACKLISTED);
|
||||
}
|
||||
|
||||
// Check if we have all data locally for this resource
|
||||
ArbitraryDataBuilder builder = new ArbitraryDataBuilder(resourceId, service, identifier);
|
||||
builder.setCanRequestMissingFiles(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user