Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ files:
asarUnpack:
- resources/**
- '**/*.{metal,exp,lib}'
extraResources:
- from: resources/ffmpeg
to: ffmpeg
filter:
- '**/*'
copyright: Copyright © 2025 EchoPlayer
win:
executableName: EchoPlayer
Expand All @@ -60,9 +55,11 @@ win:
- target: nsis
arch:
- x64
- arm64
- target: portable
arch:
- x64
- arm64
signtoolOptions:
Comment on lines +58 to 63
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Win ARM64 target added — verify code signing and auto-update paths

Adding NSIS/portable arm64 is good, but please confirm:

  • The sign script (scripts/win-sign.js) supports arm64 artifacts.
  • electron-updater serves delta/full updates per-arch and does not cross-serve x64 to arm64.
  • The NSIS include (build/nsis-installer.nsh) has no arch assumptions breaking arm64.

Run locally on a Windows ARM64 VM/device to validate install/update flows. If not feasible, at least confirm release assets include separate arm64 .yml and artifacts and that updater feed lists the correct arch.

🤖 Prompt for AI Agents
In electron-builder.yml around lines 58-63, adding arm64 portable/NSIS targets
requires verification that signing, updater feeds, and installer scripts handle
arm64: update and test scripts/win-sign.js to detect and sign arm64 artifacts
(add arch checks and appropriate signtool args), ensure build output produces
separate x64 and arm64 .yml and artifact files and that the electron-updater
feed/metadata serves per-arch delta/full updates (no cross-serving), and review
build/nsis-installer.nsh for any x64-specific paths or assumptions and make them
arch-conditional; finally validate end-to-end by running install/update on a
Windows ARM64 VM/device or, if not possible, confirm release assets include
distinct arm64 .yml and artifacts and that the updater feed lists the correct
arch entries.

sign: scripts/win-sign.js
verifyUpdateCodeSignature: false
Expand Down
110 changes: 0 additions & 110 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,17 @@ import fs from 'node:fs'
import path from 'node:path'

import react from '@vitejs/plugin-react-swc'
import { spawn } from 'child_process'
import { CodeInspectorPlugin } from 'code-inspector-plugin'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import { resolve } from 'path'

const isDev = process.env.NODE_ENV === 'development'
const isProd = process.env.NODE_ENV === 'production'

// FFmpeg 下载插件
function ffmpegDownloadPlugin() {
return {
name: 'ffmpeg-download',
async buildStart() {
// 只在生产构建时下载 FFmpeg
if (!isProd) return

// 根据构建目标决定下载哪个平台
const targetPlatform = process.env.BUILD_TARGET_PLATFORM || process.platform
const targetArch = process.env.BUILD_TARGET_ARCH || process.arch

// 检查是否已存在,避免重复下载
const ffmpegPath = path.resolve(
'resources/ffmpeg',
`${targetPlatform}-${targetArch}`,
targetPlatform === 'win32' ? 'ffmpeg.exe' : 'ffmpeg'
)

if (fs.existsSync(ffmpegPath)) {
console.log(`FFmpeg already exists for ${targetPlatform}-${targetArch}`)
return
}

console.log(`Downloading FFmpeg for ${targetPlatform}-${targetArch}...`)

try {
await new Promise<void>((resolve, reject) => {
// 在不同环境中使用不同的命令来确保兼容性
let command: string
let args: string[]

if (process.platform === 'win32') {
// Windows 环境:使用 npm run 调用脚本,更可靠
command = 'npm'
args = ['run', 'ffmpeg:download']
} else {
// Unix 环境:直接使用 tsx
command = 'tsx'
args = ['scripts/download-ffmpeg.ts', 'platform', targetPlatform, targetArch]
}

const downloadScript = spawn(command, args, {
stdio: 'inherit',
shell: process.platform === 'win32',
env: {
...process.env,
BUILD_TARGET_PLATFORM: targetPlatform,
BUILD_TARGET_ARCH: targetArch
}
})

downloadScript.on('close', (code) => {
if (code === 0) {
console.log('FFmpeg Downloaded successfully')
resolve()
} else {
reject(new Error(`FFmpeg Download failed with exit code: ${code}`))
}
})

downloadScript.on('error', (error) => {
reject(error)
})
})
} catch (error) {
console.error('FFmpeg Download failed:', error)
throw new Error(`Failed to download FFmpeg for ${targetPlatform}-${targetArch}: ${error}`)
}
}
}
}

