diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-24 11:10:42 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 16:26:23 +0200 |
commit | 5fb6996b811a0cf266750d3c82e876079c8bc19e (patch) | |
tree | 1e76a42f6e1d28e3abbe0f576b9339fc6ff908fa | |
parent | 210feb6cc484a6c5c63c98f770de34e223f944cb (diff) | |
download | PeerTube-5fb6996b811a0cf266750d3c82e876079c8bc19e.tar.gz PeerTube-5fb6996b811a0cf266750d3c82e876079c8bc19e.tar.zst PeerTube-5fb6996b811a0cf266750d3c82e876079c8bc19e.zip |
Add default playlist image
-rw-r--r-- | client/src/app/shared/video-playlist/video-playlist.model.ts | 7 | ||||
-rw-r--r-- | client/src/assets/images/default-playlist.jpg | bin | 0 -> 2554 bytes | |||
-rw-r--r-- | server/controllers/api/video-playlist.ts | 2 |
3 files changed, 7 insertions, 2 deletions
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 { | |||
51 | this.privacy = hash.privacy | 51 | this.privacy = hash.privacy |
52 | 52 | ||
53 | this.thumbnailPath = hash.thumbnailPath | 53 | this.thumbnailPath = hash.thumbnailPath |
54 | this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath | 54 | |
55 | if (this.thumbnailPath) { | ||
56 | this.thumbnailUrl = absoluteAPIUrl + hash.thumbnailPath | ||
57 | } else { | ||
58 | this.thumbnailUrl = window.location.origin + '/client/assets/images/default-playlist.jpg' | ||
59 | } | ||
55 | 60 | ||
56 | this.videosLength = hash.videosLength | 61 | this.videosLength = hash.videosLength |
57 | 62 | ||
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 --- /dev/null +++ b/client/src/assets/images/default-playlist.jpg | |||
Binary files 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) | |||
304 | }) | 304 | }) |
305 | 305 | ||
306 | // If the user did not set a thumbnail, automatically take the video thumbnail | 306 | // If the user did not set a thumbnail, automatically take the video thumbnail |
307 | if (playlistElement.position === 1 && videoPlaylist.hasThumbnail() === false) { | 307 | if (videoPlaylist.hasThumbnail() === false) { |
308 | logger.info('Generating default thumbnail to playlist %s.', videoPlaylist.url) | 308 | logger.info('Generating default thumbnail to playlist %s.', videoPlaylist.url) |
309 | 309 | ||
310 | const inputPath = join(CONFIG.STORAGE.THUMBNAILS_DIR, video.getMiniature().filename) | 310 | const inputPath = join(CONFIG.STORAGE.THUMBNAILS_DIR, video.getMiniature().filename) |