{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/tauticord/latest.json",
  "title": "Tauticord Config v2 Schema",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/nwithan8/tauticord/master/.schema/config_v2.schema.json",
    "sourceSha256": "41806995159c2a32c9ef9026146dfb9c4b99d38d1554a0d76bcaf2f69dceaf2c",
    "fileMatch": [
      "tauticord.yml",
      "tauticord.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "Tautulli": {
      "title": "Tautulli configuration",
      "description": "Settings for the Tautulli instance",
      "type": "object",
      "properties": {
        "URL": {
          "title": "Tautulli URL",
          "description": "The URL of the Tautulli instance",
          "$ref": "#/$defs/tautulliUrl"
        },
        "APIKey": {
          "title": "Tautulli API key",
          "description": "The API key for the Tautulli instance",
          "$ref": "#/$defs/tautulliApiKey"
        },
        "UseSelfSignedCert": {
          "title": "Use self-signed certificate",
          "description": "Whether to use a self-signed certificate for the Tautulli instance (ignore SSL warnings)",
          "type": "boolean"
        },
        "RefreshSeconds": {
          "title": "Activity data refresh interval",
          "description": "How often, in seconds, the bot pulls new live activity data. A 5-second minimum is built-in; it's for your own good",
          "type": "integer",
          "minimum": 5,
          "multipleOf": 5
        },
        "TerminateMessage": {
          "title": "Stream termination message",
          "description": "The message to send when a stream is terminated",
          "type": "string"
        }
      },
      "required": [
        "URL",
        "APIKey",
        "UseSelfSignedCert",
        "RefreshSeconds",
        "TerminateMessage"
      ]
    },
    "Discord": {
      "title": "Discord configuration",
      "description": "Settings for the Discord bot and server",
      "type": "object",
      "properties": {
        "BotToken": {
          "title": "Discord bot token",
          "description": "The token for the Discord bot",
          "$ref": "#/$defs/discordBotToken"
        },
        "ServerID": {
          "title": "Discord server ID",
          "description": "The ID of the Discord server where the bot will be used",
          "$ref": "#/$defs/discordServerId"
        },
        "AdminIDs": {
          "title": "Admin IDs",
          "description": "The IDs of the Discord users who will have admin permissions",
          "type": "array",
          "items": {
            "$ref": "#/$defs/discordUserId"
          }
        },
        "PostSummaryMessage": {
          "title": "Post summary message",
          "description": "Whether to post a summary message in the activity summary channel",
          "type": "boolean"
        },
        "AdminChannelName": {
          "title": "Activity summary channel name",
          "description": "The name of the channel where the bot will post activity messages. It's recommended that this be an admin-only channel.",
          "$ref": "#/$defs/discordTextChannelName"
        },
        "PostRecentlyAddedMessage": {
          "title": "Post recently added message",
          "description": "Whether to post a poster carousel of recently-added content in the announcements channel",
          "type": "boolean"
        },
        "PublicChannelName": {
          "title": "Announcements channel name",
          "description": "The name of the channel where the bot will post announcement messages. This can be a public channel.",
          "$ref": "#/$defs/discordTextChannelName"
        },
        "EnableTermination": {
          "title": "Enable stream termination",
          "description": "Whether to enable stream termination",
          "type": "boolean"
        },
        "EnableSlashCommands": {
          "title": "Enable slash commands",
          "description": "Whether to enable slash commands for the bot",
          "type": "boolean"
        },
        "StatusMessage": {
          "title": "Bot Discord activity status",
          "description": "Settings regarding the bot's Discord status/activity",
          "type": "object",
          "properties": {
            "Enable": {
              "title": "Enable bot activity status",
              "description": "Whether to enable the bot's activity status",
              "type": "boolean"
            },
            "CustomMessage": {
              "title": "Custom activity status message",
              "description": "Display a custom activity status message. Overrides default if not-empty",
              "type": "string"
            },
            "ShowStreamCount": {
              "title": "Show active stream count",
              "description": "Whether to display current active stream count in activity status message",
              "type": "boolean"
            }
          }
        }
      },
      "required": [
        "BotToken",
        "ServerID",
        "AdminIDs",
        "AdminChannelName",
        "PostSummaryMessage",
        "EnableSlashCommands"
      ]
    },
    "Display": {
      "title": "Display configuration",
      "description": "Settings for how the bot displays information",
      "type": "object",
      "properties": {
        "Anonymize": {
          "title": "Anonymization settings",
          "description": "Settings for anonymizing user information",
          "type": "object",
          "properties": {
            "HideBandwidth": {
              "title": "Hide bandwidth",
              "description": "Whether to hide bandwidth information",
              "type": "boolean"
            },
            "HideETA": {
              "title": "Hide ETA",
              "description": "Whether to hide ETAs for streams",
              "type": "boolean"
            },
            "HidePlatforms": {
              "title": "Hide platforms",
              "description": "Whether to hide stream platform information",
              "type": "boolean"
            },
            "HidePlayerNames": {
              "title": "Hide player names",
              "description": "Whether to hide stream player names",
              "type": "boolean"
            },
            "HideProgress": {
              "title": "Hide progress",
              "description": "Whether to hide stream progress",
              "type": "boolean"
            },
            "HideQuality": {
              "title": "Hide quality",
              "description": "Whether to hide stream quality information",
              "type": "boolean"
            },
            "HideTranscode": {
              "title": "Hide transcode",
              "description": "Whether to hide stream transcoding information",
              "type": "boolean"
            },
            "HideUsernames": {
              "title": "Hide usernames",
              "description": "Whether to hide Plex usernames",
              "type": "boolean"
            }
          },
          "required": [
            "HideBandwidth",
            "HideETA",
            "HidePlatforms",
            "HidePlayerNames",
            "HideProgress",
            "HideQuality",
            "HideTranscode",
            "HideUsernames"
          ]
        },
        "ServerName": {
          "title": "Server name",
          "description": "The name of the Plex server",
          "type": "string"
        },
        "ThousandsSeparator": {
          "title": "Thousands separator",
          "description": "The character to use as a numerical thousands separator",
          "type": "string"
        },
        "Time": {
          "title": "Time settings",
          "description": "Settings for how the bot handles time",
          "type": "object",
          "properties": {},
          "required": []
        },
        "UseFriendlyNames": {
          "title": "Use friendly names",
          "description": "Whether to use Plex user names instead of Plex usernames",
          "type": "boolean"
        }
      },
      "required": [
        "Anonymize",
        "ServerName",
        "ThousandsSeparator",
        "Time",
        "UseFriendlyNames"
      ]
    },
    "Extras": {
      "title": "Extras configuration",
      "description": "Extra settings for the bot",
      "type": "object",
      "properties": {
        "AllowAnalytics": {
          "title": "Allow analytics",
          "description": "Whether to allow the bot to collect and send analytics data",
          "type": "boolean"
        },
        "EnableUpdateReminders": {
          "title": "Enable update reminders",
          "description": "Whether to enable update reminders",
          "type": "boolean"
        }
      },
      "required": [
        "AllowAnalytics",
        "EnableUpdateReminders"
      ]
    },
    "Stats": {
      "title": "Stats configuration",
      "description": "Settings for the bot's stat tracking features (via voice channels)",
      "type": "object",
      "properties": {
        "Activity": {
          "title": "Activity stats settings",
          "type": "object",
          "properties": {
            "CategoryName": {
              "title": "Category name",
              "description": "The name of the category for activity stats",
              "$ref": "#/$defs/discordCategoryName"
            },
            "Enable": {
              "title": "Enable activity stats",
              "description": "Whether to enable activity stats",
              "type": "boolean"
            },
            "StatTypes": {
              "title": "Stat types",
              "description": "The types of activity stats to track",
              "type": "object",
              "properties": {
                "Bandwidth": {
                  "title": "Bandwidth",
                  "description": "Settings for bandwidth stats",
                  "$ref": "#/$defs/voiceChannel"
                },
                "LocalBandwidth": {
                  "title": "Local bandwidth",
                  "description": "Settings for local bandwidth stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                },
                "PlexServerAvailability": {
                  "title": "Plex server availability",
                  "description": "Settings for Plex server availability stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                },
                "RemoteBandwidth": {
                  "title": "Remote bandwidth",
                  "description": "Settings for remote bandwidth stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                },
                "StreamCount": {
                  "title": "Stream count",
                  "description": "Settings for stream count stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                },
                "TranscodeCount": {
                  "title": "Transcode count",
                  "description": "Settings for transcode count stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                }
              },
              "required": [
                "Bandwidth",
                "LocalBandwidth",
                "PlexServerAvailability",
                "RemoteBandwidth",
                "StreamCount",
                "TranscodeCount"
              ]
            }
          },
          "required": [
            "CategoryName",
            "Enable",
            "StatTypes"
          ]
        },
        "Libraries": {
          "title": "Library stats settings",
          "description": "Settings for Plex library stats",
          "type": "object",
          "properties": {
            "Enable": {
              "title": "Enable library stats",
              "description": "Whether to enable library stats",
              "type": "boolean"
            },
            "CategoryName": {
              "title": "Category name",
              "description": "The name of the category for library stats",
              "$ref": "#/$defs/discordCategoryName"
            },
            "RefreshSeconds": {
              "title": "Library data refresh interval",
              "description": "How often, in seconds, the bot pulls new library data. A 5-minute minimum is built-in; it's for your own good",
              "type": "integer",
              "minimum": 300,
              "multipleOf": 5
            },
            "Libraries": {
              "title": "Libraries",
              "description": "Libraries to track",
              "type": "array",
              "items": {
                "$ref": "#/$defs/library"
              }
            },
            "CombinedLibraries": {
              "title": "Combined libraries",
              "description": "Combined libraries to track",
              "type": "array",
              "items": {
                "$ref": "#/$defs/combinedLibrary"
              }
            }
          },
          "required": [
            "Enable",
            "CategoryName",
            "RefreshSeconds",
            "Libraries",
            "CombinedLibraries"
          ]
        },
        "Performance": {
          "title": "Performance stats settings",
          "description": "Settings for performance stats",
          "type": "object",
          "properties": {
            "CategoryName": {
              "title": "Category name",
              "description": "The name of the category for performance stats",
              "$ref": "#/$defs/discordCategoryName"
            },
            "Enable": {
              "title": "Enable performance stats",
              "description": "Whether to enable performance stats",
              "type": "boolean"
            },
            "Metrics": {
              "title": "Metrics",
              "description": "The performance metrics to track",
              "type": "object",
              "properties": {
                "CPU": {
                  "title": "CPU",
                  "description": "Settings for CPU stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                },
                "DiskSpace": {
                  "title": "Disk space",
                  "description": "Settings for disk space stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                },
                "Memory": {
                  "title": "Memory",
                  "description": "Settings for memory stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                },
                "UserCount": {
                  "title": "User count",
                  "description": "Settings for user count stats",
                  "type": "object",
                  "$ref": "#/$defs/voiceChannel"
                }
              },
              "required": [
                "CPU",
                "DiskSpace",
                "Memory",
                "UserCount"
              ]
            }
          },
          "required": [
            "CategoryName",
            "Enable",
            "Metrics"
          ]
        }
      },
      "required": [
        "Activity",
        "Libraries",
        "Performance"
      ]
    }
  },
  "additionalProperties": true,
  "required": [
    "Tautulli",
    "Discord",
    "Display",
    "Stats",
    "Extras"
  ],
  "$comment": "https://github.com/nwithan8/tauticord",
  "$defs": {
    "emptyString": {
      "pattern": "^$",
      "type": "string"
    },
    "emptyableString": {
      "oneOf": [
        {
          "$ref": "#/$defs/emptyString"
        },
        {
          "type": "string"
        }
      ]
    },
    "numberZero": {
      "maximum": 0,
      "type": "number",
      "minimum": 0
    },
    "positiveInteger": {
      "minimum": 1,
      "type": "integer"
    },
    "hostWithIpAndOptionalPort": {
      "pattern": "^(https?://)?[a-zA-Z0-9.-]+(:[0-9]{1,5})?$",
      "type": "string"
    },
    "discordBotToken": {
      "$comment": "https://github.com/Yelp/detect-secrets/blob/master/detect_secrets/plugins/discord.py#L17C22-L17C81",
      "type": "string",
      "pattern": "^[MNO][a-zA-Z0-9_-]{23,25}\\.[a-zA-Z0-9_-]{6}\\.[a-zA-Z0-9_-]{27,}$",
      "description": "A Discord Bot Token"
    },
    "discordChannelId": {
      "pattern": "^[0-9]{17,20}$",
      "description": "A Discord channel ID",
      "type": "string"
    },
    "discordUserId": {
      "pattern": "^[0-9]{17,20}$",
      "description": "A Discord user ID",
      "type": "string"
    },
    "discordServerId": {
      "pattern": "^[0-9]{17,20}$",
      "description": "A Discord server ID",
      "type": "string"
    },
    "discordTextChannelName": {
      "$comment": "Cannot contain spaces or uppercase letters",
      "description": "A Discord text channel name. No emojis allowed.",
      "type": "string",
      "pattern": "^[a-z0-9-]{2,100}$"
    },
    "discordVoiceChannelName": {
      "pattern": "^[a-zA-Z0-9-_ ]{2,100}$",
      "description": "A Discord voice channel name. No emojis allowed.",
      "type": "string"
    },
    "discordCategoryName": {
      "pattern": "^[a-zA-Z0-9-_ ]{2,100}$",
      "description": "A Discord category name. No emojis allowed.",
      "type": "string"
    },
    "tautulliApiKey": {
      "pattern": "^[a-zA-Z0-9]{32}$",
      "description": "A Tautulli API key",
      "type": "string"
    },
    "tautulliUrl": {
      "$ref": "#/$defs/hostWithIpAndOptionalPort",
      "description": "A Tautulli URL"
    },
    "voiceChannel": {
      "required": [
        "CustomName",
        "CustomEmoji",
        "Enable",
        "VoiceChannelID"
      ],
      "type": "object",
      "properties": {
        "CustomName": {
          "description": "The custom name to use for the voice channel (overrides the default name)",
          "oneOf": [
            {
              "$ref": "#/$defs/discordVoiceChannelName"
            },
            {
              "$ref": "#/$defs/emptyString"
            }
          ]
        },
        "CustomEmoji": {
          "description": "The custom emoji to use for the voice channel (overrides the default emoji)",
          "type": "string"
        },
        "Enable": {
          "description": "Whether to enable the voice channel",
          "type": "boolean"
        },
        "VoiceChannelID": {
          "description": "The ID of the voice channel",
          "oneOf": [
            {
              "$ref": "#/$defs/discordChannelId"
            },
            {
              "$ref": "#/$defs/numberZero"
            }
          ]
        }
      }
    },
    "recentlyAddedVoiceChannel": {
      "required": [
        "CustomName",
        "CustomEmoji",
        "Enable",
        "VoiceChannelID",
        "Hours"
      ],
      "type": "object",
      "properties": {
        "CustomName": {
          "description": "The custom name to use for the voice channel (overrides the default name)",
          "oneOf": [
            {
              "$ref": "#/$defs/discordVoiceChannelName"
            },
            {
              "$ref": "#/$defs/emptyString"
            }
          ]
        },
        "CustomEmoji": {
          "description": "The custom emoji to use for the voice channel (overrides the default emoji)",
          "type": "string"
        },
        "Enable": {
          "description": "Whether to enable the voice channel",
          "type": "boolean"
        },
        "VoiceChannelID": {
          "description": "The ID of the voice channel",
          "oneOf": [
            {
              "$ref": "#/$defs/discordChannelId"
            },
            {
              "$ref": "#/$defs/numberZero"
            }
          ]
        },
        "Hours": {
          "description": "The number of hours to look back for recently added items",
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "library": {
      "required": [
        "Name",
        "AlternateName"
      ],
      "type": "object",
      "properties": {
        "Name": {
          "description": "The name of the library as it appears in Plex",
          "type": "string"
        },
        "ID": {
          "description": "The ID of the library as it appears in Tautulli. Use if the library name is not unique",
          "oneOf": [
            {
              "$ref": "#/$defs/positiveInteger"
            },
            {
              "$ref": "#/$defs/numberZero"
            }
          ]
        },
        "AlternateName": {
          "description": "An alternate name for the library (used as the voice channel name)",
          "oneOf": [
            {
              "$ref": "#/$defs/discordVoiceChannelName"
            },
            {
              "$ref": "#/$defs/emptyString"
            }
          ]
        },
        "Albums": {
          "description": "Settings for the voice channel about album information (used if the library is a music library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Artists": {
          "description": "Settings for the voice channel about artist information (used if the library is a music library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Episodes": {
          "description": "Settings for the voice channel about episode information (used if the library is a TV show library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Movies": {
          "description": "Settings for the voice channel about movie information (used if the library is a movie library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Series": {
          "description": "Settings for the voice channel about series/show information (used if the library is a TV show library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Seasons": {
          "description": "Settings for the voice channel about season information (used if the library is a TV show library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Tracks": {
          "description": "Settings for the voice channel about track information (used if the library is a music library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "RecentlyAdded": {
          "description": "Settings for the voice channel about recently added items",
          "$ref": "#/$defs/recentlyAddedVoiceChannel"
        }
      }
    },
    "combinedLibrarySubLibrary": {
      "required": [
        "Name"
      ],
      "type": "object",
      "properties": {
        "Name": {
          "description": "The name of the library as it appears in Tautulli",
          "type": "string"
        },
        "ID": {
          "description": "The ID of the library as it appears in Tautulli. Use if the library name is not unique",
          "oneOf": [
            {
              "$ref": "#/$defs/positiveInteger"
            },
            {
              "$ref": "#/$defs/numberZero"
            }
          ]
        }
      }
    },
    "combinedLibrary": {
      "required": [
        "Name",
        "Libraries"
      ],
      "type": "object",
      "properties": {
        "Name": {
          "description": "The name for the combined library (used as the voice channel name)",
          "oneOf": [
            {
              "$ref": "#/$defs/discordVoiceChannelName"
            },
            {
              "$ref": "#/$defs/emptyString"
            }
          ]
        },
        "Libraries": {
          "description": "The libraries to combine",
          "type": "array",
          "items": {
            "$ref": "#/$defs/combinedLibrarySubLibrary"
          }
        },
        "Albums": {
          "description": "Settings for the voice channel about album information (used if the library is a music library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Artists": {
          "description": "Settings for the voice channel about artist information (used if the library is a music library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Episodes": {
          "description": "Settings for the voice channel about episode information (used if the library is a TV show library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Movies": {
          "description": "Settings for the voice channel about movie information (used if the library is a movie library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Series": {
          "description": "Settings for the voice channel about series/show information (used if the library is a TV show library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Seasons": {
          "description": "Settings for the voice channel about season information (used if the library is a TV show library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "Tracks": {
          "description": "Settings for the voice channel about track information (used if the library is a music library)",
          "$ref": "#/$defs/voiceChannel"
        },
        "RecentlyAdded": {
          "description": "Settings for the voice channel about recently added items",
          "$ref": "#/$defs/recentlyAddedVoiceChannel"
        }
      }
    }
  }
}
