Convert internal disc number representation to int

This commit is contained in:
Deluan
2023-12-08 22:07:58 -05:00
parent 2c9035fdd0
commit 465cc091b0
5 changed files with 11 additions and 31 deletions
+3 -16
View File
@@ -45,9 +45,9 @@ var _ = Describe("helpers", func() {
It("should return correct disc titles when album has discs with valid disc numbers", func() {
album := model.Album{
Discs: map[string]string{
"1": "Disc 1",
"2": "Disc 2",
Discs: map[int]string{
1: "Disc 1",
2: "Disc 2",
},
}
expected := responses.DiscTitles{
@@ -56,18 +56,5 @@ var _ = Describe("helpers", func() {
}
Expect(buildDiscSubtitles(context.Background(), album)).To(Equal(expected))
})
It("should skip discs with invalid disc numbers", func() {
album := model.Album{
Discs: map[string]string{
"1": "Disc 1",
"two": "Disc 2",
},
}
expected := responses.DiscTitles{
{Disc: 1, Title: "Disc 1"},
}
Expect(buildDiscSubtitles(context.Background(), album)).To(Equal(expected))
})
})
})