initial UI, pagination starts at 1 for some reason
This commit is contained in:
@@ -62,13 +62,14 @@ func (c *DiscogsCache) GetAllRecords(ctx context.Context) ([]media.Record, error
|
||||
func (c *DiscogsCache) fetchRecords(ctx context.Context, pagination *discogs.Pagination) ([]media.Record, error) {
|
||||
records := []media.Record{}
|
||||
if pagination == nil {
|
||||
pagination = getPagination(0)
|
||||
pagination = getPagination(1)
|
||||
}
|
||||
log.Printf("calling discogs API, page %v", pagination.Page)
|
||||
coll, err := c.client.CollectionItemsByFolder(c.username, 0, pagination)
|
||||
if err != nil {
|
||||
return records, fmt.Errorf("error loading collection: %w", err)
|
||||
}
|
||||
log.Printf("length: %v, first item in list: %s", len(coll.Items), coll.Items[0].BasicInformation.Title)
|
||||
for i := range coll.Items {
|
||||
records = append(records, collectionItemToRecord(&coll.Items[i]))
|
||||
}
|
||||
|
Reference in New Issue
Block a user