]> git.localhorst.tv Git - alttp.git/commitdiff
stream links
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 8 Jul 2025 13:01:58 +0000 (15:01 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 8 Jul 2025 13:01:58 +0000 (15:01 +0200)
app/Console/Commands/SyncEnemizer.php
resources/js/components/episodes/MultiLink.jsx
resources/js/i18n/de.js
resources/js/i18n/en.js

index 553ac11a7ed538608d00f83d2732bcd5f782b6fe..ed68c03ad48d08bf10bd812d3f6fe43c151d0364 100644 (file)
@@ -95,10 +95,16 @@ class SyncEnemizer extends Command {
                        $player->ext_id = $ext_id;
                        $player->episode()->associate($episode);
                }
+               $stream_link = (!empty($twitch) && $twitch != 'No Data') ? 'https://twitch.tv/'.$twitch : '';
                $user = $this->getUser($discord, $twitch);
                $player->name_override = $discord;
+               $player->stream_override = $stream_link;
                if ($user) {
                        $player->user()->associate($user);
+                       if (!$user->stream_link && !empty($stream_link)) {
+                               $user->stream_link = $stream_link;
+                               $user->save();
+                       }
                } else {
                        $player->user()->disassociate();
                }
index 2f737dd0c087d264d1d0294ba7e5dc4bcd4b892e..5f127b53da944b8052fa85b1dd9753fd04dcc12a 100644 (file)
@@ -1,24 +1,38 @@
 import PropTypes from 'prop-types';
 import React from 'react';
 import { Button } from 'react-bootstrap';
+import { useTranslation } from 'react-i18next';
 
 import Icon from '../common/Icon';
 import { getStreamLink } from '../../helpers/Crew';
 
 const MultiLink = ({ players }) => {
+       const { t } = useTranslation();
+
        const streams = players.map(getStreamLink);
        const names = streams.map(s => s.split('/').pop());
        const url = `https://multistre.am/${names.join('/')}`;
 
+       if (names.indexOf('') !== -1) {
+               return <div className="episode-channel">
+                       <Button
+                               title={t('episodes.missingStreams')}
+                               variant="outline-warning"
+                       >
+                               <Icon.WARNING title="" />
+                       </Button>
+               </div>;
+       }
+
        return <div className="episode-channel">
                <Button
                        href={url}
                        rel="noreferer"
                        target="_blank"
-                       title="MultiTwitch"
+                       title="MultiStream"
                        variant="outline-twitch"
                >
-                       <Icon.STREAM />
+                       <Icon.STREAM title="" />
                        {' MultiStream'}
                </Button>
        </div>;
index e96ed3ed1c8a75c7d5930edda991702040525a5b..05c893d304d72315de4b3e14dcf45224734d9875 100644 (file)
@@ -205,6 +205,7 @@ export default {
                        channel: 'Kanal',
                        commentary: 'Kommentar',
                        empty: 'Keine anstehenden Termine.',
+                       missingStreams: 'Fehlende Runner-Streams',
                        raceroom: 'Raceroom',
                        restreamDialog: {
                                acceptComms: 'Suche Kommentatoren',
index c84f9587b66ecb483fe89cf5bacb405898774ded..4cf5e58b05d31cf96a19821250c92efdc89f8caf 100644 (file)
@@ -205,6 +205,7 @@ export default {
                        channel: 'Channel',
                        commentary: 'Commentary',
                        empty: 'No dates coming up.',
+                       missingStreams: 'Missing runner streams',
                        raceroom: 'Race room',
                        restreamDialog: {
                                acceptComms: 'Open commentary application',