{
    "appId": "com.fourgray.iptvnator",
    "productName": "IPTVnator",
    "artifactName": "${name}-${version}-${os}-${arch}.${ext}",
    "directories": {
        "buildResources": "dist/apps",
        "output": "dist/executables"
    },
    "files": [
        {
            "from": "dist/apps/remote-control-web",
            "to": "remote-control-web",
            "filter": ["**/*"]
        },
        "electron-backend/**/*",
        "web/**/*",
        "!**/*.map"
    ],
    "asarUnpack": [
        "**/better-sqlite3/**",
        "**/bindings/**",
        "**/file-uri-to-path/**",
        "**/*.node",
        "**/*.dylib"
    ],
    "extraMetadata": {
        "name": "iptvnator",
        "productName": "IPTVnator",
        "main": "electron-backend/main.js"
    },
    "extraResources": ["dist/apps/electron-backend/workers"],
    "mac": {
        "target": {
            "target": "dmg",
            "arch": ["x64", "arm64"]
        },
        "category": "public.app-category.video",
        "forceCodeSigning": true,
        "gatekeeperAssess": false,
        "hardenedRuntime": true,
        "entitlements": "apps/electron-backend/macos/entitlements.mac.plist",
        "entitlementsInherit": "apps/electron-backend/macos/entitlements.mac.inherit.plist",
        "notarize": true,
        "icon": "apps/web/src/assets/icons/favicon.icns"
    },
    "linux": {
        "category": "Video",
        "executableName": "iptvnator",
        "desktop": {
            "entry": {
                "StartupWMClass": "iptvnator"
            }
        },
        "target": [
            {
                "target": "AppImage",
                "arch": ["x64", "armv7l", "arm64"]
            },
            {
                "target": "deb",
                "arch": ["x64", "armv7l", "arm64"]
            },
            {
                "target": "Snap",
                "arch": ["x64", "armv7l"]
            },
            {
                "target": "rpm",
                "arch": ["x64"]
            },
            {
                "target": "pacman",
                "arch": ["x64"]
            },
            {
                "target": "flatpak",
                "arch": ["x64"]
            }
        ],
        "artifactName": "${name}-${version}-${os}-${arch}.${ext}",
        "icon": "apps/web/src/assets/icons"
    },
    "flatpak": {
        "branch": "stable",
        "runtime": "org.freedesktop.Platform",
        "runtimeVersion": "24.08",
        "sdk": "org.freedesktop.Sdk",
        "base": "org.electronjs.Electron2.BaseApp",
        "baseVersion": "24.08",
        "finishArgs": [
            "--socket=wayland",
            "--socket=x11",
            "--share=ipc",
            "--device=dri",
            "--socket=pulseaudio",
            "--filesystem=home",
            "--share=network",
            "--talk-name=org.freedesktop.Notifications",
            "--talk-name=org.freedesktop.Flatpak"
        ],
        "files": [
            [
                "apps/electron-backend/linux/com.fourgray.iptvnator.metainfo.xml",
                "/share/metainfo/com.fourgray.iptvnator.metainfo.xml"
            ]
        ]
    },
    "afterPack": "./tools/packaging/electron-after-pack.cjs",
    "snap": {
        "base": "core22",
        "confinement": "strict",
        "grade": "stable",
        "summary": "IPTV application for M3U playlists, Xtream Codes API, and Stalker portals",
        "executableArgs": ["--ozone-platform=x11"],
        "environment": {
            "DISABLE_WAYLAND": "1"
        }
    },
    "win": {
        "compression": "maximum",
        "target": [
            {
                "target": "nsis",
                "arch": ["x64", "ia32"]
            }
        ],
        "artifactName": "${name}-${version}-windows-${arch}-setup.${ext}",
        "icon": "apps/web/src/assets/icons/icon.png"
    },
    "nsis": {
        "artifactName": "${name}-${version}-windows-${arch}-setup.${ext}"
    }
}
