0.10.0-7 Fix und stuff

This commit is contained in:
2026-03-15 08:30:26 +00:00
parent 3e191a654e
commit 25d5339ada
13 changed files with 701 additions and 55 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "ripster-backend",
"version": "0.10.0-6",
"version": "0.10.0-7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ripster-backend",
"version": "0.10.0-6",
"version": "0.10.0-7",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.4.7",

View File

@@ -1,6 +1,6 @@
{
"name": "ripster-backend",
"version": "0.10.0-6",
"version": "0.10.0-7",
"private": true,
"type": "commonjs",
"scripts": {

View File

@@ -191,6 +191,7 @@ class DiskDetectionService extends EventEmitter {
this.lastDetected = null;
this.lastPresent = false;
this.deviceLocks = new Map();
this.pollingSuspended = false;
}
start() {
@@ -211,6 +212,20 @@ class DiskDetectionService extends EventEmitter {
logger.info('stop');
}
suspendPolling() {
if (!this.pollingSuspended) {
this.pollingSuspended = true;
logger.info('polling:suspended');
}
}
resumePolling() {
if (this.pollingSuspended) {
this.pollingSuspended = false;
logger.info('polling:resumed');
}
}
scheduleNext(delayMs) {
if (!this.running) {
return;
@@ -227,9 +242,12 @@ class DiskDetectionService extends EventEmitter {
driveMode: map.drive_mode,
driveDevice: map.drive_device,
nextDelay,
autoDetectionEnabled
autoDetectionEnabled,
suspended: this.pollingSuspended
});
if (autoDetectionEnabled) {
if (this.pollingSuspended) {
logger.debug('poll:skip:suspended', { nextDelay });
} else if (autoDetectionEnabled) {
const detected = await this.detectDisc(map);
this.applyDetectionResult(detected, { forceInsertEvent: false });
} else {

View File

@@ -5094,6 +5094,13 @@ class PipelineService extends EventEmitter {
statusText: this.snapshot.statusText
});
const DRIVE_ACTIVE_STATES = new Set(['ANALYZING', 'RIPPING', 'MEDIAINFO_CHECK', 'CD_ANALYZING', 'CD_RIPPING']);
if (DRIVE_ACTIVE_STATES.has(state)) {
diskDetectionService.suspendPolling();
} else if (DRIVE_ACTIVE_STATES.has(previous)) {
diskDetectionService.resumePolling();
}
await this.persistSnapshot();
const snapshotPayload = this.getSnapshot();
wsService.broadcast('PIPELINE_STATE_CHANGED', snapshotPayload);