const defaultSchema = [
  {
    key: 'drive_mode',
    category: 'Laufwerk',
    label: 'Laufwerksmodus',
    type: 'select',
    required: 1,
    description: 'Auto-Discovery oder explizites Device.',
    defaultValue: 'auto',
    options: [
      { label: 'Auto Discovery', value: 'auto' },
      { label: 'Explizites Device', value: 'explicit' }
    ],
    validation: {},
    orderIndex: 10
  },
  {
    key: 'drive_device',
    category: 'Laufwerk',
    label: 'Device Pfad',
    type: 'path',
    required: 0,
    description: 'Nur für expliziten Modus, z.B. /dev/sr0.',
    defaultValue: '/dev/sr0',
    options: [],
    validation: {},
    orderIndex: 20
  },
  {
    key: 'makemkv_source_index',
    category: 'Laufwerk',
    label: 'MakeMKV Source Index',
    type: 'number',
    required: 1,
    description: 'Disc Index im Auto-Modus.',
    defaultValue: '0',
    options: [],
    validation: { min: 0, max: 20 },
    orderIndex: 30
  },
  {
    key: 'disc_poll_interval_ms',
    category: 'Laufwerk',
    label: 'Polling Intervall (ms)',
    type: 'number',
    required: 1,
    description: 'Intervall für Disk-Erkennung.',
    defaultValue: '4000',
    options: [],
    validation: { min: 1000, max: 60000 },
    orderIndex: 40
  },
  {
    key: 'raw_dir',
    category: 'Pfade',
    label: 'Raw Ausgabeordner',
    type: 'path',
    required: 1,
    description: 'Zwischenablage für MakeMKV Rip.',
    defaultValue: '/mnt/arm-storage/media/raw',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 100
  },
  {
    key: 'movie_dir',
    category: 'Pfade',
    label: 'Film Ausgabeordner',
    type: 'path',
    required: 1,
    description: 'Finale HandBrake Ausgabe.',
    defaultValue: '/mnt/arm-storage/media/movies',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 110
  },
  {
    key: 'log_dir',
    category: 'Pfade',
    label: 'Log Ordner',
    type: 'path',
    required: 1,
    description: 'Basisordner für Logs. Job-Logs liegen direkt hier, Backend-Logs in /backend.',
    defaultValue: '/mnt/arm-storage/logs',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 120
  },
  {
    key: 'hardware_monitoring_enabled',
    category: 'Monitoring',
    label: 'Hardware Monitoring aktiviert',
    type: 'boolean',
    required: 1,
    description: 'Master-Schalter: aktiviert/deaktiviert das komplette Hardware-Monitoring (Polling + Berechnung + WebSocket-Updates).',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 130
  },
  {
    key: 'hardware_monitoring_interval_ms',
    category: 'Monitoring',
    label: 'Hardware Monitoring Intervall (ms)',
    type: 'number',
    required: 1,
    description: 'Polling-Intervall für CPU/RAM/GPU/Storage-Metriken.',
    defaultValue: '5000',
    options: [],
    validation: { min: 1000, max: 60000 },
    orderIndex: 140
  },
  {
    key: 'makemkv_command',
    category: 'Tools',
    label: 'MakeMKV Kommando',
    type: 'string',
    required: 1,
    description: 'Pfad oder Befehl für makemkvcon.',
    defaultValue: 'makemkvcon',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 200
  },
  {
    key: 'makemkv_registration_key',
    category: 'Tools',
    label: 'MakeMKV Key',
    type: 'string',
    required: 0,
    description: 'Optionaler Registrierungsschlüssel. Wird vor Analyze/Rip automatisch per "makemkvcon reg" gesetzt.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 202
  },
  {
    key: 'mediainfo_command',
    category: 'Tools',
    label: 'Mediainfo Kommando',
    type: 'string',
    required: 1,
    description: 'Pfad oder Befehl für mediainfo.',
    defaultValue: 'mediainfo',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 205
  },
  {
    key: 'mediainfo_extra_args',
    category: 'Tools',
    label: 'Mediainfo Extra Args',
    type: 'string',
    required: 0,
    description: 'Zusätzliche CLI-Parameter für mediainfo.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 206
  },
  {
    key: 'makemkv_min_length_minutes',
    category: 'Tools',
    label: 'Minimale Titellänge (Minuten)',
    type: 'number',
    required: 1,
    description: 'Filtert kurze Titel beim Rip.',
    defaultValue: '60',
    options: [],
    validation: { min: 1, max: 1000 },
    orderIndex: 210
  },
  {
    key: 'pipeline_max_parallel_jobs',
    category: 'Tools',
    label: 'Parallele Jobs',
    type: 'number',
    required: 1,
    description: 'Maximale Anzahl parallel laufender Jobs. Weitere Starts landen in der Queue.',
    defaultValue: '1',
    options: [],
    validation: { min: 1, max: 12 },
    orderIndex: 211
  },
  {
    key: 'makemkv_rip_mode',
    category: 'Tools',
    label: 'MakeMKV Rip Modus',
    type: 'select',
    required: 1,
    description: 'mkv: direkte MKV-Dateien; backup: vollständige Blu-ray Struktur im RAW-Ordner.',
    defaultValue: 'backup',
    options: [
      { label: 'MKV', value: 'mkv' },
      { label: 'Backup', value: 'backup' }
    ],
    validation: {},
    orderIndex: 212
  },
  {
    key: 'makemkv_analyze_extra_args',
    category: 'Tools',
    label: 'MakeMKV Analyze Extra Args',
    type: 'string',
    required: 0,
    description: 'Zusätzliche CLI-Parameter für Analyze.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 220
  },
  {
    key: 'makemkv_rip_extra_args',
    category: 'Tools',
    label: 'MakeMKV Rip Extra Args',
    type: 'string',
    required: 0,
    description: 'Zusätzliche CLI-Parameter für Rip.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 230
  },
  {
    key: 'handbrake_command',
    category: 'Tools',
    label: 'HandBrake Kommando',
    type: 'string',
    required: 1,
    description: 'Pfad oder Befehl für HandBrakeCLI.',
    defaultValue: 'HandBrakeCLI',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 300
  },
  {
    key: 'handbrake_preset',
    category: 'Tools',
    label: 'HandBrake Preset',
    type: 'string',
    required: 1,
    description: 'Preset Name für -Z.',
    defaultValue: 'H.264 MKV 1080p30',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 310
  },
  {
    key: 'handbrake_extra_args',
    category: 'Tools',
    label: 'HandBrake Extra Args',
    type: 'string',
    required: 0,
    description: 'Zusätzliche CLI-Argumente.',
    defaultValue: '--audio-lang-list deu,eng --first-audio --subtitle-lang-list deu,eng --first-subtitle --aencoder copy --audio-copy-mask ac3,eac3,dts --audio-fallback ac3 --encoder-preset slow --quality 18 --encoder-tune film --encoder-profile high --encoder-level 4.1',
    options: [],
    validation: {},
    orderIndex: 320
  },
  {
    key: 'handbrake_restart_delete_incomplete_output',
    category: 'Tools',
    label: 'Encode-Neustart: unvollständige Ausgabe löschen',
    type: 'boolean',
    required: 1,
    description: 'Wenn aktiv, wird bei "Encode neu starten" der bisherige (nicht erfolgreiche) Output vor Start entfernt.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 325
  },
  {
    key: 'output_extension',
    category: 'Tools',
    label: 'Ausgabeformat',
    type: 'select',
    required: 1,
    description: 'Dateiendung für finale Datei.',
    defaultValue: 'mkv',
    options: [
      { label: 'MKV', value: 'mkv' },
      { label: 'MP4', value: 'mp4' }
    ],
    validation: {},
    orderIndex: 330
  },
  {
    key: 'filename_template',
    category: 'Tools',
    label: 'Dateiname Template',
    type: 'string',
    required: 1,
    description: 'Verfügbare Tokens: ${title}, ${year}, ${imdbId}.',
    defaultValue: '${title} (${year})',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 340
  },
  {
    key: 'output_folder_template',
    category: 'Tools',
    label: 'Ordnername Template',
    type: 'string',
    required: 0,
    description: 'Optional. Verfügbare Tokens: ${title}, ${year}, ${imdbId}. Leer = Dateiname-Template verwenden.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 345
  },
  {
    key: 'omdb_api_key',
    category: 'Metadaten',
    label: 'OMDb API Key',
    type: 'string',
    required: 0,
    description: 'API Key für Metadatensuche.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 400
  },
  {
    key: 'omdb_default_type',
    category: 'Metadaten',
    label: 'OMDb Typ',
    type: 'select',
    required: 1,
    description: 'Vorauswahl für Suche.',
    defaultValue: 'movie',
    options: [
      { label: 'Movie', value: 'movie' },
      { label: 'Series', value: 'series' },
      { label: 'Episode', value: 'episode' }
    ],
    validation: {},
    orderIndex: 410
  },
  {
    key: 'pushover_enabled',
    category: 'Benachrichtigungen',
    label: 'PushOver aktiviert',
    type: 'boolean',
    required: 1,
    description: 'Master-Schalter für PushOver Versand.',
    defaultValue: 'false',
    options: [],
    validation: {},
    orderIndex: 500
  },
  {
    key: 'pushover_token',
    category: 'Benachrichtigungen',
    label: 'PushOver Token',
    type: 'string',
    required: 0,
    description: 'Application Token für PushOver.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 510
  },
  {
    key: 'pushover_user',
    category: 'Benachrichtigungen',
    label: 'PushOver User',
    type: 'string',
    required: 0,
    description: 'User-Key für PushOver.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 520
  },
  {
    key: 'pushover_device',
    category: 'Benachrichtigungen',
    label: 'PushOver Device (optional)',
    type: 'string',
    required: 0,
    description: 'Optionales Ziel-Device in PushOver.',
    defaultValue: '',
    options: [],
    validation: {},
    orderIndex: 530
  },
  {
    key: 'pushover_title_prefix',
    category: 'Benachrichtigungen',
    label: 'PushOver Titel-Präfix',
    type: 'string',
    required: 1,
    description: 'Prefix im PushOver Titel.',
    defaultValue: 'Ripster',
    options: [],
    validation: { minLength: 1 },
    orderIndex: 540
  },
  {
    key: 'pushover_priority',
    category: 'Benachrichtigungen',
    label: 'PushOver Priority',
    type: 'number',
    required: 1,
    description: 'Priorität -2 bis 2.',
    defaultValue: '0',
    options: [],
    validation: { min: -2, max: 2 },
    orderIndex: 550
  },
  {
    key: 'pushover_timeout_ms',
    category: 'Benachrichtigungen',
    label: 'PushOver Timeout (ms)',
    type: 'number',
    required: 1,
    description: 'HTTP Timeout für PushOver Requests.',
    defaultValue: '7000',
    options: [],
    validation: { min: 1000, max: 60000 },
    orderIndex: 560
  },
  {
    key: 'pushover_notify_metadata_ready',
    category: 'Benachrichtigungen',
    label: 'Bei Metadaten-Auswahl senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet wenn Metadaten zur Auswahl bereitstehen.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 570
  },
  {
    key: 'pushover_notify_rip_started',
    category: 'Benachrichtigungen',
    label: 'Bei Rip-Start senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet beim Start des MakeMKV-Rips.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 580
  },
  {
    key: 'pushover_notify_encoding_started',
    category: 'Benachrichtigungen',
    label: 'Bei Encode-Start senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet beim Start von HandBrake.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 590
  },
  {
    key: 'pushover_notify_job_finished',
    category: 'Benachrichtigungen',
    label: 'Bei Erfolg senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet bei erfolgreich abgeschlossenem Job.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 600
  },
  {
    key: 'pushover_notify_job_error',
    category: 'Benachrichtigungen',
    label: 'Bei Fehler senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet bei Fehlern in der Pipeline.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 610
  },
  {
    key: 'pushover_notify_job_cancelled',
    category: 'Benachrichtigungen',
    label: 'Bei Abbruch senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet wenn Job manuell abgebrochen wurde.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 620
  },
  {
    key: 'pushover_notify_reencode_started',
    category: 'Benachrichtigungen',
    label: 'Bei Re-Encode Start senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet beim Start von RAW Re-Encode.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 630
  },
  {
    key: 'pushover_notify_reencode_finished',
    category: 'Benachrichtigungen',
    label: 'Bei Re-Encode Erfolg senden',
    type: 'boolean',
    required: 1,
    description: 'Sendet bei erfolgreichem RAW Re-Encode.',
    defaultValue: 'true',
    options: [],
    validation: {},
    orderIndex: 640
  }
];

module.exports = {
  defaultSchema
};
