]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/EpisodeCrew.php
first simple twitch commands
[alttp.git] / app / Models / EpisodeCrew.php
index d06276e537d234d0b7e2e068910881cad8c43a1e..04bec5c7d68bdf209f9b9ef2ffac10de61e94e7f 100644 (file)
@@ -21,6 +21,31 @@ class EpisodeCrew extends Model
                return $this->belongsTo(User::class);
        }
 
+       public function getName() {
+               if (!empty($this->name_override)) {
+                       return $this->name_override;
+               }
+               if ($this->user) {
+                       if (!empty($this->user->nickname)) {
+                               return $this->user->nickname;
+                       }
+                       if (!empty($this->user->username)) {
+                               return $this->user->username;
+                       }
+               }
+               return '';
+       }
+
+       public function getStreamLink() {
+               if (!empty($this->stream_override)) {
+                       return $this->stream_override;
+               }
+               if ($this->user && !empty($this->user->stream_link)) {
+                       return $this->user->stream_link;
+               }
+               return '';
+       }
+
        protected $casts = [
                'confirmed' => 'boolean',
                'user_id' => 'string',