{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tubearchivist/json-schema/tubearchivist-watch-stats-schema.json",
  "title": "WatchStats",
  "description": "serialize watch stats",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tubearchivist-stats-api-openapi.yml#/components/schemas/WatchStats",
  "type": "object",
  "properties": {
    "total": {
      "allOf": [
        {
          "$ref": "#/$defs/WatchTotalStats"
        }
      ]
    },
    "unwatched": {
      "allOf": [
        {
          "$ref": "#/$defs/WatchItemStats"
        }
      ]
    },
    "watched": {
      "allOf": [
        {
          "$ref": "#/$defs/WatchItemStats"
        }
      ]
    }
  },
  "required": [
    "total",
    "unwatched",
    "watched"
  ],
  "$defs": {
    "WatchItemStats": {
      "type": "object",
      "description": "serialize watch item stats",
      "properties": {
        "duration": {
          "type": "integer"
        },
        "duration_str": {
          "type": "string"
        },
        "progress": {
          "type": "number",
          "format": "double"
        },
        "items": {
          "type": "integer"
        }
      },
      "required": [
        "duration",
        "duration_str",
        "items",
        "progress"
      ]
    },
    "WatchTotalStats": {
      "type": "object",
      "description": "serialize total watch stats",
      "properties": {
        "duration": {
          "type": "integer"
        },
        "duration_str": {
          "type": "string"
        },
        "items": {
          "type": "integer"
        }
      },
      "required": [
        "duration",
        "duration_str",
        "items"
      ]
    }
  }
}