mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-05-01 07:26:48 +00:00
feat(image): 新增自动下载大图选项(win32 x64)
Co-authored-by: NineBird <CavanasD@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,7 @@ import { insightService } from './services/insightService'
|
||||
import { normalizeWeiboCookieInput, weiboService } from './services/social/weiboService'
|
||||
import { bizService } from './services/bizService'
|
||||
import { backupService } from './services/backupService'
|
||||
import { imageDownloadService } from './services/imageDownloadService'
|
||||
|
||||
// 配置自动更新
|
||||
autoUpdater.autoDownload = false
|
||||
@@ -3954,6 +3955,20 @@ function registerIpcHandlers() {
|
||||
}
|
||||
})
|
||||
|
||||
// 自动下载原图
|
||||
ipcMain.handle('image:startAutoDownload', async () => {
|
||||
await imageDownloadService.startAutoDownload()
|
||||
return { success: true }
|
||||
})
|
||||
|
||||
ipcMain.handle('image:stopAutoDownload', async () => {
|
||||
await imageDownloadService.stopAutoDownload()
|
||||
return { success: true }
|
||||
})
|
||||
|
||||
ipcMain.handle('image:getAutoDownloadStatus', async () => {
|
||||
return await imageDownloadService.getStatus()
|
||||
})
|
||||
}
|
||||
|
||||
// 主窗口引用
|
||||
@@ -4081,6 +4096,9 @@ app.whenReady().then(async () => {
|
||||
// 注册 IPC 处理器
|
||||
updateSplashProgress(28, '正在初始化...')
|
||||
registerIpcHandlers()
|
||||
if (configService.get('autoDownloadHighRes')) {
|
||||
imageDownloadService.startAutoDownload()
|
||||
}
|
||||
chatService.addDbMonitorListener((type, json) => {
|
||||
messagePushService.handleDbMonitorChange(type, json)
|
||||
insightService.handleDbMonitorChange(type, json)
|
||||
@@ -4252,6 +4270,8 @@ const shutdownAppServices = async (): Promise<void> => {
|
||||
}, 5000)
|
||||
forceExitTimer.unref()
|
||||
try { await cloudControlService.stop() } catch {}
|
||||
// 停止自动下载服务
|
||||
try { await imageDownloadService.stopAutoDownload() } catch {}
|
||||
// 停止 chatService(内部会关闭 cursor 与 DB),避免退出阶段仍触发监控回调
|
||||
try { chatService.close() } catch {}
|
||||
// 停止 HTTP 服务器,释放 TCP 端口占用,避免进程无法退出
|
||||
|
||||
Reference in New Issue
Block a user