\r
public function __construct(\r
$title,\r
- IArtist $artist,\r
+ IArtist $artist = null,\r
IUser $uploader,\r
IBPM $bpm,\r
$bpmChanges,\r
return $this;\r
}\r
\r
- public function With_Artist(IArtist $artist) {\r
+ public function With_Artist(IArtist $artist = null) {\r
$this->_artist = $artist;\r
return $this;\r
}\r
{\r
public function createInstance(\r
$title,\r
- IArtist $artist,\r
+ IArtist $artist = null,\r
IUser $uploader,\r
IBPM $bpm,\r
$bpmChanges,\r
{\r
public function createInstance(\r
$title,\r
- IArtist $artist,\r
+ IArtist $artist = null,\r
IUser $uploader,\r
IBPM $bpm,\r
$bpmChanges,\r
\r
interface ISimfileStepByStepBuilder_With_Title\r
{\r
- public function With_Artist(IArtist $artist);\r
-}\r
-\r
-interface ISimfileStepByStepBuilder_With_Artist\r
-{\r
+ public function With_Artist(IArtist $artist = null);\r
public function With_Uploader(IUser $uploader);\r
}\r
\r
\r
class SimfileStepByStepBuilder_With_Title extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_Title\r
{ \r
- public function With_Artist(IArtist $artist)\r
+ public function With_Artist(IArtist $artist = null)\r
{\r
$this->_simfileBuilder->With_Artist($artist);\r
- return new SimfileStepByStepBuilder_With_Artist($this->_simfileBuilder);\r
+ return $this;\r
}\r
-}\r
-\r
-class SimfileStepByStepBuilder_With_Artist extends AbstractSimfileStepByStepBuilder implements ISimfileStepByStepBuilder_With_Artist\r
-{ \r
+ \r
public function With_Uploader(IUser $uploader)\r
{\r
$this->_simfileBuilder->With_Uploader($uploader);\r
);\r
\r
public function __construct($name) {\r
- $ucName = ucfirst($name);\r
+ $ucName = ucfirst(strtolower($name));\r
if(array_key_exists($ucName, $this->_namesToSmNames)) {\r
$this->stepManiaName = $this->_namesToSmNames[$ucName];\r
$this->itgName = $this->_smNamesToItgNames[$this->stepManiaName];\r
public function artist()
{
$artist = $this->extractKey('ARTIST');
- if(!$artist) throw new Exception ('Invalid SM file. ARTIST missing');
+ //XXX: Artist can be null
+ if(!$artist)return null;
//XXX: UTF8 encode to deal with unusual character that crop up in weeaboo shit.
return new \Domain\VOs\StepMania\Artist(utf8_encode($artist));
throw new Exception('Malformed zip. I found more than 1 sm file but the directory structure is not consistent with a pack.');
}
- return $packName;
+ return utf8_encode($packName);
}
private function SmDataToSmClass($smData)