{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A single viewing (the dated diary entry) of a TV episode. The record key is deterministic: <idprefix><show id>-sSSeEE-<watchedAt as YYYYMMDDHHmm UTC>, e.g. tvdb348385-s01e01-202302042237. What Popfeed already models lives in Popfeed records, linked here: the title marked as watched (social.popfeed.feed.listItem) and the rating and review text (social.popfeed.feed.review). This record keeps what Popfeed has no place for: the date of each viewing, its moods and its favorite character.",
      "key": "any",
      "record": {
        "nullable": [
          "rating",
          "comment",
          "reaction",
          "favoriteCharacter"
        ],
        "properties": {
          "comment": {
            "description": "Legacy: review texts now live in the linked Popfeed review (popfeedReview). Read only from records without one.",
            "maxGraphemes": 3000,
            "maxLength": 10000,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "episode": {
            "description": "Episode number within the season.",
            "minimum": 0,
            "type": "integer"
          },
          "favoriteCharacter": {
            "description": "Identifier of the viewer's favorite character (opaque, source-specific).",
            "maxLength": 128,
            "type": "string"
          },
          "liked": {
            "description": "Whether the viewer liked it.",
            "type": "boolean"
          },
          "popfeedItem": {
            "description": "The show's social.popfeed.feed.listItem whose watchedEpisodes holds this episode.",
            "format": "at-uri",
            "type": "string"
          },
          "popfeedReview": {
            "description": "The social.popfeed.feed.review holding the rating and review text of this viewing. Replies and reactions go to it, so zelk.tv and Popfeed share one thread.",
            "format": "at-uri",
            "type": "string"
          },
          "precision": {
            "description": "How precise watchedAt is. Imported history is often only minute-accurate.",
            "knownValues": [
              "day",
              "minute",
              "second"
            ],
            "type": "string"
          },
          "rating": {
            "description": "Legacy: ratings now live in the linked Popfeed review (popfeedReview). Read only from records without one.",
            "maximum": 10,
            "minimum": 1,
            "type": "integer"
          },
          "reaction": {
            "description": "Moods of this viewing: shocked, touched, amused, scared, bored, thrilled, confused, tense (Bingers' feelings; zelk only: Popfeed has none).",
            "items": {
              "maxLength": 64,
              "type": "string"
            },
            "maxLength": 8,
            "type": "array"
          },
          "season": {
            "description": "Season number. 0 is used for specials.",
            "minimum": 0,
            "type": "integer"
          },
          "source": {
            "description": "Where the record came from, e.g. import:trakt.",
            "maxLength": 128,
            "type": "string"
          },
          "subject": {
            "description": "External identifiers of the show (not the episode).",
            "ref": "#subject",
            "type": "ref"
          },
          "watchedAt": {
            "description": "When the episode was watched.",
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "subject",
          "season",
          "episode",
          "watchedAt",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "subject": {
      "description": "At least one identifier should be present.",
      "properties": {
        "imdb": {
          "description": "IMDb id of the show.",
          "maxLength": 32,
          "type": "string"
        },
        "tmdb": {
          "description": "TMDB series id.",
          "type": "integer"
        },
        "tvdb": {
          "description": "TheTVDB series id.",
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "id": "space.zelk.tv.watched",
  "lexicon": 1
}
