{\r
foreach($pack->getFile()->getMirrors() as $mirror)\r
{\r
- $packMirrors = $mirror->getUri();\r
+ $packMirrors[] = array('source' => $mirror->getSource(), 'uri' => $mirror->getUri());\r
}\r
}\r
\r
//XXX: Direct instantiation of FileMirror bad?\r
if($match && $match['confidence'] > 90)\r
{\r
- $file->addMirror(new \Domain\VOs\FileMirror($match['href']));\r
+ $file->addMirror(new \Domain\VOs\FileMirror($match['href'], 'Stepmania Online'));\r
}\r
}\r
\r
}\r
}\r
\r
- return array(\r
+ return array( \r
'title' => $simfile->getTitle(),\r
'artist' => $simfile->getArtist()->getName(),\r
'steps' => array(\r
'bgChanges' => $simfile->hasBgChanges() ? 'Yes' : 'No',\r
'fgChanges' => $simfile->hasFgChanges() ? 'Yes' : 'No',\r
'bpmChanges' => $simfile->hasBPMChanges() ? 'Yes' : 'No',\r
- 'banner' => $simfile->getBanner() ? 'files/banner/' . $simfile->getBanner()->getHash() : 'files/banner/default'\r
+ 'banner' => $simfile->getBanner() ? 'files/banner/' . $simfile->getBanner()->getHash() : 'files/banner/default',\r
+ 'download' => $simfile->getSimfile() ? 'files/simfile/' . $simfile->getSimfile()->getHash() : null\r
);\r
}\r
}\r
class FileMirror implements IFileMirror
{
private $_uri;
+ private $_source;
- public function __construct($uri)
+ public function __construct($uri, $source)
{
$this->_uri = $uri;
+ $this->_source = $source;
}
public function getUri()
{
return $this->_uri;
}
+
+ public function getSource()
+ {
+ return $this->_source;
+ }
}
'class' => 'Domain\VOs\FileMirror',\r
'table' => 'mirrors',\r
'maps' => [\r
- 'uri' => DataAccess\Varchar('uri')\r
+ 'uri' => DataAccess\Varchar('uri'),\r
+ 'source' => DataAccess\Varchar('source')\r
]\r
]\r
];\r