{
    "version": "20260504",
    "description": "Open source home theater/media center software and entertainment hub for digital media",
    "homepage": "https://kodi.tv/",
    "license": "GPL-2.0-or-later",
    "suggest": {
        "vcredist": "extras/vcredist2022"
    },
    "architecture": {
        "64bit": {
            "url": "https://mirrors.kodi.tv/nightlies/windows/win64/master/KodiSetup-20260504-be91aeb2-master-x64.exe#/dl.7z",
            "hash": "6792d5505ecd0d1b38ba4815ab5e97c001837a0e43a04ba1819edf9222e441ad"
        },
        "32bit": {
            "url": "https://mirrors.kodi.tv/nightlies/windows/win32/master/KodiSetup-20260504-be91aeb2-master-x86.exe#/dl.7z",
            "hash": "627b206e614b2659c047fac900739bc22fb7db40e9e851ebc90f75ebcaaa7be3"
        }
    },
    "post_install": "'$PLUGINSDIR', '$TEMP', 'AppxManifest.xml', 'Uninstall.exe' | ForEach-Object { Remove-Item \"$dir\\$_\" -Recurse -Force }",
    "shortcuts": [
        [
            "kodi.exe",
            "Kodi Dev",
            "-p"
        ]
    ],
    "persist": "portable_data",
    "checkver": {
        "script": [
            "$builds = 'win32', 'win64'",
            "$script_ver = ''",
            "$urls =  @()",
            "foreach ($build in $builds) {",
            "   $base_url = 'https://mirrors.kodi.tv/nightlies/windows/'+ $build + '/master/'",
            "   $dl_page = Invoke-WebRequest $base_url -UseBasicParsing",
            "   $full_version = $dl_page.links | Where-Object href -match '\\.exe$' | Select-Object -first 1 -expand href",
            "   $script_ver = $full_version -split '-' | Select-Object -Skip 1 | Select-Object -First 1",
            "   $urls += $full_version",
            "}",
            "Write-Output ('version:\"' + $script_ver + '\"') ('urls:\"' + $urls + '\"')"
        ],
        "regex": "version:\"(?<version>\\d+)\"\\surls:\"(?<win32bit>.+)\\s(?<win64bit>.+)\""
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://mirrors.kodi.tv/nightlies/windows/win64/master/$matchWin64bit#/dl.7z"
            },
            "32bit": {
                "url": "https://mirrors.kodi.tv/nightlies/windows/win32/master/$matchWin32bit#/dl.7z"
            }
        },
        "hash": {
            "url": "$url?mirrorlist",
            "regex": "$sha256"
        }
    }
}