export default defineConfig({
main: {
plugins: [
externalizeDepsPlugin(),
ffmpegDownloadPlugin(),
{
name: 'copy-files',
generateBundle() {
Expand Down Expand Up @@ -125,41 +50,6 @@ export default defineConfig({
}
}
}

// 复制 FFmpeg 文件到构建目录
const ffmpegResourcesDir = path.resolve('resources/ffmpeg')
if (fs.existsSync(ffmpegResourcesDir)) {
const outResourcesDir = path.resolve('out/resources/ffmpeg')

try {
// 确保输出目录存在
fs.mkdirSync(outResourcesDir, { recursive: true })

// 复制整个 ffmpeg 目录
const copyDirectoryRecursive = (src: string, dest: string) => {
if (!fs.existsSync(src)) return

fs.mkdirSync(dest, { recursive: true })
const items = fs.readdirSync(src)

for (const item of items) {
const srcPath = path.join(src, item)
const destPath = path.join(dest, item)

if (fs.statSync(srcPath).isDirectory()) {
copyDirectoryRecursive(srcPath, destPath)
} else {
fs.copyFileSync(srcPath, destPath)
}
}
}

copyDirectoryRecursive(ffmpegResourcesDir, outResourcesDir)
console.log('FFmpeg files copied successfully')
} catch (error) {
console.warn('Failed to copy FFmpeg files:', error)
}
}
}
}
],
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
"version:prerelease": "tsx scripts/version-manager.ts prerelease",
"version:beta": "tsx scripts/version-manager.ts minor beta",
"version:beta-patch": "tsx scripts/version-manager.ts patch beta",
"release": "npm run ffmpeg:download-all && npm run build:release && electron-builder --publish onTagOrDraft",
"release:all": "npm run ffmpeg:download-all && npm run build:release && electron-builder --publish always",
"release:never": "npm run ffmpeg:download-all && npm run build:release && electron-builder --publish never",
"release:draft": "npm run ffmpeg:download-all && npm run build:release && electron-builder --publish onTagOrDraft",
"release": "npm run build:release && electron-builder --publish onTagOrDraft",
"release:all": "npm run build:release && electron-builder --publish always",
"release:never": "npm run build:release && electron-builder --publish never",
"release:draft": "npm run build:release && electron-builder --publish onTagOrDraft",
"migrate": "tsx src/main/db/migration-cli.ts",
Comment on lines +51 to 55
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Release scripts simplified — ensure build commands are consistent across OS targets

Good removal of FFmpeg pre-steps. For consistency and type safety, consider aligning platform builds to run the same typecheck + build sequence used by build:release.

-"build:mac": "electron-vite build && electron-builder --mac --publish never",
+"build:mac": "npm run build && electron-builder --mac --publish never",
-"build:linux": "electron-vite build && electron-builder --linux --publish never",
+"build:linux": "npm run build && electron-builder --linux --publish never",

Confirm CI still publishes drafts correctly with --publish onTagOrDraft after this change and that no FFmpeg binaries are bundled in artifacts (by inspecting release assets).

Committable suggestion skipped: line range outside the PR's diff.

"migrate:up": "npm run migrate up",
"migrate:down": "npm run migrate down",
Expand All @@ -71,9 +71,7 @@
"ffmpeg:download": "tsx scripts/download-ffmpeg.ts current",
"ffmpeg:download-all": "tsx scripts/download-ffmpeg.ts all",
"ffmpeg:clean": "tsx scripts/download-ffmpeg.ts clean",
"ffmpeg:test": "tsx scripts/test-ffmpeg-integration.ts",
"prebuild": "npm run ffmpeg:download",
"prebuild:release": "echo 'FFmpeg already downloaded by release script'"
"ffmpeg:test": "tsx scripts/test-ffmpeg-integration.ts"
},
"dependencies": {
"@ant-design/icons": "^6.0.1",
Expand Down
12 changes: 12 additions & 0 deletions packages/shared/IpcChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ export enum IpcChannel {
Ffmpeg_GetVideoInfo = 'ffmpeg:get-video-info',
Ffmpeg_Warmup = 'ffmpeg:warmup',
Ffmpeg_GetWarmupStatus = 'ffmpeg:get-warmup-status',
Ffmpeg_GetInfo = 'ffmpeg:get-info',
Ffmpeg_AutoDetectAndDownload = 'ffmpeg:auto-detect-and-download',

// FFmpeg 下载相关 IPC 通道 / FFmpeg download related IPC channels
FfmpegDownload_CheckExists = 'ffmpeg-download:check-exists',
FfmpegDownload_GetVersion = 'ffmpeg-download:get-version',
FfmpegDownload_Download = 'ffmpeg-download:download',
FfmpegDownload_GetProgress = 'ffmpeg-download:get-progress',
FfmpegDownload_Cancel = 'ffmpeg-download:cancel',
FfmpegDownload_Remove = 'ffmpeg-download:remove',
FfmpegDownload_GetAllVersions = 'ffmpeg-download:get-all-versions',
FfmpegDownload_CleanupTemp = 'ffmpeg-download:cleanup-temp',

// MediaInfo 相关 IPC 通道 / MediaInfo related IPC channels
MediaInfo_CheckExists = 'mediainfo:check-exists',
Expand Down
12 changes: 11 additions & 1 deletion src/main/__tests__/ipc.database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,17 @@ vi.mock('../services/FFmpegService', () => ({
getVideoInfo: vi.fn(),
transcodeVideo: vi.fn(),
cancelTranscode: vi.fn(),
getFFmpegPath: vi.fn()
getFFmpegPath: vi.fn(),
getDownloadService: vi.fn(() => ({
checkFFmpegExists: vi.fn(),
getFFmpegVersion: vi.fn(),
downloadFFmpeg: vi.fn(),
getDownloadProgress: vi.fn(),
cancelDownload: vi.fn(),
removeFFmpeg: vi.fn(),
getAllSupportedVersions: vi.fn(),
cleanupTempFiles: vi.fn()
}))
Comment on lines +169 to +179
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Mock surface alignment for new FFmpeg download API

The nested getDownloadService mock mirrors production API well. To reduce drift, strongly type this mock against the service return type so CI breaks if the surface changes.

Example:

-vi.mock('../services/FFmpegService', () => ({
-  default: vi.fn().mockImplementation(() => ({
+vi.mock('../services/FFmpegService', () => {
+  type DownloadSvc = ReturnType<import('../services/FFmpegService').default['getDownloadService']>;
+  const downloadSvc: DownloadSvc = {
+    checkFFmpegExists: vi.fn(),
+    getFFmpegVersion: vi.fn(),
+    downloadFFmpeg: vi.fn(),
+    getDownloadProgress: vi.fn(),
+    cancelDownload: vi.fn(),
+    removeFFmpeg: vi.fn(),
+    getAllSupportedVersions: vi.fn(),
+    cleanupTempFiles: vi.fn()
+  };
+  return {
+    default: vi.fn().mockImplementation(() => ({
       checkFFmpegExists: vi.fn(),
       getFFmpegVersion: vi.fn(),
       downloadFFmpeg: vi.fn(),
       getVideoInfo: vi.fn(),
       transcodeVideo: vi.fn(),
       cancelTranscode: vi.fn(),
       getFFmpegPath: vi.fn(),
-      getDownloadService: vi.fn(() => ({
-        checkFFmpegExists: vi.fn(),
-        getFFmpegVersion: vi.fn(),
-        downloadFFmpeg: vi.fn(),
-        getDownloadProgress: vi.fn(),
-        cancelDownload: vi.fn(),
-        removeFFmpeg: vi.fn(),
-        getAllSupportedVersions: vi.fn(),
-        cleanupTempFiles: vi.fn()
-      }))
-    }))
-  }))
-}))
+      getDownloadService: vi.fn(() => downloadSvc)
+    }))
+  };
+})
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
getFFmpegPath: vi.fn(),
getDownloadService: vi.fn(() => ({
checkFFmpegExists: vi.fn(),
getFFmpegVersion: vi.fn(),
downloadFFmpeg: vi.fn(),
getDownloadProgress: vi.fn(),
cancelDownload: vi.fn(),
removeFFmpeg: vi.fn(),
getAllSupportedVersions: vi.fn(),
cleanupTempFiles: vi.fn()
}))
vi.mock('../services/FFmpegService', () => {
type DownloadSvc = ReturnType<import('../services/FFmpegService').default['getDownloadService']>;
const downloadSvc: DownloadSvc = {
checkFFmpegExists: vi.fn(),
getFFmpegVersion: vi.fn(),
downloadFFmpeg: vi.fn(),
getDownloadProgress: vi.fn(),
cancelDownload: vi.fn(),
removeFFmpeg: vi.fn(),
getAllSupportedVersions: vi.fn(),
cleanupTempFiles: vi.fn()
};
return {
default: vi.fn().mockImplementation(() => ({
checkFFmpegExists: vi.fn(),
getFFmpegVersion: vi.fn(),
downloadFFmpeg: vi.fn(),
getVideoInfo: vi.fn(),
transcodeVideo: vi.fn(),
cancelTranscode: vi.fn(),
getFFmpegPath: vi.fn(),
getDownloadService: vi.fn(() => downloadSvc)
}))
};
});
🤖 Prompt for AI Agents
In src/main/__tests__/ipc.database.test.ts around lines 169-179, the nested
getDownloadService mock isn't strongly typed to the real service interface so
tests won't catch API changes; update the mock to be typed to the download
service return type (import the service type or use ReturnType<typeof
getDownloadServiceFactory>) and declare the mock as returning that type so
TypeScript enforces the mock surface, then ensure each mocked method matches the
service signature (use vi.fn() for each method) and update any imports as
needed.

}))
}))

