Skip to content
Permalink
Browse files

add error page for failed conversion

  • Loading branch information...
kabel2 committed Aug 5, 2017
1 parent 901319a commit 904c74a810059d09ccb1867e8ce0f1a02af37a13
@@ -9,6 +9,11 @@ public function index()
return view('statics.index');
}
public function error()
{
return view('statics.error');
}
public function converter()
{
return view('converter.home');
@@ -310,4 +310,7 @@ private function isGif()
return false;
}
}
public function failed(){
DB::table('data')->where('guid', $this->name)->update(['progress' => 420]);
}
}
@@ -62,4 +62,8 @@ public function handle()
File::move($video->getFile()->getPathname(), $this->loc.'/'.$this->name);
dispatch((new ConvertVideo($this->loc, $this->name, $this->sound, $this->res, $this->limit, $this->start, $this->end))->onQueue('convert'));
}
public function failed(){
// 420 = error
DB::table('data')->where('guid', $this->name)->update(['progress' => 420]);
}
}

Some generated files are not rendered by default. Learn more.

@@ -11,6 +11,8 @@ $(function () {
}).done(function (data) {
if (data === 'error') {
document.location.href = '/';
} else if(data === '420'){
document.location.href = '/error';
} else {
$('#bar').width(data + '%').html(data + '%');
if (data === '100') {
@@ -0,0 +1,11 @@
@extends('layouts.app')
@section('content')

<div class="flex-center position-ref full-height">

</div>
<div class="content">
<div class="title m-b-md">
Fehler beim konvertieren, video kaputt ¯\_(ツ)_/¯
</div>
@endsection
@@ -21,6 +21,10 @@
Route::get('contact', 'StaticsController@contact')->name('contact');
});
Route::group(['prefix' => 'error', 'middleware' => 'web'], function () {
Route::get('', 'StaticsController@error')->name('error');
});
/*
* Dynamic content
*/

0 comments on commit 904c74a

Please sign in to comment.
You can’t perform that action at this time.