From 1fca467f7d71db0a9738926b76323e2280432223 Mon Sep 17 00:00:00 2001 From: kremsy Date: Sun, 12 Jan 2014 22:31:50 +0100 Subject: [PATCH] improved mx class --- .../core/ManiaExchange/ManiaExchangeInfoSearcher.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php b/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php index 92b3e4de..d59d1960 100644 --- a/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php +++ b/application/core/ManiaExchange/ManiaExchangeInfoSearcher.php @@ -132,7 +132,8 @@ class ManiaExchangeInfoSearcher { //TODO rename to ManiaExchangeManager //If Max Maplimit is reached, or string gets too long send the request if($id % self::MAPS_PER_MX_FETCH == 0) { - $maps = $this->getMaplistByMixedUidIdString($mapIdString); + $mapIdString = substr($mapIdString, 0, -1); + $maps = $this->getMaplistByMixedUidIdString($mapIdString); $this->updateMapObjectsWithManiaExchangeIds($maps); $mapIdString = ''; } @@ -141,7 +142,8 @@ class ManiaExchangeInfoSearcher { //TODO rename to ManiaExchangeManager } if($mapIdString != '') { - $maps = $this->getMaplistByMixedUidIdString($mapIdString); + $mapIdString = substr($mapIdString, 0, -1); + $maps = $this->getMaplistByMixedUidIdString($mapIdString); $this->updateMapObjectsWithManiaExchangeIds($maps); } @@ -156,7 +158,6 @@ class ManiaExchangeInfoSearcher { //TODO rename to ManiaExchangeManager // compile search URL $url = 'http://api.mania-exchange.com/' . $titlePrefix . '/maps/?ids=' . $string; - // $mapInfo = FileUtil::loadFile($url, "application/json"); //TODO use mc fileutil $mapInfo = $this->get_file($url);