Order albums by full original date. Fixes #1452

This commit is contained in:
Deluan 2023-05-22 23:49:50 -04:00
parent 11f33ff8b6
commit 7d0656f44a
3 changed files with 12 additions and 6 deletions

View file

@ -69,6 +69,10 @@ var _ = Describe("sqlRepository", func() {
sql := r.buildSortOrder("name desc, substr(id, 7), status asc", "desc")
Expect(sql).To(Equal("name asc, substr(id, 7) desc, status desc"))
})
It("handles nested functions", func() {
sql := r.buildSortOrder("name desc, coalesce(nullif(release_date, ''), nullif(original_date, '')), status asc", "desc")
Expect(sql).To(Equal("name asc, coalesce(nullif(release_date, ''), nullif(original_date, '')) desc, status desc"))
})
})
})
})