This commit is contained in:
@@ -81,6 +81,22 @@ class FolderMonitor extends EventEmitter {
|
||||
this._deactivate({ clearSeen: true, paused: false });
|
||||
}
|
||||
|
||||
async testScan(settings) {
|
||||
if (!String(settings?.folderPath || '').trim()) {
|
||||
return this._result([], false, false, 'test', { error: 'Kein Ordnerpfad angegeben' });
|
||||
}
|
||||
const isolated = new FolderMonitor({
|
||||
access: this._access,
|
||||
stat: this._stat,
|
||||
walkFolder: this._walkFolder,
|
||||
now: this._now
|
||||
});
|
||||
isolated.configure({ ...settings });
|
||||
const result = await isolated.scan({ emitFiles: false, trigger: 'test' });
|
||||
if (!result.reachable) return { ...result, error: 'Ordner nicht erreichbar' };
|
||||
return result;
|
||||
}
|
||||
|
||||
status() {
|
||||
return Object.freeze({
|
||||
running: this.running,
|
||||
|
||||
Reference in New Issue
Block a user