refactor(server): replace RangeByChunks with Go 1.23 iterators (#3292)

* refactor(server): replace RangeByChunks with Go 1.23 iterators

* chore: fix comments re: SQLITE_MAX_VARIABLE_NUMBER

* test: improve playqueue test

* refactor(server): don't create a new iterator when it is not required
This commit is contained in:
Deluan Quintão
2024-09-22 11:47:10 -04:00
committed by GitHub
parent 3910e77a7a
commit 669c8f4c49
9 changed files with 79 additions and 99 deletions
+8 -1
View File
@@ -65,11 +65,18 @@ var _ = Describe("PlayQueueRepository", func() {
pq := aPlayQueue("userid", newSong.ID, 0, newSong, songAntenna)
Expect(repo.Store(pq)).To(Succeed())
// Retrieve the playqueue
actual, err := repo.Retrieve("userid")
Expect(err).ToNot(HaveOccurred())
// The playqueue should contain both tracks
AssertPlayQueue(pq, actual)
// Delete the new song
Expect(mfRepo.Delete("temp-track")).To(Succeed())
// Retrieve the playqueue
actual, err := repo.Retrieve("userid")
actual, err = repo.Retrieve("userid")
Expect(err).ToNot(HaveOccurred())
// The playqueue should not contain the deleted track