Skip to content

Curated JSON format: conversations, stageDirections, soundCues sections #68

Description

@DutchJaFO

Purpose

Extend data/sources/quotinator-curated.json (and the general import format) to support conversation definitions alongside quotes. The seeder must handle the extended format when importing from any source file that includes these sections.

Extended format

{
  "quotes": [ ...existing canonical schema... ],
  "stageDirections": [
    {
      "id": "uuid",
      "text": "[EXT. AIRPLANE - COCKPIT]",
      "imageUrl": null,
      "translations": {
        "nl": { "text": "[EXT. VLIEGTUIG - COCKPIT]" }
      }
    }
  ],
  "soundCues": [
    {
      "id": "uuid",
      "text": "[awkward silence]",
      "soundFileUrl": null,
      "imageUrl": null,
      "translations": {
        "nl": { "text": "[pijnlijke stilte]" }
      }
    }
  ],
  "conversations": [
    {
      "id": "uuid",
      "description": null,
      "lines": [
        { "order": 1, "type": "quote",           "quoteId": "..." },
        { "order": 2, "type": "sound_cue",        "soundCueId": "..." },
        { "order": 3, "type": "quote",            "quoteId": "..." }
      ]
    }
  ]
}

Backwards compatibility

Source files that contain only a top-level array ([...]) remain valid — they are treated as { "quotes": [...] } with no conversations, stage directions, or sound cues. The seeder detects the shape and handles both.

Seeder changes

  • Parse stageDirections, soundCues, and conversations sections when present.
  • Insert into the new tables defined in Schema: Conversations, ConversationLines, StageDirections, SoundCues #67.
  • All three section types share the same ImportBatchId as the quotes from the same file.
  • conversations are inserted after all quotes, stageDirections, and soundCues from the file are committed (FK constraint order).

First use

The Airplane! conversation is the first entry:

  • Two quotes already in quotinator-curated.json (Ted Striker / Dr. Rumack)
  • No stage directions or sound cues needed for the core exchange
  • One conversation linking both quotes in order

quotinator-curated.json must be migrated from a flat array to the extended object format as part of this issue.

Dependencies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions