1
0
Fork 0

Add default playlist image

This commit is contained in:
Chocobozzz 2019-04-24 11:10:42 +02:00
parent 210feb6cc4
commit 5fb6996b81
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 7 additions and 2 deletions

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -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)