Skip to content

Commit

Permalink
修正保存文件夹
Browse files Browse the repository at this point in the history
  • Loading branch information
OToNaShiAKi committed Apr 20, 2022
1 parent 7754a1f commit 55a3a0b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

任何使用问题、bug、功能需求可以提 issue。

左侧 release 中下载 exe 即可,因为没有 mac 设备所以没法打包 mac 版本,如有需要可阅读 development.md 自行打包。
右侧 release 中下载 exe 即可,因为没有 mac 设备所以没法打包 mac 版本,如有需要可阅读 development.md 自行打包。

## 使用介绍

Expand Down Expand Up @@ -66,10 +66,14 @@

配置工具主题色和切换亮色、暗色模式

## 后续功能
## 其它功能

### 导出棉花糖

### 屏蔽词划分房间
将棉花糖图片导出,支持单独导出中文、翻译、合并样式,且合并样式支持

## 后续功能

注:此功能非添加/删除房间的屏蔽词,而是将屏蔽词处理为可发送弹幕
### 导出视频鉴赏

该功能主要针对 b 站的屏蔽词,如果是针对某个直播间设置的屏蔽词,毕竟都被屏蔽了感觉同传时候也不怎么会遇得所以在纠结要不要加
将 Bilibili 某动态下的视频捕获,筛选过后导出 Excel 文档
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build -p always",
"electron:build": "vue-cli-service electron:build ",
"electron:serve": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps"
Expand Down
23 changes: 17 additions & 6 deletions src/ipc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ipcMain, BrowserWindow } from "electron";
import { ipcMain, BrowserWindow, dialog } from "electron";
import {
SendComment,
Bilibili,
Expand All @@ -12,7 +12,7 @@ import {
RemoveSilentUser,
} from "./plugins/axios";
import { e } from "./plugins/utils";
import { writeFile, mkdir, stat } from "fs/promises";
import { writeFile, mkdir } from "fs/promises";
import createWindow from "./background";
import { join } from "path";

Expand Down Expand Up @@ -134,12 +134,23 @@ ipcMain.handle("CutWord", async (event, phrase) => {
ipcMain.on("OtherWindow", (event, page) => {
const wins = BrowserWindow.getAllWindows();
if (wins.length < 2)
createWindow(page, { width: 1500, height: 1080, alwaysOnTop: false });
createWindow(page, {
width: 1920,
height: 1080,
x: 0,
y: 0,
alwaysOnTop: false,
});
});

ipcMain.on("SaveImage", async (event, Base64) => {
const time = Date.now();
const folder = join(__dirname, "./images");
await mkdir(folder, { recursive: true });
await writeFile(join(folder, `${time}.png`), Base64, { encoding: "base64" });
const { filePath } = await dialog.showSaveDialog({
defaultPath: `${time}.png`,
filters: [{ name: "Images", extensions: ["jpg", "png", "gif"] }],
});
if (filePath)
await writeFile(filePath, Base64, {
encoding: "base64",
});
});

0 comments on commit 55a3a0b

Please sign in to comment.