# app.studynext.cardMetadata

> Optional metadata sidecar for a flashcard. rkey equals cardId. The sidecar keeps Anki import/review, scheduler, and media metadata separate from the replaceable card record; it remains publicly readable in the user's PDS.

- Kind: record
- Record key: any
- Authority: studynext.app
- Lexicon: 1
- Published by [studynext.app](https://lexicon.garden/identity/did:plc:nstib2qjcu3tyun7cxz4dxcm), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.cardMetadata)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.cardMetadata/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.cardMetadata/analytics)

## Record (`app.studynext.cardMetadata`)

Type: record · key any

### Properties

- `ankiReviewHistory` (array): Anki revlog rows retained for APKG round trips. reviewedAt is the Anki Unix timestamp in milliseconds; durationMs is milliseconds; other numeric fields retain Anki's raw revlog values.
  - `items` (ref)
    - Reference: `#ankiReviewEntry`
- `ankiSource` (string)
- `cardId` (string, required): Flashcard id and this record's rkey.
  - Constraints: maxLength: 100
- `difficulty` (string): FSRS difficulty, stringified because AT Protocol has no float type.
- `flag` (integer)
  - Constraints: minimum: 0, maximum: 7
- `lapses` (integer)
  - Constraints: minimum: 0
- `lastGrade` (string)
  - Constraints: knownValues: again | hard | good | easy
- `media` (array): Attached media manifest; file bytes are PDS blobs. The card text references media by name.
  - `items` (ref)
    - Reference: `#mediaEntry`
- `problemRounds` (integer)
  - Constraints: minimum: 0
- `stability` (string): FSRS stability in days, stringified because AT Protocol has no float type.
- `suspended` (boolean)

## #ankiReviewEntry (`app.studynext.cardMetadata#ankiReviewEntry`)

Type: object

### Properties

- `durationMs` (integer, required)
  - Constraints: minimum: 0
- `ease` (integer, required)
  - Constraints: minimum: 0, maximum: 4
- `factor` (integer, required)
  - Constraints: minimum: 0
- `interval` (integer, required)
- `previousInterval` (integer, required)
- `reviewedAt` (integer, required)
- `type` (integer, required)
  - Constraints: minimum: 0, maximum: 3

## #mediaEntry (`app.studynext.cardMetadata#mediaEntry`)

Type: object

### Properties

- `blob` (blob, required)
  - Constraints: maxSize: 26214400, accept: image/*, audio/*
- `mimeType` (string, required)
  - Constraints: maxLength: 100
- `name` (string, required)
  - Constraints: maxLength: 200
- `size` (integer, required)
  - Constraints: minimum: 0

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "ankiReviewEntry": {
      "properties": {
        "durationMs": {
          "minimum": 0,
          "type": "integer"
        },
        "ease": {
          "maximum": 4,
          "minimum": 0,
          "type": "integer"
        },
        "factor": {
          "minimum": 0,
          "type": "integer"
        },
        "interval": {
          "type": "integer"
        },
        "previousInterval": {
          "type": "integer"
        },
        "reviewedAt": {
          "type": "integer"
        },
        "type": {
          "maximum": 3,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "reviewedAt",
        "ease",
        "interval",
        "previousInterval",
        "factor",
        "durationMs",
        "type"
      ],
      "type": "object"
    },
    "main": {
      "description": "Optional metadata sidecar for a flashcard. rkey equals cardId. The sidecar keeps Anki import/review, scheduler, and media metadata separate from the replaceable card record; it remains publicly readable in the user's PDS.",
      "key": "any",
      "record": {
        "properties": {
          "ankiReviewHistory": {
            "description": "Anki revlog rows retained for APKG round trips. reviewedAt is the Anki Unix timestamp in milliseconds; durationMs is milliseconds; other numeric fields retain Anki's raw revlog values.",
            "items": {
              "ref": "#ankiReviewEntry",
              "type": "ref"
            },
            "type": "array"
          },
          "ankiSource": {
            "type": "string"
          },
          "cardId": {
            "description": "Flashcard id and this record's rkey.",
            "maxLength": 100,
            "type": "string"
          },
          "difficulty": {
            "description": "FSRS difficulty, stringified because AT Protocol has no float type.",
            "type": "string"
          },
          "flag": {
            "maximum": 7,
            "minimum": 0,
            "type": "integer"
          },
          "lapses": {
            "minimum": 0,
            "type": "integer"
          },
          "lastGrade": {
            "knownValues": [
              "again",
              "hard",
              "good",
              "easy"
            ],
            "type": "string"
          },
          "media": {
            "description": "Attached media manifest; file bytes are PDS blobs. The card text references media by name.",
            "items": {
              "ref": "#mediaEntry",
              "type": "ref"
            },
            "type": "array"
          },
          "problemRounds": {
            "minimum": 0,
            "type": "integer"
          },
          "stability": {
            "description": "FSRS stability in days, stringified because AT Protocol has no float type.",
            "type": "string"
          },
          "suspended": {
            "type": "boolean"
          }
        },
        "required": [
          "cardId"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "mediaEntry": {
      "properties": {
        "blob": {
          "accept": [
            "image/*",
            "audio/*"
          ],
          "maxSize": 26214400,
          "type": "blob"
        },
        "mimeType": {
          "maxLength": 100,
          "type": "string"
        },
        "name": {
          "maxLength": 200,
          "type": "string"
        },
        "size": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "name",
        "mimeType",
        "size",
        "blob"
      ],
      "type": "object"
    }
  },
  "id": "app.studynext.cardMetadata",
  "lexicon": 1
}
```
