Import song duration with hundredths when using TagLib

This is how ffmpeg extractor currently works, and it makes album durations more precise.
This commit is contained in:
Deluan
2021-08-20 21:33:12 -04:00
parent 05e27095b2
commit 143f5ba9d5
4 changed files with 14 additions and 4 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ var _ = Describe("Tags", func() {
Expect(n).To(Equal(1))
Expect(t).To(Equal(2))
Expect(m.HasPicture()).To(BeTrue())
Expect(m.Duration()).To(BeNumerically("~", 1, 0.01))
Expect(m.Duration()).To(BeNumerically("~", 1.02, 0.01))
Expect(m.BitRate()).To(Equal(192))
Expect(m.FilePath()).To(Equal("tests/fixtures/test.mp3"))
Expect(m.Suffix()).To(Equal("mp3"))
@@ -42,7 +42,7 @@ var _ = Describe("Tags", func() {
Expect(err).To(BeNil())
Expect(m.Title()).To(BeEmpty())
Expect(m.HasPicture()).To(BeFalse())
Expect(m.Duration()).To(BeNumerically("~", 1.00, 0.01))
Expect(m.Duration()).To(BeNumerically("~", 1.04, 0.01))
Expect(m.Suffix()).To(Equal("ogg"))
Expect(m.FilePath()).To(Equal("tests/fixtures/test.ogg"))
Expect(m.Size()).To(Equal(int64(5065)))