maintanance and downloading files.

This commit is contained in:
Krzysztof Płaczek
2022-11-16 07:18:21 +01:00
parent 086e4b56b5
commit 21f61b0911
10 changed files with 88 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Http\SymfonyCastDl\HtmlParser;
use App\Http\SymfonyCastDl\SymfonyCastDlService;
use App\Jobs\DownloadVideoFile;
use App\Models\Chapter;
use App\Models\Course;
use Illuminate\View\View;
@@ -15,17 +16,10 @@ class CourseController extends Controller
return view('course.index', compact('course'));
}
public function chapter(Chapter $chapter, HtmlParser $htmlParser)
{
$service = new SymfonyCastDlService($htmlParser);
$service->videoSize($chapter);
dd($chapter->toArray());
}
public function sync(Course $course)
{
$course->chapters->each->update(['sync_offline' => 1]);
$course->chapters->each(fn($chapter) => DownloadVideoFile::dispatch($chapter->id));
return redirect(route('course.index', ['course' => $course]));
}