Expand Down
45 changes: 45 additions & 0 deletions src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,51 @@ export function registerIpc(mainWindow: BrowserWindow, app: Electron.App) {
ipcMain.handle(IpcChannel.Ffmpeg_GetWarmupStatus, async () => {
return FFmpegService.getWarmupStatus()
})
ipcMain.handle(IpcChannel.Ffmpeg_GetInfo, async () => {
return ffmpegService.getFFmpegInfo()
})
ipcMain.handle(IpcChannel.Ffmpeg_AutoDetectAndDownload, async () => {
return await ffmpegService.autoDetectAndDownload()
})

// FFmpeg 下载服务
const ffmpegDownloadService = ffmpegService.getDownloadService()
ipcMain.handle(
IpcChannel.FfmpegDownload_CheckExists,
async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.checkFFmpegExists(platform as any, arch as any)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_GetVersion,
async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.getFFmpegVersion(platform as any, arch as any)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_Download,
async (_, platform?: string, arch?: string) => {
return await ffmpegDownloadService.downloadFFmpeg(platform as any, arch as any)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_GetProgress,
async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.getDownloadProgress(platform as any, arch as any)
}
)
ipcMain.handle(IpcChannel.FfmpegDownload_Cancel, async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.cancelDownload(platform as any, arch as any)
})
ipcMain.handle(IpcChannel.FfmpegDownload_Remove, async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.removeFFmpeg(platform as any, arch as any)
})
ipcMain.handle(IpcChannel.FfmpegDownload_GetAllVersions, async () => {
return ffmpegDownloadService.getAllSupportedVersions()
})
ipcMain.handle(IpcChannel.FfmpegDownload_CleanupTemp, async () => {
return ffmpegDownloadService.cleanupTempFiles()
})
Comment on lines +477 to +521
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Type the platform/arch params; avoid any-casts

