Configuration options to override defaults:
// Increase polling interval to reduce battery usage
setMonitoringConfig({
pollingInterval: 3000,
progressUpdateInterval: 500
});
export function setMonitoringConfig(
config: Partial<PlaybackMonitorConfig>,
): void {
currentConfig = {
...currentConfig,
...config,
};
store.saveLog(
`Updated monitoring configuration: ${JSON.stringify(currentConfig)}`,
"DEBUG",
);
// If monitoring is already active, restart it to apply new configuration
if (isMonitoringActive()) {
const mainWindow = BrowserWindow.getAllWindows()[0];
const credentials = getCredentials();
if (mainWindow && credentials.clientId && credentials.clientSecret) {
stopPlaybackMonitoring();
startPlaybackMonitoring(
mainWindow,
credentials.clientId,
credentials.clientSecret,
);
}
}
}
Sets monitoring configuration options
Configures the playback monitoring service by updating the polling intervals, backoff strategy parameters, and other monitoring behavior settings. If monitoring is already active, it automatically restarts the service with the new configuration.
The configuration allows fine-tuning the monitoring behavior for different scenarios: