Permalink
Browse files

fix(server): filter out empty strings for artists and genres

  • Loading branch information...
mycoboco committed Sep 7, 2017
1 parent ebc8532 commit f20d2b7110d8f22a57b3427fb37c1d29aff3df14
Showing with 6 additions and 2 deletions.
  1. +6 −2 server/lib/mp3.js
View
@@ -111,12 +111,16 @@ function meta(song, cb) {
kind: 2,
title: data.common.title || song,
artist: data.common.albumartist || data.common.artist ||
(data.common.artists && data.common.artists.join(', ')) || '(Unknown Artist)',
(data.common.artists &&
data.common.artists.filter(function (a) { return a }).join(', ')) ||
'(Unknown Artist)',
album: data.common.album || '(Unknown Album)',
time: Math.floor((data.format && data.format.duration*1000) || 0),
year: data.common.year || 0,
track: (data.common.track && data.common.track.no) || 0,
genre: (data.common.genre && data.common.genre.join(', ')) || '(Unknown Genre)',
genre: (data.common.genre &&
data.common.genre.filter(function (g) { return g }).join(', ')) ||
'(Unknown Genre)',
format: path.extname(song).substring(1, song.length-1),
path: song
}

0 comments on commit f20d2b7

Please sign in to comment.