# club.filmclash.comparison

> Published by [filmclash.club](https://lexicon.garden/identity/did:plc:wdmbctd3ezqqnmrbvdu4ygme)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:wdmbctd3ezqqnmrbvdu4ygme/club.filmclash.comparison)
- [Documentation](https://lexicon.garden/lexicon/did:plc:wdmbctd3ezqqnmrbvdu4ygme/club.filmclash.comparison/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:wdmbctd3ezqqnmrbvdu4ygme/club.filmclash.comparison/examples)

## Definitions

### `club.filmclash.comparison`

**Type**: `record`

A single pairwise preference: the user prefers `winner` over `loser`.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `loser` | `ref` → `#work` | Yes |  |
| `winner` | `ref` → `#work` | Yes |  |
| `session` | `string` | No | Optional id grouping comparisons made in one shuffle/refine or insertion session. Enables UX analytics and active-learning batching. |
| `createdAt` | `string` (datetime) | Yes |  |

### `club.filmclash.comparison#work`

**Type**: `object`

Identity of a title, by external catalog id. Uses a shared identifier convention for cross-app join compatibility.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `string` | Yes | Open work vocabulary. FilmClash uses movie/tv_show initially; the open set leaves room to extend without a breaking change. |
| `imdbId` | `string` | No | IMDB id, e.g. "tt5950044". Optional but recommended as a stable secondary key. |
| `tmdbId` | `string` | Yes | TMDB id, stored as a string (e.g. "1061474"). |

## Raw Schema

```json
{
  "id": "club.filmclash.comparison",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "winner",
          "loser",
          "createdAt"
        ],
        "properties": {
          "loser": {
            "ref": "#work",
            "type": "ref"
          },
          "winner": {
            "ref": "#work",
            "type": "ref"
          },
          "session": {
            "type": "string",
            "maxLength": 64,
            "description": "Optional id grouping comparisons made in one shuffle/refine or insertion session. Enables UX analytics and active-learning batching."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          }
        }
      },
      "description": "A single pairwise preference: the user prefers `winner` over `loser`."
    },
    "work": {
      "type": "object",
      "required": [
        "tmdbId",
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "maxLength": 64,
          "description": "Open work vocabulary. FilmClash uses movie/tv_show initially; the open set leaves room to extend without a breaking change.",
          "knownValues": [
            "movie",
            "tv_show",
            "book",
            "game",
            "music"
          ]
        },
        "imdbId": {
          "type": "string",
          "maxLength": 32,
          "description": "IMDB id, e.g. \"tt5950044\". Optional but recommended as a stable secondary key."
        },
        "tmdbId": {
          "type": "string",
          "maxLength": 32,
          "description": "TMDB id, stored as a string (e.g. \"1061474\")."
        }
      },
      "description": "Identity of a title, by external catalog id. Uses a shared identifier convention for cross-app join compatibility."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
