diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-06 17:39:19 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-06 17:39:19 +0100 |
commit | 6872996d296d5b8024c569fce426562fac2f64bf (patch) | |
tree | 43c7e1c5c0e28973929e3ac817c391da814a6ed0 /server/models/video | |
parent | a3b7421abb4192e215aa280418b62e96958c5e42 (diff) | |
download | PeerTube-6872996d296d5b8024c569fce426562fac2f64bf.tar.gz PeerTube-6872996d296d5b8024c569fce426562fac2f64bf.tar.zst PeerTube-6872996d296d5b8024c569fce426562fac2f64bf.zip |
Be more robust with missing thumbnails/previews
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 5964526a9..bd4ca63ea 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1937,6 +1937,10 @@ export class VideoModel extends Model<VideoModel> { | |||
1937 | return this.uuid + '.jpg' | 1937 | return this.uuid + '.jpg' |
1938 | } | 1938 | } |
1939 | 1939 | ||
1940 | hasPreview () { | ||
1941 | return !!this.getPreview() | ||
1942 | } | ||
1943 | |||
1940 | getPreview () { | 1944 | getPreview () { |
1941 | if (Array.isArray(this.Thumbnails) === false) return undefined | 1945 | if (Array.isArray(this.Thumbnails) === false) return undefined |
1942 | 1946 | ||