Skip to content
Open
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
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
dist-electron/*.dmg
dist-electron/*.zip
dist-electron/*.exe
dist-electron/*.blockmap
dist-electron/latest*.yml

release:
needs: build
Expand All @@ -69,6 +71,9 @@ jobs:
path: dist
merge-multiple: true

- name: List release files
run: ls -la dist/

- uses: softprops/action-gh-release@v2
with:
files: dist/*
Expand Down
28 changes: 28 additions & 0 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,34 @@ app.whenReady().then(async () => {
return null;
});

ipcMain.handle('scan-directory', async (event, dirPath) => {
const fs = require('fs');
const pathModule = require('path');
try {
if (!dirPath || !fs.existsSync(dirPath)) return [];
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
const files = [];
for (const entry of entries) {
if (entry.isFile() && !entry.name.startsWith('.')) {
const fullPath = pathModule.join(dirPath, entry.name);
try {
const stat = fs.statSync(fullPath);
files.push({
name: entry.name,
path: fullPath,
size: stat.size,
mtime: stat.mtimeMs,
});
} catch { /* skip unreadable files */ }
}
}
return files;
} catch (e) {
console.error('scan-directory error:', e);
return [];
}
});

ipcMain.handle('get-downloads-path', async () => {
try {
return app.getPath('downloads');
Expand Down
1 change: 1 addition & 0 deletions electron/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ contextBridge.exposeInMainWorld('electronAPI', {

// 选择目录
selectDirectory: () => ipcRenderer.invoke('select-directory'),
scanDirectory: (dirPath) => ipcRenderer.invoke('scan-directory', dirPath),
getDownloadsPath: () => ipcRenderer.invoke('get-downloads-path'),

// 批量Reels - 烧录字幕
Expand Down
Loading
Loading