diff --git a/src/app/locate-db.ts b/src/app/locate-db.ts index 4ed40ca..bc91136 100644 --- a/src/app/locate-db.ts +++ b/src/app/locate-db.ts @@ -196,6 +196,24 @@ export async function buildLocateDb( prevBytes = bytes; onProgress?.('scanning', totalBytes, dir); }, signal); + + // If this directory has a .config with a URL-scheme base_url it points to + // a remote source — skip indexing its contents entirely. + const configEntry = batch.find(e => e.type === 'file' && basename(e.path) === '.config'); + if (configEntry) { + try { + const res = await fetch(getWebDAVBaseUrl() + configEntry.path, { signal }); + if (res.ok) { + const text = await res.text(); + const m = text.match(/^base_url\s*:\s*(.+)$/m); + if (m) { + const val = m[1].trim().replace(/^['"]|['"]$/g, ''); + if (/^[a-z][a-z0-9+.-]*:\/\//i.test(val)) continue; + } + } + } catch { /* non-fatal — proceed normally */ } + } + for (const e of batch) { entries.push(e); if (e.type === 'folder') queue.push(e.path);