Expand ZXDB entry data and search

Add entry release/license sections, label permissions/licenses,
expanded search scope (titles+aliases+origins), and home search.
Also include ZXDB submodule and update gitignore.

Signed-off-by: codex@lucy.xalior.com
This commit is contained in:
2026-01-10 18:04:04 +00:00
parent 3e13da5552
commit e2f6aac856
8 changed files with 422 additions and 9 deletions

View File

@@ -13,6 +13,15 @@ export type EntryDetailData = {
genre: { id: number | null; name: string | null };
authors: Label[];
publishers: Label[];
licenses?: {
id: number;
name: string;
type: { id: string; name: string | null };
isOfficial: boolean;
linkWikipedia?: string | null;
linkSite?: string | null;
comments?: string | null;
}[];
// extra fields for richer details
maxPlayers?: number;
availabletypeId?: string | null;
@@ -300,6 +309,37 @@ export default function EntryDetailClient({ data }: { data: EntryDetailData | nu
<hr />
<div>
<h5>Releases</h5>
{(!data.releases || data.releases.length === 0) && <div className="text-secondary">No releases recorded</div>}
{data.releases && data.releases.length > 0 && (
<div className="table-responsive">
<table className="table table-sm table-striped align-middle">
<thead>
<tr>
<th style={{ width: 120 }}>Release #</th>
<th style={{ width: 120 }}>Year</th>
<th>Downloads</th>
</tr>
</thead>
<tbody>
{data.releases.map((r) => (
<tr key={r.releaseSeq}>
<td>
<Link href={`/zxdb/releases/${data.id}/${r.releaseSeq}`}>#{r.releaseSeq}</Link>
</td>
<td>{r.year ?? <span className="text-secondary">-</span>}</td>
<td>{r.downloads.length}</td>
</tr>
))}
</tbody>
</table>
</div>
)}
</div>
<hr />
{/* Aliases (alternative titles) */}
<div>
<h5>Aliases</h5>
@@ -332,6 +372,47 @@ export default function EntryDetailClient({ data }: { data: EntryDetailData | nu
<hr />
<div>
<h5>Licenses</h5>
{(!data.licenses || data.licenses.length === 0) && <div className="text-secondary">No licenses linked</div>}
{data.licenses && data.licenses.length > 0 && (
<div className="table-responsive">
<table className="table table-sm table-striped align-middle">
<thead>
<tr>
<th>Name</th>
<th style={{ width: 140 }}>Type</th>
<th style={{ width: 120 }}>Official</th>
<th>Links</th>
</tr>
</thead>
<tbody>
{data.licenses.map((l) => (
<tr key={l.id}>
<td>{l.name}</td>
<td>{l.type.name ?? l.type.id}</td>
<td>{l.isOfficial ? "Yes" : "No"}</td>
<td>
<div className="d-flex gap-2 flex-wrap">
{l.linkWikipedia && (
<a href={l.linkWikipedia} target="_blank" rel="noreferrer">Wikipedia</a>
)}
{l.linkSite && (
<a href={l.linkSite} target="_blank" rel="noreferrer">Site</a>
)}
{!l.linkWikipedia && !l.linkSite && <span className="text-secondary">-</span>}
</div>
</td>
</tr>
))}
</tbody>
</table>
</div>
)}
</div>
<hr />
{/* Web links (external references) */}
<div>
<h5>Web links</h5>