Misc bugfixes.
authorCameron Ball <cameron@getapproved.com.au>
Wed, 26 Nov 2014 03:52:45 +0000 (11:52 +0800)
committerCameron Ball <cameron@getapproved.com.au>
Wed, 26 Nov 2014 03:52:45 +0000 (11:52 +0800)
Controllers/SimfileController.php
Domain/Entities/StepMania/IPackBuilder.php
Domain/Entities/StepMania/PackBuilder.php
Domain/Entities/StepMania/PackStepByStepBuilder.php
Services/SimfileParser.php

index ecf04b2..28a3061 100644 (file)
@@ -103,7 +103,7 @@ class SimfileController implements IDivineController
                 //I tried to be clever and call pack() multiple times thinking I was getting the same\r
                 //object. Should I cache it in zipparser?\r
                 $pack = $zipParser->pack();\r
-                $this->_fileRepository->save($pack->getBanner());\r
+                $packBanner = $pack->getBanner() ? $this->_fileRepository->save($pack->getBanner()) : null;\r
                 $this->_packRepository->save($pack);\r
             }\r
             \r
index d99c53e..546558b 100644 (file)
@@ -10,7 +10,7 @@ interface IPackBuilder
     public function With_Title($title);
     public function With_Uploader(IUser $uploader);
     public function With_Simfiles(array $simfiles);
-    public function With_Banner(IFile $banner);
+    public function With_Banner(IFile $banner = null);
     public function With_File(IFile $file);
     public function build();
 }
\ No newline at end of file
index 3abb934..3e42cc1 100644 (file)
@@ -29,7 +29,7 @@ class PackBuilder implements IPackBuilder
         return $this;
     }
     
-    public function With_Banner(IFile $banner)
+    public function With_Banner(IFile $banner = null)
     {
         $this->_banner = $banner;
     }
index 3c02ed1..ac2ed5d 100644 (file)
@@ -23,7 +23,7 @@ interface IPackStepByStepBuilder_With_Uploader
 
 interface IPackStepByStepBuilder_With_Simfiles
 {
-    public function With_Banner(IFile $banner);
+    public function With_Banner(IFile $banner = null);
     public function With_File(IFile $file);
     public function build();
 }
@@ -69,7 +69,7 @@ class PackStepByStepBuilder_With_Uploader extends AbstractPackStepByStepBuilder
 
 class PackStepByStepBuilder_With_Simfiles extends AbstractPackStepByStepBuilder implements IPackStepByStepBuilder_With_Simfiles
 {
-    public function With_Banner(IFile $banner)
+    public function With_Banner(IFile $banner = null)
     {
         $this->_packBuilder->With_Banner($banner);
         return $this;
index b5c0c64..b2438d0 100644 (file)
@@ -67,6 +67,7 @@ class SimfileParser implements ISimfileParser
         if($displayBpm)
         {
             $bpmRange = explode(":",$displayBpm);
+            $bpmRange[1] = @$bpmRange[1] ?: $bpmRange[0];
         } else {
             $bpms = $this->extractKey('BPMS');
             $bpmRange = $this->parseBpms($bpms);