Discard duplicated tags

This commit is contained in:
Deluan
2023-12-26 19:35:14 -05:00
parent b4815ecee5
commit ea7ba22699
2 changed files with 29 additions and 0 deletions
@@ -68,6 +68,19 @@ var _ = Describe("Tags", func() {
})
})
Describe("removeDuplicates", func() {
It("removes duplicates", func() {
md := NewTag("/music/artist/album01/Song.mp3", nil, ParsedTags{
"genre": []string{"pop", "rock", "pop"},
"date": []string{"2023-03-01", "2023-03-01"},
"mood": []string{"happy", "sad"},
})
Expect(md.tags).To(HaveKeyWithValue("genre", []string{"pop", "rock"}))
Expect(md.tags).To(HaveKeyWithValue("date", []string{"2023-03-01"}))
Expect(md.tags).To(HaveKeyWithValue("mood", []string{"happy", "sad"}))
})
})
Describe("Bpm", func() {
var t *Tags
BeforeEach(func() {