Skip to content

Commit aaa9de3

Browse files
committed
Fix metadata search results not displaying in UI
- Component was not parsing nested API response structure correctly - API returns { provider: { results: [...] } } but UI expected { provider: [...] } - Added Audible to provider names and colors - Updated footer text to reflect current providers
1 parent d7b3dd8 commit aaa9de3

3 files changed

Lines changed: 26 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.9.12] - 2026-06-14
11+
12+
### Fixed
13+
- **Metadata Search Results Not Displaying** - Fixed UI not showing search results
14+
- Component was not correctly parsing nested API response structure
15+
- Added Audible to provider names and colors in search modal
16+
- Updated footer text to reflect current providers
17+
1018
## [2.9.11] - 2026-06-14
1119

1220
### Removed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bookshelf",
3-
"version": "2.9.11",
3+
"version": "2.9.12",
44
"description": "Personal book library management application",
55
"private": true,
66
"type": "module",

src/lib/components/book/MetadataSearchModal.svelte

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,17 @@
5757
const providerNames: Record<string, string> = {
5858
googlebooks: 'Google Books',
5959
openlibrary: 'Open Library',
60-
goodreads: 'Goodreads',
61-
hardcover: 'Hardcover'
60+
hardcover: 'Hardcover',
61+
comicvine: 'ComicVine',
62+
audible: 'Audible'
6263
};
6364
6465
const providerColors: Record<string, string> = {
6566
googlebooks: '#4285F4',
6667
openlibrary: '#e08741',
67-
goodreads: '#553B08',
68-
hardcover: '#8B5CF6'
68+
hardcover: '#8B5CF6',
69+
comicvine: '#ED1D24',
70+
audible: '#FF9900'
6971
};
7072
7173
const fieldLabels: Record<string, string> = {
@@ -129,7 +131,16 @@
129131
}
130132
131133
const data = await res.json();
132-
results = data.results || {};
134+
135+
// Extract results arrays from the nested response structure
136+
// API returns { provider: { results: [...], error: ... } }
137+
// We need { provider: [...] }
138+
const rawResults = data.results || {};
139+
results = {};
140+
for (const [provider, providerData] of Object.entries(rawResults)) {
141+
const pd = providerData as { results?: MetadataResult[]; error?: string };
142+
results[provider] = pd.results || [];
143+
}
133144
134145
// Auto-select first provider with results
135146
const providersWithResults = Object.keys(results).filter(p => results[p]?.length > 0);
@@ -525,7 +536,7 @@
525536
{#if selectedResult}
526537
Source: {providerNames[selectedResult.provider] || selectedResult.provider}
527538
{:else}
528-
Search across Google Books, Open Library, Goodreads, and Hardcover
539+
Search across Google Books, Open Library, Audible, and more
529540
{/if}
530541
</p>
531542
<div class="flex gap-3">

0 commit comments

Comments
 (0)