From 5fb6996b811a0cf266750d3c82e876079c8bc19e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 24 Apr 2019 11:10:42 +0200 Subject: [PATCH] Add default playlist image --- .../video-playlist/video-playlist.model.ts | 7 ++++++- client/src/assets/images/default-playlist.jpg | Bin 0 -> 2554 bytes server/controllers/api/video-playlist.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 client/src/assets/images/default-playlist.jpg 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 0000000000000000000000000000000000000000..978fb16f2fb99a8f1b4aaf8666a92c1064599ccb GIT binary patch literal 2554 zcmcIlZB!Fy7QQo+AqfdEAqhgoHh}% z-e>N8W4UelH&6={Dg|Ijd@)}D%RRhK6&kuCI%bhV6&a2e0PynEXV?t4F0)$1Y$Kj-L zI9Y2*LpA}(Mv{`IL-Fyr*Eog7AJI51H52X4Ds+Y1mAWO1(Nltc?w|w}EQDwfK@w!b z8b}2b_@So`X^aqq*5woUzhU){MqWwCYYikLk1$AwG|*W6f&K=_28oSZhIrbcmgQGL$;K+02a3~jw z#}^2NLax&!R~Lb+vp^`IgJ1;mVUTQ+WD6WP4ubz%EKR^;!AAI=z<7Z3FoK6!no%(r zpsisv6C+~BBv}~FAkeBSJ$dwy*@U#in3jJ57rEdRLD79IvaQa17#cM8#tN>Eddx4` z@bjn!V+Ky`+HMT~q^tGBL*sX&jS0LumHqCk@6Bdqw`wKFe6S@sP26^>F16qSVaR_vdH6Y|5(Z)&4YuPHT14!Yl3T zOGBUKd)NH=Ok12(nOnt@{?+5|*UGc&vcnrZ`=fTkixWdr=H_wI!tGu2So?&Fs(o`^ zy4?7RQykB*_m{tDh&1(kRL-CFCl;sdX00(LoS4~AvuBs{G3}0ma&buG*N9bb3h_zO zN5fdfz!Uq+r0NV!Q3a*%9?1U3;An@1h;QzVT@)*e8c=5Y+_5|LV9PDZ%c7m@oHQ>p zu-+acf5~9Ww3Zi>c=JT%on|@tszmGFvuUug{CfF`2;8?zGxcRj?cvT|b5l))NuB0a zc_1YBjb=lqM22b zHW;7WLL0Ik0oF5=+NF|=UW`#7+2uB-B$wL^I>!vQj4BJ+W0t=!Ky*v!CT7^$3msrQ ze~`-5V!E-S%|&ekRA2W($hKVn}3@zHX+#fX|x8uQ9#J zmGXAhDo=Z{w2sRAfuZ7vLd`NcwqW~k!XfKyNKmJszX5Dqr|>|mL6f1*pt39K^#is( zq3&*9&kgKYD%UqRt7>qi^M>xsfq}obPUAkvdv|@5LbpIYWsuhqTR$MfBH zbZVk%>E_bb?{;f_E>Auc^o^p3t!*cMj7}}f+naUs9p*>UdmcXFJDj5u4z~ZoJ~$jJ z>SP_c=UKLG){OmAG$k3D(?3@?qA9_SDsacH>5_Ykw~E>QS2v0_#dY;fKly5-rQ^R%9lp^3 literal 0 HcmV?d00001 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)