From: Chocobozzz Date: Wed, 24 Apr 2019 09:10:42 +0000 (+0200) Subject: Add default playlist image X-Git-Tag: v1.3.0-rc.1~48 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5fb6996b811a0cf266750d3c82e876079c8bc19e;p=oweals%2Fpeertube.git Add default playlist image --- diff --git a/client/src/app/shared/video-playlist/video-playlist.model.ts b/client/src/app/shared/video-playlist/video-playlist.model.ts index ec8013e89..7e311aa54 100644 --- a/client/src/app/shared/video-playlist/video-playlist.model.ts +++ b/client/src/app/shared/video-playlist/video-playlist.model.ts @@ -51,7 +51,12 @@ export class VideoPlaylist implements ServerVideoPlaylist { this.privacy = hash.privacy this.thumbnailPath = hash.thumbnailPath - this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath + + if (this.thumbnailPath) { + this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath + } else { + this.thumbnailUrl = window.location.origin + '/client/assets/images/default-playlist.jpg' + } this.videosLength = hash.videosLength diff --git a/client/src/assets/images/default-playlist.jpg b/client/src/assets/images/default-playlist.jpg new file mode 100644 index 000000000..978fb16f2 Binary files /dev/null and b/client/src/assets/images/default-playlist.jpg differ diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 6a1d23529..a17136401 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts @@ -304,7 +304,7 @@ async function addVideoInPlaylist (req: express.Request, res: express.Response) }) // If the user did not set a thumbnail, automatically take the video thumbnail - if (playlistElement.position === 1 && videoPlaylist.hasThumbnail() === false) { + if (videoPlaylist.hasThumbnail() === false) { logger.info('Generating default thumbnail to playlist %s.', videoPlaylist.url) const inputPath = join(CONFIG.STORAGE.THUMBNAILS_DIR, video.getMiniature().filename)