diff --git a/VANA-php/app/Srgssr/Episode.php b/VANA-php/app/Srgssr/Episode.php index 7eb4f13..9152400 100644 --- a/VANA-php/app/Srgssr/Episode.php +++ b/VANA-php/app/Srgssr/Episode.php @@ -47,7 +47,7 @@ class Episode extends Api $subtitles = new Subtitles; $subs = $subtitles->getWebVTT('urn:srf:episode:tv:'.$ep['id']); - $test = EpisodeModel::firstOrCreate( + $epModel = EpisodeModel::updateOrCreate( [ 'urn' => $ep['fullLengthUrn'] ], diff --git a/VANA-php/app/Srgssr/Subtitles.php b/VANA-php/app/Srgssr/Subtitles.php index a8a1289..23d4bda 100644 --- a/VANA-php/app/Srgssr/Subtitles.php +++ b/VANA-php/app/Srgssr/Subtitles.php @@ -18,13 +18,13 @@ class Subtitles extends Api public function getUrl(string $urn): string { + $response = Http::withHeaders($this->headers)->withQueryParameters([ 'episode' => $urn, ])->get($this->endpoint.'subtitles'); - - if($response->ok()){ - return $response->json()[0]['url']; + if($response->ok() && !empty($response[0]['url'])){ + return $response[0]['url']; } return false; @@ -34,9 +34,16 @@ class Subtitles extends Api public function getWebVTT(string $urn): ?string { $url = $this->getUrl($urn); - $response = Http::get($url); + $response = null; - if($response->successful()){ + if($url){ + $response = Http::get($url); + } else { + $altUrn = explode(":", $urn)[4]; + $response = Http::get("https://subtitles.eai-general.aws.srf.ch/srf/{$altUrn}/episode/de/vod/vod.vtt"); + } + + if($response && $response->successful()){ return $response->body(); } diff --git a/VANA-php/database/migrations/2025_01_16_210341_add_topics.php b/VANA-php/database/migrations/2025_01_16_210341_add_topics.php new file mode 100644 index 0000000..421f2cf --- /dev/null +++ b/VANA-php/database/migrations/2025_01_16_210341_add_topics.php @@ -0,0 +1,26 @@ +json('topics')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +}; diff --git a/VANA-php/resources/css/app.css b/VANA-php/resources/css/app.css index 5354718..321b444 100644 --- a/VANA-php/resources/css/app.css +++ b/VANA-php/resources/css/app.css @@ -47,6 +47,17 @@ input, button, textarea, select { font: inherit; } +input{ + margin-top: .2em; + border-radius: .2em; + border: 1px solid #fff; + background: var(--c3); + color: #fff; + padding: .2em .5em; + display: block; +} + + h1, h2, h3, @@ -294,6 +305,21 @@ main { background: var(--c3); } +.track-ctrl h2{ + font-size: 1.2em; +} + +.track-ctrl p { + margin-top: 1em; + font-size: 1em; + line-height: 1.5; +} + +.track-ctrl label { + margin-top: 1em; + display: inline-block; +} + .track-viz{ background: var(--c3); } diff --git a/VANA-php/resources/views/detail.blade.php b/VANA-php/resources/views/detail.blade.php index 48daa6a..5ed17f4 100644 --- a/VANA-php/resources/views/detail.blade.php +++ b/VANA-php/resources/views/detail.blade.php @@ -116,7 +116,10 @@

Topics

+