dashcam 1.0.1-beta.25 → 1.0.1-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/dashcam.js CHANGED
@@ -626,7 +626,7 @@ program
626
626
 
627
627
  if (options.recover) {
628
628
  // Try to recover from interrupted recording
629
- const tempFileInfoPath = path.join(process.cwd(), '.dashcam', 'temp-file.json');
629
+ const tempFileInfoPath = path.join(APP.configDir, 'temp-file.json');
630
630
 
631
631
  if (fs.existsSync(tempFileInfoPath)) {
632
632
  console.log('Found interrupted recording, attempting recovery...');
package/lib/recorder.js CHANGED
@@ -4,6 +4,7 @@ import { createGif, createSnapshot } from './ffmpeg.js';
4
4
  import { applicationTracker } from './applicationTracker.js';
5
5
  import { logsTrackerManager, trimLogs } from './logs/index.js';
6
6
  import { getFfmpegPath } from './binaries.js';
7
+ import { APP } from './config.js';
7
8
  import path from 'path';
8
9
  import os from 'os';
9
10
  import fs from 'fs';
@@ -145,8 +146,8 @@ let outputPath = null;
145
146
  let recordingStartTime = null;
146
147
  let currentTempFile = null;
147
148
 
148
- // File paths - use system temp for runtime data
149
- const DASHCAM_TEMP_DIR = path.join(os.tmpdir(), 'dashcam');
149
+ // File paths - use APP config directory for better Windows compatibility
150
+ const DASHCAM_TEMP_DIR = APP.configDir;
150
151
  const TEMP_FILE_INFO_PATH = path.join(DASHCAM_TEMP_DIR, 'temp-file.json');
151
152
 
152
153
  // Platform-specific configurations
@@ -238,12 +239,12 @@ async function getPlatformArgs({ fps, includeAudio }) {
238
239
  }
239
240
 
240
241
  /**
241
- * Clear the tmp/recordings directory
242
+ * Clear the recordings directory
242
243
  */
243
244
  function clearRecordingsDirectory() {
244
245
  const logExit = logFunctionCall('clearRecordingsDirectory');
245
246
 
246
- const directory = path.join(process.cwd(), 'tmp', 'recordings');
247
+ const directory = APP.recordingsDir;
247
248
 
248
249
  try {
249
250
  if (fs.existsSync(directory)) {
@@ -281,8 +282,8 @@ function generateOutputPath() {
281
282
  const logExit = logFunctionCall('generateOutputPath');
282
283
 
283
284
  const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
284
- // Use system temp directory with dashcam subdirectory
285
- const directory = path.join(os.tmpdir(), 'dashcam', 'recordings');
285
+ // Use APP recordings directory for consistent cross-platform location
286
+ const directory = APP.recordingsDir;
286
287
  const filepath = path.join(directory, `recording-${timestamp}.webm`);
287
288
 
288
289
  logger.verbose('Generating output path', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashcam",
3
- "version": "1.0.1-beta.25",
3
+ "version": "1.0.1-beta.26",
4
4
  "description": "Minimal CLI version of Dashcam desktop app",
5
5
  "main": "bin/index.js",
6
6
  "bin": {
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Test script to verify system information collection
4
+ */
5
+
6
+ import { getSystemInfo } from './lib/systemInfo.js';
7
+ import { logger } from './lib/logger.js';
8
+
9
+ async function testSystemInfo() {
10
+ console.log('Testing system information collection...\n');
11
+
12
+ try {
13
+ const systemInfo = await getSystemInfo();
14
+
15
+ console.log('✓ System information collected successfully\n');
16
+ console.log('System Information:');
17
+ console.log('==================\n');
18
+
19
+ console.log('CPU:');
20
+ console.log(` Brand: ${systemInfo.cpu.brand}`);
21
+ console.log(` Cores: ${systemInfo.cpu.cores}`);
22
+ console.log(` Speed: ${systemInfo.cpu.speed} GHz`);
23
+ console.log();
24
+
25
+ console.log('Memory:');
26
+ console.log(` Total: ${(systemInfo.mem.total / (1024 ** 3)).toFixed(2)} GB`);
27
+ console.log(` Free: ${(systemInfo.mem.free / (1024 ** 3)).toFixed(2)} GB`);
28
+ console.log(` Used: ${(systemInfo.mem.used / (1024 ** 3)).toFixed(2)} GB`);
29
+ console.log();
30
+
31
+ console.log('Operating System:');
32
+ console.log(` Platform: ${systemInfo.os.platform}`);
33
+ console.log(` Distribution: ${systemInfo.os.distro}`);
34
+ console.log(` Release: ${systemInfo.os.release}`);
35
+ console.log(` Architecture: ${systemInfo.os.arch}`);
36
+ console.log(` Hostname: ${systemInfo.os.hostname}`);
37
+ console.log();
38
+
39
+ console.log('Graphics:');
40
+ console.log(` Controllers: ${systemInfo.graphics.controllers?.length || 0}`);
41
+ if (systemInfo.graphics.controllers?.length > 0) {
42
+ systemInfo.graphics.controllers.forEach((controller, index) => {
43
+ console.log(` ${index + 1}. ${controller.vendor} ${controller.model}`);
44
+ if (controller.vram) {
45
+ console.log(` VRAM: ${controller.vram} MB`);
46
+ }
47
+ });
48
+ }
49
+ console.log(` Displays: ${systemInfo.graphics.displays?.length || 0}`);
50
+ if (systemInfo.graphics.displays?.length > 0) {
51
+ systemInfo.graphics.displays.forEach((display, index) => {
52
+ console.log(` ${index + 1}. ${display.model || 'Unknown'}`);
53
+ console.log(` Resolution: ${display.currentResX}x${display.currentResY}`);
54
+ console.log(` Refresh Rate: ${display.currentRefreshRate} Hz`);
55
+ });
56
+ }
57
+ console.log();
58
+
59
+ console.log('System:');
60
+ console.log(` Manufacturer: ${systemInfo.system.manufacturer}`);
61
+ console.log(` Model: ${systemInfo.system.model}`);
62
+ console.log(` Virtual: ${systemInfo.system.virtual ? 'Yes' : 'No'}`);
63
+ console.log();
64
+
65
+ // Verify all required fields are present
66
+ console.log('Validation:');
67
+ console.log('===========\n');
68
+
69
+ const validations = [
70
+ { name: 'CPU info', valid: !!systemInfo.cpu && !!systemInfo.cpu.brand },
71
+ { name: 'Memory info', valid: !!systemInfo.mem && systemInfo.mem.total > 0 },
72
+ { name: 'OS info', valid: !!systemInfo.os && !!systemInfo.os.platform },
73
+ { name: 'Graphics info', valid: !!systemInfo.graphics },
74
+ { name: 'System info', valid: !!systemInfo.system }
75
+ ];
76
+
77
+ let allValid = true;
78
+ validations.forEach(v => {
79
+ const status = v.valid ? '✓' : '✗';
80
+ console.log(`${status} ${v.name}: ${v.valid ? 'OK' : 'MISSING'}`);
81
+ if (!v.valid) allValid = false;
82
+ });
83
+
84
+ console.log();
85
+
86
+ if (allValid) {
87
+ console.log('✓ All system information fields are properly populated');
88
+ console.log('✓ System information is ready to be uploaded to the API');
89
+ } else {
90
+ console.log('✗ Some system information is missing');
91
+ }
92
+
93
+ // Show the JSON structure that would be sent to the API
94
+ console.log('\nJSON Structure for API:');
95
+ console.log('======================\n');
96
+ console.log(JSON.stringify(systemInfo, null, 2));
97
+
98
+ } catch (error) {
99
+ console.error('✗ Failed to collect system information:', error.message);
100
+ console.error(error.stack);
101
+ process.exit(1);
102
+ }
103
+ }
104
+
105
+ testSystemInfo();