{
  "version": 5,
  "script": {
    "version": "0.1.0",
    "changeLog": "Auto-generated draft from TrueNAS spotify-to-plex 1.0.6"
  },
  "installation_questions": [
    {
      "question": "Spotify api client id",
      "type": "text",
      "key": "spotify_api_client_id",
      "required": true
    },
    {
      "question": "Spotify api client secret",
      "type": "password",
      "key": "spotify_api_client_secret",
      "required": true
    }
  ],
  "requirements": {
    "locations": ["ApplicationsPerformance", "Media"],
    "specifications": ["2CORE"],
    "permissions": ["READ_WRITE_LOCATIONS"],
    "ports": [30468]
  },
  "ensure_directories_exists": [
    {"path": "$LOCATION(ApplicationsPerformance)"},
    {"path": "$LOCATION(ApplicationsPerformance)/spotify-to-plex"},
    {"path": "$LOCATION(Media)", "network_share": true},
    {
      "path": "$LOCATION(ApplicationsPerformance)/spotify-to-plex/config",
      "snapshot": {"id": "config"}
    }
  ],
  "app_values": {
    "spotify_to_plex": {
      "spotify_api_client_id": "$QUESTION(spotify_api_client_id)",
      "spotify_api_client_secret": "$QUESTION(spotify_api_client_secret)",
      "encryption_key": "$RANDOM_STRING(32)"
    },
    "storage": {
      "config": "$HOST_PATH($LOCATION(ApplicationsPerformance)/spotify-to-plex/config)",
      "additional_storage": [
        "$MOUNTED_HOST_PATH($LOCATION(Media), /media)"
      ]
    },
    "network": {
      "web_port": {"bind_mode": "published", "port_number": 30468}
    },
    "resources": {"limits": {"cpus": 2, "memory": "$MEMORY(10%, 4096)"}}
  }
}
