]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/AosSeedController.php
basic alttp patcher
[alttp.git] / app / Http / Controllers / AosSeedController.php
index 3e3a2b05afcd293acd034bb2bf79f5e2e4daa9b4..7c7e5f9fdaf04012e1f52def459b52bfabc8b88e 100644 (file)
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
 
 use App\Models\AosSeed;
 use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Artisan;
 
 class AosSeedController extends Controller
 {
@@ -21,4 +22,16 @@ class AosSeedController extends Controller
                return $seed->toJson();
        }
 
+       public function retry($hash) {
+               $seed = AosSeed::where('hash', '=', $hash)->firstOrFail();
+
+               if ($seed->status == 'error') {
+                       $seed->status = 'pending';
+                       $seed->save();
+                       Artisan::call('aos:generate '.intval($seed->id));
+               }
+
+               return $seed->toJson();
+       }
+
 }