MediaRecord fields

Key fields stored in KV under media:<id>:

  • status: DRAFT or PUBLISHED
  • object_key: originals/<id>.<ext>
  • thumb_object_key: thumbs/<id>.webp when generated
  • public_url, thumb_url: computed for UI
  • created_at, published_at, taken_date
  • event_date, caption, tags
  • mime_type, size_bytes, width, height
  • exif_json (best-effort)
  • sha256

KV indexes

  • all:index and published:index (arrays of ids, capped at 5000)
  • Tag indexes: tag:all:<tag>, tag:published:<tag>
  • Sorted indexes: published:sort:taken_date, published:sort:uploaded, published:sort:added, published:sort:size
  • Sorted entries are score<TAB>id for deterministic ordering

R2 objects

  • Originals: originals/<id>.<ext>
  • Thumbs: thumbs/<id>.webp (optional)