diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-01 16:54:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-01 16:54:24 +0200 |
commit | 65af03a241aa83ab7ba71278b6c99acd26428b8a (patch) | |
tree | 0cc04c31cdf631d11a915ae40389e8fa141f136b /server/models/video/video-playlist.ts | |
parent | a21e25ff641854c8b01664cb18655aa420620af6 (diff) | |
download | PeerTube-65af03a241aa83ab7ba71278b6c99acd26428b8a.tar.gz PeerTube-65af03a241aa83ab7ba71278b6c99acd26428b8a.tar.zst PeerTube-65af03a241aa83ab7ba71278b6c99acd26428b8a.zip |
Automatically update playlist thumbnails
Diffstat (limited to 'server/models/video/video-playlist.ts')
-rw-r--r-- | server/models/video/video-playlist.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index 61ff78bd2..c8e97c491 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts | |||
@@ -265,7 +265,6 @@ export class VideoPlaylistModel extends Model<VideoPlaylistModel> { | |||
265 | VideoPlaylistElements: VideoPlaylistElementModel[] | 265 | VideoPlaylistElements: VideoPlaylistElementModel[] |
266 | 266 | ||
267 | @HasOne(() => ThumbnailModel, { | 267 | @HasOne(() => ThumbnailModel, { |
268 | |||
269 | foreignKey: { | 268 | foreignKey: { |
270 | name: 'videoPlaylistId', | 269 | name: 'videoPlaylistId', |
271 | allowNull: true | 270 | allowNull: true |
@@ -434,6 +433,10 @@ export class VideoPlaylistModel extends Model<VideoPlaylistModel> { | |||
434 | return !!this.Thumbnail | 433 | return !!this.Thumbnail |
435 | } | 434 | } |
436 | 435 | ||
436 | hasGeneratedThumbnail () { | ||
437 | return this.hasThumbnail() && this.Thumbnail.automaticallyGenerated === true | ||
438 | } | ||
439 | |||
437 | generateThumbnailName () { | 440 | generateThumbnailName () { |
438 | const extension = '.jpg' | 441 | const extension = '.jpg' |
439 | 442 | ||