Add discs to album

This commit is contained in:
Deluan
2023-12-08 19:29:16 -05:00
parent 0ca0d5da22
commit af7eead037
7 changed files with 165 additions and 14 deletions
+30
View File
@@ -123,6 +123,36 @@ var _ = Describe("MediaFiles", func() {
})
})
Context("Calculated attributes", func() {
Context("Discs", func() {
When("we have no discs", func() {
BeforeEach(func() {
mfs = MediaFiles{{Album: "Album1"}, {Album: "Album1"}, {Album: "Album1"}}
})
It("sets the correct Discs", func() {
album := mfs.ToAlbum()
Expect(album.Discs).To(BeEmpty())
})
})
When("we have only one disc", func() {
BeforeEach(func() {
mfs = MediaFiles{{DiscNumber: 1, DiscSubtitle: "DiscSubtitle"}}
})
It("sets the correct Discs", func() {
album := mfs.ToAlbum()
Expect(album.Discs).To(Equal(Discs{"1": "DiscSubtitle"}))
})
})
When("we have multiple discs", func() {
BeforeEach(func() {
mfs = MediaFiles{{DiscNumber: 1, DiscSubtitle: "DiscSubtitle"}, {DiscNumber: 2, DiscSubtitle: "DiscSubtitle2"}, {DiscNumber: 1, DiscSubtitle: "DiscSubtitle"}}
})
It("sets the correct Discs", func() {
album := mfs.ToAlbum()
Expect(album.Discs).To(Equal(Discs{"1": "DiscSubtitle", "2": "DiscSubtitle2"}))
})
})
})
Context("Genres", func() {
When("we have only one Genre", func() {
BeforeEach(func() {