Add parsing of AD1 files. Memorize window size and location.

This commit is contained in:
Patrick Fic
2025-03-17 14:27:33 -07:00
parent 10368f8f9e
commit c1949eb5f9
33 changed files with 524 additions and 20 deletions

View File

@@ -4,8 +4,9 @@ import log from "electron-log/main";
import path from "path";
import errorTypeCheck from "../../util/errorTypeCheck";
import store from "../store/store";
import ImportJob from "../decoder/decoder";
var watcher: FSWatcher;
let watcher: FSWatcher;
async function StartWatcher(): Promise<boolean> {
const filePaths = store.get("settings.filepaths") || [];
@@ -34,8 +35,7 @@ async function StartWatcher(): Promise<boolean> {
watcher = chokidar.watch(filePaths, {
ignored: (filepath, stats) => {
const p = path.parse(filepath);
return !stats?.isFile() && p.ext !== "" && p.ext.toUpperCase() !== ".ENV";
return !stats?.isFile() && p.ext !== "" && p.ext.toUpperCase() !== ".ENV"; //Only watch for .ENV files.
},
usePolling: store.get("settings.polling").enabled || false,
interval: store.get("settings.polling").pollingInterval || 1000,
@@ -77,7 +77,7 @@ async function StartWatcher(): Promise<boolean> {
return true;
}
function onWatcherReady() {
function onWatcherReady(): void {
log.info("Watcher ready!");
// const b = BrowserWindow.getAllWindows()[0];
// b.webContents.send(ipcTypes.default.fileWatcher.toRenderer.startSuccess);
@@ -102,8 +102,8 @@ async function StopWatcher(): Promise<boolean> {
return false;
}
async function HandleNewFile(path) {
//await ImportJob(path);
async function HandleNewFile(path): Promise<void> {
await ImportJob(path);
log.log("Received a new file", path);
}