{
    "version": "5.1.4",
    "description": "Free and reliable P2P Bittorent client.",
    "homepage": "https://www.qbittorrent.org/",
    "license": {
        "identifier": "GPL-2.0-only",
        "url": "https://github.com/qbittorrent/qBittorrent/blob/master/COPYING"
    },
    "architecture": {
        "64bit": {
            "url": "https://downloads.sourceforge.net/project/qbittorrent/qbittorrent-win32/qbittorrent-5.1.4/qbittorrent_5.1.4_qt6_lt20_x64_setup.exe#/dl.7z",
            "hash": "sha1:75660719e5d2c812f09a71881f2b30f035438d6b"
        }
    },
    "pre_install": [
        "Remove-Item \"$dir\\`$PLUGINSDIR\", \"$dir\\uninst.exe\" -Force -Recurse -ErrorAction SilentlyContinue",
        "if ((!(Test-Path \"$persist_dir\\profile\")) -and ((Test-Path \"$persist_dir\\..\\qbittorrent-portable\\profile\") -or (Test-Path \"$env:APPDATA\\qBittorrent\"))) {",
        "    Write-Host \"Scoop is migrating qbittorrent to use portable mode by default.\" -ForegroundColor Yellow",
        "    Write-Host \"For details, see: https://github.com/ScoopInstaller/Extras/issues/5845\" -ForegroundColor Yellow",
        "    if ((Test-Path \"$persist_dir\\..\\qbittorrent-portable\\profile\") -and (Test-Path \"$env:APPDATA\\qBittorrent\")) {",
        "        Write-Host \"Both portable and non-portable qBittorrent profile exist.\" -ForegroundColor Yellow",
        "        Write-Host \"Scoop will prioritize and import the non-portable one.\" -ForegroundColor Yellow",
        "    }",
        "    New-Item \"$persist_dir\\profile\" -ItemType Directory | Out-Null",
        "    if (Test-Path \"$env:APPDATA\\qBittorrent\") {",
        "        Write-Host \"Copying non-portable profile's config and data to Scoop persist directory...\" -ForegroundColor Yellow",
        "        Copy-Item \"$env:APPDATA\\qBittorrent\" \"$persist_dir\\profile\\qBittorrent\\config\" -Recurse | Out-Null",
        "        Copy-Item \"$env:LOCALAPPDATA\\qBittorrent\" \"$persist_dir\\profile\\qBittorrent\\data\" -Recurse | Out-Null",
        "    } else {",
        "        Write-Host \"Copying portable profile's config and data to Scoop persist directory...\" -ForegroundColor Yellow",
        "        Write-Host \"If you haven't setup an absolute download path before torrenting, please manually migrate affected torrents, as they use relative path by default for storaging.\" -ForegroundColor Yellow",
        "        Write-Host \"Or you can move them to an absolute download path in qbittorrent-portable and cleanly (re)install qbittorrent to let migration script to take care of them.\" -ForegroundColor Yellow",
        "        Copy-Item \"$persist_dir\\..\\qbittorrent-portable\\profile\\qBittorrent\\config\" \"$persist_dir\\profile\\qBittorrent\\config\" -Recurse | Out-Null",
        "        Copy-Item \"$persist_dir\\..\\qbittorrent-portable\\profile\\qBittorrent\\data\" \"$persist_dir\\profile\\qBittorrent\\data\" -Recurse | Out-Null",
        "    }",
        "}"
    ],
    "bin": "qbittorrent.exe",
    "shortcuts": [
        [
            "qbittorrent.exe",
            "qBittorrent"
        ]
    ],
    "persist": "profile",
    "checkver": {
        "sourceforge": "qbittorrent/qbittorrent-win32"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://downloads.sourceforge.net/project/qbittorrent/qbittorrent-win32/qbittorrent-$version/qbittorrent_$version_qt6_lt20_x64_setup.exe#/dl.7z"
            }
        }
    }
}
