Skip to content
Merged
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
1 change: 1 addition & 0 deletions .vscode/ltex.dictionary.en-US.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Toggleable
12 changes: 12 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -76,8 +76,5 @@
"ts-loader": "^9.5.2",
"ts-node": "^10.9.2",
"typescript": "^5.9.2"
},
"extraResources": [
"./extraResources/**"
]
}
}
50 changes: 50 additions & 0 deletions src/cdv
Original file line number Diff line number Diff line change
@@ -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,
});
});
});

22 changes: 4 additions & 18 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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(
Expand Down
Loading
Loading