@xiboplayer/settings 0.3.6 → 0.4.0

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/settings.js +7 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiboplayer/settings",
3
- "version": "0.3.6",
3
+ "version": "0.4.0",
4
4
  "description": "CMS settings management and application for Xibo Player",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -9,7 +9,7 @@
9
9
  "./manager": "./src/settings.js"
10
10
  },
11
11
  "dependencies": {
12
- "@xiboplayer/utils": "0.3.6"
12
+ "@xiboplayer/utils": "0.4.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "jsdom": "^25.0.1",
package/src/settings.js CHANGED
@@ -41,7 +41,9 @@
41
41
  * settings.on('interval-changed', (newInterval) => { ... });
42
42
  */
43
43
 
44
- import { EventEmitter } from '@xiboplayer/utils';
44
+ import { EventEmitter, createLogger } from '@xiboplayer/utils';
45
+
46
+ const log = createLogger('DisplaySettings');
45
47
 
46
48
  export class DisplaySettings extends EventEmitter {
47
49
  constructor() {
@@ -93,7 +95,7 @@ export class DisplaySettings extends EventEmitter {
93
95
  */
94
96
  applySettings(settings) {
95
97
  if (!settings) {
96
- console.warn('[DisplaySettings] No settings provided');
98
+ log.warn('No settings provided');
97
99
  return { changed: [], settings: this.settings };
98
100
  }
99
101
 
@@ -143,7 +145,7 @@ export class DisplaySettings extends EventEmitter {
143
145
  // Emit generic settings-applied event
144
146
  this.emit('settings-applied', this.settings, changes);
145
147
 
146
- console.log('[DisplaySettings] Applied settings:', {
148
+ log.info('Applied settings:', {
147
149
  collectInterval: this.settings.collectInterval,
148
150
  displayName: this.settings.displayName,
149
151
  statsEnabled: this.settings.statsEnabled,
@@ -274,7 +276,7 @@ export class DisplaySettings extends EventEmitter {
274
276
  return currentTime >= start && currentTime < end;
275
277
  }
276
278
  } catch (error) {
277
- console.warn('[DisplaySettings] Failed to parse download window:', error);
279
+ log.warn('Failed to parse download window:', error);
278
280
  return true; // Allow downloads if parsing fails
279
281
  }
280
282
  }
@@ -331,7 +333,7 @@ export class DisplaySettings extends EventEmitter {
331
333
 
332
334
  return nextWindow;
333
335
  } catch (error) {
334
- console.warn('[DisplaySettings] Failed to calculate next download window:', error);
336
+ log.warn('Failed to calculate next download window:', error);
335
337
  return null;
336
338
  }
337
339
  }