Use Node’s platform/arch types to prevent invalid inputs and remove as any.

-  const ffmpegDownloadService = ffmpegService.getDownloadService()
+  const ffmpegDownloadService = ffmpegService.getDownloadService()
@@
-    async (_, platform?: string, arch?: string) => {
-      return ffmpegDownloadService.checkFFmpegExists(platform as any, arch as any)
+    async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
+      return ffmpegDownloadService.checkFFmpegExists(platform, arch)
     }
   )
@@
-    async (_, platform?: string, arch?: string) => {
-      return ffmpegDownloadService.getFFmpegVersion(platform as any, arch as any)
+    async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
+      return ffmpegDownloadService.getFFmpegVersion(platform, arch)
     }
   )
@@
-    async (_, platform?: string, arch?: string) => {
-      return await ffmpegDownloadService.downloadFFmpeg(platform as any, arch as any)
+    async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
+      return await ffmpegDownloadService.downloadFFmpeg(platform, arch)
     }
   )
@@
-    async (_, platform?: string, arch?: string) => {
-      return ffmpegDownloadService.getDownloadProgress(platform as any, arch as any)
+    async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
+      return ffmpegDownloadService.getDownloadProgress(platform, arch)
     }
   )
-  ipcMain.handle(IpcChannel.FfmpegDownload_Cancel, async (_, platform?: string, arch?: string) => {
-    return ffmpegDownloadService.cancelDownload(platform as any, arch as any)
+  ipcMain.handle(IpcChannel.FfmpegDownload_Cancel, async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
+    return ffmpegDownloadService.cancelDownload(platform, arch)
   })
-  ipcMain.handle(IpcChannel.FfmpegDownload_Remove, async (_, platform?: string, arch?: string) => {
-    return ffmpegDownloadService.removeFFmpeg(platform as any, arch as any)
+  ipcMain.handle(IpcChannel.FfmpegDownload_Remove, async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
+    return ffmpegDownloadService.removeFFmpeg(platform, arch)
   })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ipcMain.handle(IpcChannel.Ffmpeg_GetInfo, async () => {
return ffmpegService.getFFmpegInfo()
})
ipcMain.handle(IpcChannel.Ffmpeg_AutoDetectAndDownload, async () => {
return await ffmpegService.autoDetectAndDownload()
})
// FFmpeg 下载服务
const ffmpegDownloadService = ffmpegService.getDownloadService()
ipcMain.handle(
IpcChannel.FfmpegDownload_CheckExists,
async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.checkFFmpegExists(platform as any, arch as any)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_GetVersion,
async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.getFFmpegVersion(platform as any, arch as any)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_Download,
async (_, platform?: string, arch?: string) => {
return await ffmpegDownloadService.downloadFFmpeg(platform as any, arch as any)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_GetProgress,
async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.getDownloadProgress(platform as any, arch as any)
}
)
ipcMain.handle(IpcChannel.FfmpegDownload_Cancel, async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.cancelDownload(platform as any, arch as any)
})
ipcMain.handle(IpcChannel.FfmpegDownload_Remove, async (_, platform?: string, arch?: string) => {
return ffmpegDownloadService.removeFFmpeg(platform as any, arch as any)
})
ipcMain.handle(IpcChannel.FfmpegDownload_GetAllVersions, async () => {
return ffmpegDownloadService.getAllSupportedVersions()
})
ipcMain.handle(IpcChannel.FfmpegDownload_CleanupTemp, async () => {
return ffmpegDownloadService.cleanupTempFiles()
})
ipcMain.handle(IpcChannel.Ffmpeg_GetInfo, async () => {
return ffmpegService.getFFmpegInfo()
})
ipcMain.handle(IpcChannel.Ffmpeg_AutoDetectAndDownload, async () => {
return await ffmpegService.autoDetectAndDownload()
})
// FFmpeg 下载服务
const ffmpegDownloadService = ffmpegService.getDownloadService()
ipcMain.handle(
IpcChannel.FfmpegDownload_CheckExists,
async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
return ffmpegDownloadService.checkFFmpegExists(platform, arch)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_GetVersion,
async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
return ffmpegDownloadService.getFFmpegVersion(platform, arch)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_Download,
async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
return await ffmpegDownloadService.downloadFFmpeg(platform, arch)
}
)
ipcMain.handle(
IpcChannel.FfmpegDownload_GetProgress,
async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
return ffmpegDownloadService.getDownloadProgress(platform, arch)
}
)
ipcMain.handle(IpcChannel.FfmpegDownload_Cancel, async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
return ffmpegDownloadService.cancelDownload(platform, arch)
})
ipcMain.handle(IpcChannel.FfmpegDownload_Remove, async (_, platform?: typeof process.platform, arch?: typeof process.arch) => {
return ffmpegDownloadService.removeFFmpeg(platform, arch)
})
ipcMain.handle(IpcChannel.FfmpegDownload_GetAllVersions, async () => {
return ffmpegDownloadService.getAllSupportedVersions()
})
ipcMain.handle(IpcChannel.FfmpegDownload_CleanupTemp, async () => {
return ffmpegDownloadService.cleanupTempFiles()
})
🤖 Prompt for AI Agents
In src/main/ipc.ts around lines 477-521, the IPC handlers accept platform and
arch as optional untyped params and then cast them with "as any"; change the
handler parameter types to use Node's platform/arch types (e.g. platform?:
NodeJS.Platform, arch?: NodeJS.Arch) and remove the "as any" casts when calling
ffmpegDownloadService methods; if necessary update the ffmpegDownloadService
method signatures to accept NodeJS.Platform and NodeJS.Arch so types align, and
ensure any ipcMain.handle generic type signatures reflect the correct
argument/return types to avoid implicit any.


