mxlist adjustments for mp4

This commit is contained in:
kremsy
2017-05-12 21:16:54 +02:00
parent 84eec14b8d
commit b202ea7dc8
3 changed files with 16 additions and 47 deletions

View File

@ -85,6 +85,7 @@ class ManiaExchangeMapSearch implements UsageInformationAble {
private $ghostBlocks = null;
private $embeddedObjects = null;
private $key = null;
private $mp4 = null;
/** @var ManiaControl $maniaControl */
private $maniaControl = null;
@ -105,19 +106,20 @@ class ManiaExchangeMapSearch implements UsageInformationAble {
$this->url = 'https://' . $this->titlePrefix . '.mania-exchange.com/tracksearch2/search?api=on';
if ($key = $this->maniaControl->getSettingManager()->getSettingValue($this->maniaControl->getMapManager()->getMXManager(), ManiaExchangeManager::SETTING_MX_KEY)) {
/*if ($key = $this->maniaControl->getSettingManager()->getSettingValue($this->maniaControl->getMapManager()->getMXManager(), ManiaExchangeManager::SETTING_MX_KEY)) {
$this->url .= "&key=" . $key;
}
}*/
//Set some defaults:
$this->mapLimit = 100;
$this->priorityOrder = self::SEARCH_ORDER_UPDATED_NEWEST;
$this->mp4 = true;
//Set Min Exe Build Default for games which are not Trackmania
if ($this->titlePrefix !== "tm") {
/*if ($this->titlePrefix !== "tm") {
$this->minExeBuild = ManiaExchangeManager::MIN_EXE_BUILD;
}
}*/
//Set MapTypes
try {
@ -222,6 +224,9 @@ class ManiaExchangeMapSearch implements UsageInformationAble {
if (isset($this->key)) {
$parameters .= "&key=" . $this->key;
}
if (isset($this->mp4)){
$parameters .= "&mp4=" . $this->mp4;
}
$asyncHttpRequest = new AsyncHttpRequest($this->maniaControl, $this->url . $parameters);
$asyncHttpRequest->setContentType(AsyncHttpRequest::CONTENT_TYPE_JSON);