authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-07-07 09:42:04-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2025-10-14 02:40:45-07:00
log43c83a513c406ddfbf3d46079672a0576f5d7cd3
tree965c7cfa8c8aea60d9d6819bfcca339cadfcba3d
parent5e2a792bb470e4c9f1d4a97391400b4c0b711b14
signature Commit is signed but in an unrecognized format.

initial run of scan3 on sandwich


7 files changed, 98 insertions(+), 7 deletions(-)

flake.lock created+61
......@@ -0,0 +1,61 @@
1{
2 "nodes": {
3 "nixpkgs": {
4 "locked": {
5 "lastModified": 1751271578,
6 "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
7 "owner": "NixOS",
8 "repo": "nixpkgs",
9 "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
10 "type": "github"
11 },
12 "original": {
13 "owner": "NixOS",
14 "ref": "nixos-unstable",
15 "repo": "nixpkgs",
16 "type": "github"
17 }
18 },
19 "root": {
20 "inputs": {
21 "nixpkgs": "nixpkgs",
22 "utils": "utils"
23 }
24 },
25 "systems": {
26 "locked": {
27 "lastModified": 1681028828,
28 "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
29 "owner": "nix-systems",
30 "repo": "default",
31 "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
32 "type": "github"
33 },
34 "original": {
35 "owner": "nix-systems",
36 "repo": "default",
37 "type": "github"
38 }
39 },
40 "utils": {
41 "inputs": {
42 "systems": "systems"
43 },
44 "locked": {
45 "lastModified": 1731533236,
46 "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
47 "owner": "numtide",
48 "repo": "flake-utils",
49 "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
50 "type": "github"
51 },
52 "original": {
53 "owner": "numtide",
54 "repo": "flake-utils",
55 "type": "github"
56 }
57 }
58 },
59 "root": "root",
60 "version": 7
61}
flake.nix created+25
......@@ -0,0 +1,25 @@
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4 utils.url = "github:numtide/flake-utils";
5 };
6 outputs =
7 { nixpkgs, utils, ... }:
8 utils.lib.eachDefaultSystem (
9 system:
10 let
11 pkgs = nixpkgs.legacyPackages.${system};
12 in
13 {
14 devShells.default = pkgs.mkShell {
15 buildInputs = [
16 pkgs.nodejs_24 # runtime
17 pkgs.deno # formatter
18 (pkgs.ffmpeg.override {
19 withSvtav1 = true;
20 })
21 ];
22 };
23 }
24 );
25}
framework/bundle.ts+2-2
......@@ -40,7 +40,7 @@ export async function bundleClientJavaScript(
4040 logLevel: "silent",
4141 metafile: true,
4242 minify: !dev,
43 outdir: "/out!",
43 outdir: "out!",
4444 plugins: clientPlugins,
4545 write: false,
4646 define: {
......@@ -174,7 +174,7 @@ export async function bundleServerJavaScript(
174174 platform: "node",
175175 format: "esm",
176176 minify: false,
177 outdir: "/out!",
177 outdir: "out!",
178178 plugins: serverPlugins,
179179 splitting: true,
180180 logLevel: "silent",
framework/hot.ts+1-1
......@@ -96,7 +96,7 @@ Module._resolveFilename = (...args) => {
9696 try {
9797 return require.resolve(replacedPath, { paths: [projectSrc] });
9898 } catch (err: any) {
99 if (err.code === "MODULE_NOT_FOUND" && err.requireStack.length <= 1) {
99 if (err.code === "MODULE_NOT_FOUND" && (err?.requireStack?.length ?? 0) <= 1) {
100100 err.message.replace(replacedPath, args[0]);
101101 }
102102 }
readme.md+3
......@@ -67,6 +67,9 @@ node run watch
6767<!-- poor module support), CLIs can include a `main` function, which is executed -->
6868<!-- when the REPL runs it. -->
6969
70for unix systems, the provided `flake.nix` can be used with `nix develop` to
71open a shell with all needed system dependencies.
72
7073## Contributions
7174
7275No contributions to `src` accepted, only `framework`.
src/file-viewer/bin/scan3.ts+4-3
......@@ -10,7 +10,7 @@
1010// This is the third iteration of the scanner, hence its name "scan3";
1111// Remember that any software you want to be maintainable and high
1212// quality cannot be written with AI.
13const root = path.resolve("C:/media");
13const root = path.resolve("/Volumes/clover/Published");
1414const workDir = path.resolve(".clover/file-assets");
1515
1616export async function main() {
......@@ -118,7 +118,7 @@ export async function main() {
118118 },
119119 getItemText: (job) =>
120120 job.publicPath.slice(1) + (job.stat ? "" : " (deleted)"),
121 maxJobs: 2,
121 maxJobs: 10,
122122 });
123123 using qProcess = new async.Queue({
124124 name: "Process Contents",
......@@ -136,7 +136,7 @@ export async function main() {
136136 },
137137 getItemText: ({ mediaFile, processor }) =>
138138 `${mediaFile.path.slice(1)} - ${processor.name}`,
139 maxJobs: 1,
139 maxJobs: 4,
140140 });
141141
142142 function decodeProcessors(input: string) {
......@@ -442,6 +442,7 @@ const procVideos = transcodeRules.videoFormats.map<Process>((preset) => ({
442442 include: rules.extsVideo,
443443 enable: ffmpegBin != null,
444444 async run({ absPath, mediaFile, spin }) {
445 if ((mediaFile.duration ?? 0) < 10) return;
445446 await produceAsset(`${mediaFile.hash}/${preset.id}`, async (base) => {
446447 base = path.dirname(base);
447448 await fs.mkdir(base);
src/file-viewer/ffmpeg.ts+2-1
......@@ -28,7 +28,7 @@ export interface SpawnOptions {
2828
2929export async function spawn(options: SpawnOptions) {
3030 const { ffmpeg = "ffmpeg", args, title, cwd } = options;
31 const proc = child_process.spawn(ffmpeg, args, {
31 const proc = child_process.spawn(ffmpeg, [...defaultExtraOptions, ...args], {
3232 stdio: ["ignore", "inherit", "pipe"],
3333 env: { ...process.env, SVT_LOG: "2" },
3434 cwd,
......@@ -59,6 +59,7 @@ export async function spawn(options: SpawnOptions) {
5959 } else result satisfies never;
6060 });
6161 const [code, signal] = await events.once(proc, "close");
62 running = false;
6263 if (code !== 0) {
6364 const fmt = code ? `code ${code}` : `signal ${signal}`;
6465 const e: any = new Error(`ffmpeg failed with ${fmt}`);