diff --git a/scanner/metadata/ffmpeg.go b/scanner/metadata/ffmpeg.go index d1e4e7099..8acb3ba75 100644 --- a/scanner/metadata/ffmpeg.go +++ b/scanner/metadata/ffmpeg.go @@ -22,6 +22,13 @@ func (m *ffmpegMetadata) HasPicture() bool { return m.getTag("has_picture", "metadata_block_picture") != "" } func (m *ffmpegMetadata) DiscNumber() (int, int) { return m.parseTuple("tpa", "disc", "discnumber") } +func (m *ffmpegMetadata) Comment() string { + comment := m.baseMetadata.Comment() + if comment == "Cover (front)" { + return "" + } + return comment +} type ffmpegExtractor struct{} diff --git a/scanner/metadata/ffmpeg_test.go b/scanner/metadata/ffmpeg_test.go index b9f1cb581..7c170d1bd 100644 --- a/scanner/metadata/ffmpeg_test.go +++ b/scanner/metadata/ffmpeg_test.go @@ -240,6 +240,21 @@ Input #0, mp3, from '/Users/deluan/Downloads/椎名林檎 - 加爾基 精液 栗 Expect(md.SortAlbumArtist()).To(Equal("Shiina, Ringo")) }) + It("ignores cover comment", func() { + const output = ` +Input #0, mp3, from './Edie Brickell/Picture Perfect Morning/01-01 Tomorrow Comes.mp3': + Metadata: + title : Tomorrow Comes + artist : Edie Brickell + Duration: 00:03:56.12, start: 0.000000, bitrate: 332 kb/s + Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s + Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1200x1200 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc + Metadata: + comment : Cover (front)` + md, _ := e.extractMetadata("tests/fixtures/test.mp3", output) + Expect(md.Comment()).To(Equal("")) + }) + It("parses tags with spaces in the name", func() { const output = ` Input #0, mp3, from '/Users/deluan/Music/Music/Media/_/Wyclef Jean - From the Hut, to the Projects, to the Mansion/10 - The Struggle (interlude).mp3':