// MediaParser (Remotion)
ipcMain.handle(IpcChannel.MediaInfo_CheckExists, async () => {
Expand Down
26 changes: 1 addition & 25 deletions src/main/services/AppUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,21 +274,13 @@ export default class AppUpdater {
if (!this.releaseInfo) {
return
}
// const locale = locales[configManager.getLanguage()]
// const { update: updateLocale } = locale.translation

let detail = this.formatReleaseNotes(this.releaseInfo.releaseNotes)
if (detail === '') {
detail = 'No release notes'
}

dialog
.showMessageBox({
type: 'info',
title: 'Update available',
icon,
message: 'A new version is available. Do you want to download it now?',
detail,
message: `A new version (${this.releaseInfo.version}) is available. Do you want to install it now?\n\nYou can view the release notes in Settings > About.`,
buttons: ['Later', 'Install'],
defaultId: 1,
cancelId: 0
Expand All @@ -302,18 +294,6 @@ export default class AppUpdater {
}
})
}

private formatReleaseNotes(releaseNotes: string | ReleaseNoteInfo[] | null | undefined): string {
if (!releaseNotes) {
return ''
}

if (typeof releaseNotes === 'string') {
return releaseNotes
}

return releaseNotes.map((note) => note.note).join('\n')
}
}
interface GithubReleaseInfo {
id: number
Expand All @@ -335,7 +315,3 @@ interface GithubReleaseInfo {
created_at: string
}>
}
interface ReleaseNoteInfo {
readonly version: string
readonly note: string | null
}
Loading
Loading