fix skipping first album in iterator

This commit is contained in:
Drew Weymouth
2022-12-18 09:03:56 -08:00
parent f25e201440
commit 34710c7b08
+2 -1
View File
@@ -90,13 +90,14 @@ func (r *baseIter) Next() *subsonic.AlbumID3 {
if r.prefetchedPos == len(r.prefetched) { if r.prefetchedPos == len(r.prefetched) {
r.prefetched = nil r.prefetched = nil
r.prefetchedPos = 0 r.prefetchedPos = 0
r.pos++
} }
r.pos++ r.pos++
r.l.CacheAlbum(a) r.l.CacheAlbum(a)
return a return a
} }
albums, err := r.s.GetAlbumList2(r.listType, map[string]string{"size": "20", "offset": strconv.Itoa(r.pos + 1)}) albums, err := r.s.GetAlbumList2(r.listType, map[string]string{"size": "20", "offset": strconv.Itoa(r.pos)})
if err != nil { if err != nil {
log.Println(err) log.Println(err)
albums = nil albums = nil