2024-10-11 08:02:45 +02:00
|
|
|
<?php
|
|
|
|
|
2024-10-11 11:20:39 +02:00
|
|
|
use App\Models\Episode as EpisodeModel;
|
2024-10-11 08:02:45 +02:00
|
|
|
use App\Subtitles as AppSubtitles;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
2024-10-18 17:47:20 +02:00
|
|
|
use Wikidata\Wikidata;
|
2024-10-29 21:27:29 +01:00
|
|
|
use Podlove\Webvtt\Parser;
|
|
|
|
use Podlove\Webvtt\ParserException;
|
|
|
|
|
2024-10-18 17:47:20 +02:00
|
|
|
|
|
|
|
use App\Models\Episode;
|
2024-10-11 08:02:45 +02:00
|
|
|
|
|
|
|
Route::get('/', function () {
|
2024-10-18 17:47:20 +02:00
|
|
|
$episodes = Episode::all();
|
|
|
|
return view('list', ['episodes' => $episodes]);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
Route::get('/detail/{id}', function(int $id) {
|
|
|
|
|
|
|
|
$ep = Episode::find($id);
|
|
|
|
$title = $ep->title;
|
|
|
|
$subtitles = $ep->subtitles;
|
|
|
|
$mediacomposition = json_decode($ep->mediacomposition, 1);
|
2024-10-11 08:02:45 +02:00
|
|
|
|
2024-10-29 21:27:29 +01:00
|
|
|
$parser = new Podlove\Webvtt\Parser();
|
|
|
|
$subtitles = $parser->parse($subtitles);
|
|
|
|
//dump($subtitles);
|
|
|
|
|
2024-10-18 17:47:20 +02:00
|
|
|
return view('detail', ['title' => $title, 'subtitles' => $subtitles, 'mediacomposition' => $mediacomposition]);
|
2024-10-11 08:02:45 +02:00
|
|
|
|
|
|
|
});
|