Show author names in natural order everywhere

Names read from MARC personal-name fields are stored as "Steve Allen",
and names already stored as "Allen, Steve" are shown and printed in
natural order. Search matches both forms.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-19 14:09:09 -07:00
1 parent 7ae1bcef0a
commit 60fa4ef6f7
17 files changed
+183 -15

No files matched your search

+8
View File
@@ -105,3 +105,11 @@ test('a database made before the hierarchy tail gets the column; old books read
rmSync(dir, { recursive: true, force: true });
}
});
test('search finds an inverted stored name by its natural form', () => {
const db = openDb(':memory:');
db.insertPending({ title: 'Canyoneering 2', authors: ['Allen, Steve'] });
assert.equal(db.listBooks({ q: 'steve allen' }).length, 1);
assert.equal(db.listBooks({ q: 'allen, steve' }).length, 1);
assert.equal(db.listBooks({ q: 'nobody' }).length, 0);
});