Sprites Metadata Storage

The meta store holds one record per item: the whole envelope without its heavy data. This is the metadata every listing reads, including the thumbnail, so a media page shows hundreds of items without loading any art. Each record is keyed by its id, and the matching data lives beside it in the data store under the same id.

{
  "id": "9f8c2a4e7b1d40128e5a6c3f0b9d7e21",
  "media": "sprite",
  "platform": "c64",
  "name": "Player ship",
  "created": 1754300000000,
  "modified": 1754300450000,
  "info": "High-res · 24×21",
  "thumb": "data:image/png;base64,..."
}
One meta record, the metadata a listing reads. The heavy data lives in the data store under the same id, one shape per media format.

The record

Every item, of any media type, is one envelope with the same metadata. The id is a fresh 128 bit random value as a 32 character hex string, fixed for the life of the item.

FieldTypeDescription
idStringThe item id, 32 hex characters. The key in both object stores.
mediaStringThe media type, always the singular key, for example "sprite" or "font". Scopes every listing and count.
platformStringThe machine the item targets, for example "c64" or "freeform".
nameStringThe item name, shown and searched in listings.
createdNumberWhen the item was made, in milliseconds since the epoch.
modifiedNumberWhen the item was last written, in milliseconds since the epoch. The default sort orders by this, most recent first.
infoStringA short summary a listing shows without loading the data. See below.
thumbStringA small preview as a PNG data URL. Optional, absent until the first save writes one.
dataObjectThe payload for the media type, kept in the data store under the same id. Each media format documents its own shape.

The info field is a short summary string, so a card can show a size or a mode without loading the data. Its contents are the media type's own choice: a sprite writes its mode and size, for example "High-res · 24×21". The values themselves are authored in the payload, so a sprite's true width, height and mode live in its data object, and this string is a copy for listings.

Indexes and queries

Listings read from the meta store. Two indexes scope a read to one media type before any work in memory.

IndexOnPurpose
by_mediamediaAll items of one media type, for a media listing or a count.
by_media_modified[media, modified]One media type in recency order, the compound key for a media page's default sort.

The pages read the light meta rows and never touch the data store, and the store keeps them live: a write here or in another tab refolds them.

ReadSourceServes
Sprites.Library.Store.Media.ListThe by_media index for the media, then platform, search, sort and paging in memory.The grid of items on a media page.
Sprites.Library.Store.Meta.CountA count off the index for a filter.The totals for a media type or a platform.

A listing read never touches the data store. It scopes on the index, then filters by platform, keeps names that contain the search text, sorts by name or by modified most recent first, and slices the page. Opening one item is the only read that joins data, through Sprites.Library.Store.Media.Binding.