소스 검색

Update Status model, fix thumbnail bug

Daniel Supernault 6 년 전
부모
커밋
44dee9b974
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      app/Status.php
  2. 1 1
      config/pixelfed.php

+ 2 - 2
app/Status.php

@@ -77,9 +77,9 @@ class Status extends Model
     public function thumb($showNsfw = false)
     {
         return Cache::remember('status:thumb:'.$this->id, 40320, function() use ($showNsfw) {
-            $type = $this->viewType();
+            $type = $this->type ?? $this->setType();
             $is_nsfw = !$showNsfw ? $this->is_nsfw : false;
-            if ($this->media->count() == 0 || $is_nsfw || !in_array($type,['image', 'album', 'video'])) {
+            if ($this->media->count() == 0 || $is_nsfw || !in_array($type,['photo', 'photo:album'])) {
                 return 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==';
             }
 

+ 1 - 1
config/pixelfed.php

@@ -23,7 +23,7 @@ return [
     | This value is the version of your PixelFed instance.
     |
     */
-    'version' => '0.5.2',
+    'version' => '0.5.3',
 
     /*
     |--------------------------------------------------------------------------