소스 검색

Update Media model, fix remote media preview

Daniel Supernault 5 년 전
부모
커밋
9947050bdf
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      app/Media.php

+ 6 - 2
app/Media.php

@@ -42,8 +42,12 @@ class Media extends Model
 
     public function thumbnailUrl()
     {
-        $path = $this->thumbnail_path ?? 'public/no-preview.png';
-        return url(Storage::url($path));
+        if($this->remote_media == true) {
+            return $this->remote_url;
+        } else {
+            $path = $this->thumbnail_path ?? 'public/no-preview.png';
+            return url(Storage::url($path));
+        }
     }
 
     public function thumb()