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
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pymediatools",
"version": "2.1.0",
"version": "2.1.2",
"description": "统一媒体工具包 - 字幕对齐 + 媒体转换",
"author": {
"name": "TimCode",
Expand Down Expand Up @@ -86,6 +86,7 @@
"nsis",
"zip"
],
"artifactName": "${productName}-Setup-${version}.${ext}",
"icon": "assets/icon.ico",
"extraResources": [
{
Expand Down
Loading
Loading