Implements library scanning endpoints. Also:

- Bumped Subsonic API version to 1.15:
- Better User/Users Subsonic endpoint implementations, not final though
This commit is contained in:
Deluan
2020-10-27 18:19:56 -04:00
parent 9b756faef5
commit d9f7a154cf
17 changed files with 196 additions and 37 deletions
@@ -220,6 +220,39 @@ var _ = Describe("Responses", func() {
})
})
Describe("Users", func() {
BeforeEach(func() {
u := User{Username: "deluan"}
response.Users = &Users{User: []User{u}}
})
Context("without data", func() {
It("should match .XML", func() {
Expect(xml.Marshal(response)).To(MatchSnapshot())
})
It("should match .JSON", func() {
Expect(json.Marshal(response)).To(MatchSnapshot())
})
})
Context("with data", func() {
BeforeEach(func() {
u := User{Username: "deluan"}
u.Email = "navidrome@deluan.com"
u.AdminRole = true
u.Folder = []int{1}
response.Users = &Users{User: []User{u}}
})
It("should match .XML", func() {
Expect(xml.Marshal(response)).To(MatchSnapshot())
})
It("should match .JSON", func() {
Expect(json.Marshal(response)).To(MatchSnapshot())
})
})
})
Describe("Playlists", func() {
BeforeEach(func() {
response.Playlists = &Playlists{}
@@ -504,9 +537,11 @@ var _ = Describe("Responses", func() {
Context("with data", func() {
BeforeEach(func() {
t, _ := time.Parse(time.RFC822, time.RFC822)
response.ScanStatus = &ScanStatus{
Scanning: true,
Count: 123,
LastScan: &t,
}
})
It("should match .XML", func() {