diff --git a/.vscode/ltex.dictionary.en-US.txt b/.vscode/ltex.dictionary.en-US.txt new file mode 100644 index 0000000..93310fe --- /dev/null +++ b/.vscode/ltex.dictionary.en-US.txt @@ -0,0 +1 @@ +Toggleable diff --git a/CHANGELOG b/CHANGELOG index eb33db0..b5a9e8a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,17 @@ # Changelog +## [3.0.1] - 2025-08-14 + +### Fixed +- **Font Handling**: + - Replaced child process font detection with direct `font-list` package integration + - Improved font listing reliability + +### Technical Details +- Removed child process fork for font detection +- Simplified package.json by removing redundant extraResources declaration +- Updated resource path resolution logic + ## [3.0.0] - 2025-08-13 ### Major Changes diff --git a/package.json b/package.json index 74f537a..0fb7b10 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "choirslides", "productName": "ChoirSlides", - "version": "3.0.0", + "version": "3.0.1", "description": "A software designed to create lyric slideshows. This software allows users to combine lyrics with background videos, resulting in a visually engaging slideshow that synchronizes the lyrics with the video footage.", "main": "./.webpack/main", "scripts": { @@ -76,8 +76,5 @@ "ts-loader": "^9.5.2", "ts-node": "^10.9.2", "typescript": "^5.9.2" - }, - "extraResources": [ - "./extraResources/**" - ] + } } diff --git a/src/cdv b/src/cdv new file mode 100644 index 0000000..a6164aa --- /dev/null +++ b/src/cdv @@ -0,0 +1,50 @@ + protocol.handle("media", async (request) => { + const requestedFileParsed = path.parse( + decodeURIComponent(request.url.slice("media://".length)) + ); + // https://github.com/electron/electron/issues/38749#issuecomment-1681531939 + const fp = `videos\\${requestedFileParsed.name}${requestedFileParsed.ext}`; + const headers = new Headers(); + headers.set("Accept-Ranges", "bytes"); + headers.set("Content-Type", mime.getType(fp)); + let status = 200; + + const rangeText = request.headers.get("range"); + let stats = fs.statSync(videoFilePath); + const ranges = parseRangeRequests(rangeText, stats.size); + const [start, end] = ranges[0]; + headers.set("Content-Length", `${end - start}`); + headers.set("Content-Range", `bytes ${start}-${end}/${stats.size}`); + status = 206; + console.log(currentProject.notInArchive); + if ( + currentProject.notInArchive[ + `${requestedFileParsed.name}${requestedFileParsed.ext}` + ] + ) { + if (rangeText) { + VidFilestream = fs.createReadStream(videoPath, { start, end }); + } else { + headers.set("Content-Length", `${stats.size}`); + VidFilestream = fs.createReadStream(videoPath); + } + return new Response(VidFilestream, { + headers, + status, + }); + } + return currentProject.fileStream.entryData(fp).then((buf) => { + if (rangeText) { + VidFilestream = buf.subarray(start, end); + } else { + headers.set("Content-Length", `${stats.size}`); + VidFilestream = buf; + } + + return new Response(VidFilestream, { + headers, + status, + }); + }); + }); + \ No newline at end of file diff --git a/src/index.js b/src/index.js index 8f52379..9815fdc 100644 --- a/src/index.js +++ b/src/index.js @@ -10,12 +10,14 @@ import { import MediaResponder from "./utils/MediaResponderClass"; import WorkingFile from "./workingFile"; +const fontList = require("font-list"); + import log from "electron-log/main"; import cp from "child_process"; const EXTRARESOURCES_PATH = app.isPackaged - ? path.join(process.resourcesPath, "extraResources") + ? path.join(process.resourcesPath, "app.asar.unpacked", "src") : path.join(__dirname, "../../extraResources"); const getExtraResourcesPath = (...paths) => { @@ -152,24 +154,8 @@ ipcMain.handle("getSystemFonts", async () => { "fontlist/getSystemFonts.js" ); console.log(systemFontsScriptPath); - return new Promise((resolve, reject) => { - const forked = cp.fork(systemFontsScriptPath); - - forked.on("message", (message) => { - resolve(message); - forked.kill(); - }); - forked.on("error", (err) => { - reject(err); - }); - - forked.on("exit", (code) => { - if (code !== 0) { - reject(new Error(`getSystemFonts.js exited with code ${code}`)); - } - }); - }); + return fontList.getFonts({ disableQuoting: true }); }); ipcMain.on( diff --git a/src/renderer/ShowCreateView/index copy.html b/src/renderer/ShowCreateView/index copy.html new file mode 100644 index 0000000..a991f61 --- /dev/null +++ b/src/renderer/ShowCreateView/index copy.html @@ -0,0 +1,687 @@ + + +
+ +No video loaded
+ ++ No slides yet. Click "Add New Slide" to get started. +
+