From 832e2025a01a64a62104e2417dd1e23b774132dd Mon Sep 17 00:00:00 2001 From: David Ashby Date: Sat, 2 Apr 2022 13:38:14 -0400 Subject: [PATCH] initial UI, pagination starts at 1 for some reason --- database/records.go | 3 +- frontend/files/index.html | 1 + frontend/files/records/app.js | 168 +++++++++++++++++ frontend/files/records/favicon.ico | Bin 0 -> 4414 bytes frontend/files/records/favicon.png | Bin 0 -> 70262 bytes frontend/files/records/index.html | 46 +++++ frontend/files/records/style.css | 284 +++++++++++++++++++++++++++++ 7 files changed, 501 insertions(+), 1 deletion(-) create mode 100644 frontend/files/records/app.js create mode 100644 frontend/files/records/favicon.ico create mode 100644 frontend/files/records/favicon.png create mode 100644 frontend/files/records/index.html create mode 100644 frontend/files/records/style.css diff --git a/database/records.go b/database/records.go index 0195c98..46aac98 100644 --- a/database/records.go +++ b/database/records.go @@ -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])) } diff --git a/frontend/files/index.html b/frontend/files/index.html index 5e0b3b1..d674e39 100644 --- a/frontend/files/index.html +++ b/frontend/files/index.html @@ -22,6 +22,7 @@