Include file size.
authorCameron Ball <cameron@getapproved.com.au>
Fri, 5 Dec 2014 02:32:03 +0000 (10:32 +0800)
committerCameron Ball <cameron@getapproved.com.au>
Fri, 5 Dec 2014 02:32:03 +0000 (10:32 +0800)
Controllers/SimfileController.php

index 2763fd6..ab63396 100644 (file)
@@ -13,6 +13,7 @@ use DataAccess\StepMania\IPackRepository;
 use DataAccess\IFileRepository;\r
 use Domain\Entities\StepMania\ISimfile;\r
 use Domain\Entities\IFile;\r
+use Domain\Util;\r
 \r
 class SimfileController implements IDivineController\r
 {\r
@@ -89,7 +90,8 @@ class SimfileController implements IDivineController
                 'contributors' => $pack->getContributors(),\r
                 'simfiles' => $packSimfiles,\r
                 'banner' => $pack->getBanner() ? 'files/banner/' . $pack->getBanner()->getHash() : 'files/banner/default',\r
-                'mirrors' => $packMirrors\r
+                'mirrors' => $packMirrors,\r
+                'size' => $pack->getFile() ? Util::bytesToHumanReadable($pack->getFile()->getSize()) : null\r
             );\r
         }\r
         \r
@@ -181,7 +183,8 @@ class SimfileController implements IDivineController
             'fgChanges' => $simfile->hasFgChanges() ? 'Yes' : 'No',\r
             'bpmChanges' => $simfile->hasBPMChanges() ? 'Yes' : 'No',\r
             'banner' => $simfile->getBanner() ? 'files/banner/' . $simfile->getBanner()->getHash() : 'files/banner/default',\r
-            'download' => $simfile->getSimfile() ?  'files/simfile/' . $simfile->getSimfile()->getHash() : null\r
+            'download' => $simfile->getSimfile() ?  'files/simfile/' . $simfile->getSimfile()->getHash() : null,\r
+            'size' => $simfile->getSimfile() ? Util::bytesToHumanReadable($simfile->getSimfile()->getSize()) : null\r
         );\r
     }\r
 }\r