fix: prune matched media collection roots

This commit is contained in:
Mikei386
2026-08-24 12:15:59 +02:00
parent d50df78441
commit b4b83c2797
7 changed files with 21 additions and 11 deletions
+3 -3
View File
@@ -76,10 +76,10 @@ Oder manuell:
```bash
# .txz von Gitea laden
curl -O http://192.168.1.2:4000/michael/MUA-Mikes-Unraid-Agent/raw/branch/main/dist/mua-2026.08.24.r020-x86_64-1.txz
curl -O http://192.168.1.2:4000/michael/MUA-Mikes-Unraid-Agent/raw/branch/main/dist/mua-2026.08.24.r021-x86_64-1.txz
# Installieren
upgradepkg --install-new mua-2026.08.24.r020-x86_64-1.txz
upgradepkg --install-new mua-2026.08.24.r021-x86_64-1.txz
```
### 2. Service starten
@@ -94,7 +94,7 @@ Der Service startet automatisch bei jedem Boot (SysVinit).
```bash
curl http://192.168.1.2:3002/health
# → {"status":"ok","version":"2026.08.24.r020","auth":"required"}
# → {"status":"ok","version":"2026.08.24.r021","auth":"required"}
```
---
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mua",
"version": "2026.08.24.r020",
"version": "2026.08.24.r021",
"description": "Mikes Unraid Agent - MCP over HTTP (Streamable HTTP) for Unraid",
"type": "module",
"main": "src/index.ts",
+8 -4
View File
@@ -2,13 +2,13 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "mua">
<!ENTITY author "Michael">
<!ENTITY version "2026.08.24.r020">
<!ENTITY version "2026.08.24.r021">
<!ENTITY launch "Settings/mua">
<!ENTITY pluginURL "http://192.168.1.2:4000/michael/MUA-Mikes-Unraid-Agent/raw/branch/main/plugin/mua.plg">
<!ENTITY pluginLOC "/boot/config/plugins/&name;">
<!ENTITY emhttpLOC "/usr/local/emhttp/plugins/&name;">
<!ENTITY txzURL "http://192.168.1.2:4000/michael/MUA-Mikes-Unraid-Agent/raw/branch/main/dist/mua-2026.08.24.r020-x86_64-1.txz">
<!ENTITY txzSHA256 "b56b439af042bd3c3ef978367adacc0723b839058915f01b40cd4b5ddddfc55e">
<!ENTITY txzURL "http://192.168.1.2:4000/michael/MUA-Mikes-Unraid-Agent/raw/branch/main/dist/mua-2026.08.24.r021-x86_64-1.txz">
<!ENTITY txzSHA256 "f114ef5be9729bb01362c1d9e165c7055ff67325275ac6562aceba28c2a1fcd5">
]>
<PLUGIN name="&name;"
@@ -23,6 +23,10 @@
>
<CHANGES>
### 2026.08.24.r021
- Die gefilterte Sammlungssuche beendet den Abstieg an einem passenden Verzeichnis. Episodenordner fluten dadurch nicht mehr das begrenzte Erkennungsergebnis.
- Der zweite Aufruf auf den gefundenen Sammlungspfad bleibt unverändert und liefert die vollständige gebündelte Bestandsaufnahme.
### 2026.08.24.r020
- Neues begrenztes Nur-Lese-Werkzeug `unraid_files_inventory` erfasst Datei- und Ordnernamen eines Shares in einem Aufruf, ohne Dateiinhalte zu lesen.
- Ein Namensfilter findet gezielt Sammlungsordner; ein zweiter gebündelter Aufruf inventarisiert den exakten Treffer. Medienprüfungen benötigen keine Kette aus wiederholten `ls`/`find`-Aufrufen mehr.
@@ -136,7 +140,7 @@ Das .txz enthält:
install/doinst.sh (läuft nach Installation)
===========================================
-->
<FILE Name="/boot/config/plugins/&name;/mua-2026.08.24.r020-x86_64-1.txz" Run="upgradepkg --install-new" Mode="755" Min="7.0.0">
<FILE Name="/boot/config/plugins/&name;/mua-2026.08.24.r021-x86_64-1.txz" Run="upgradepkg --install-new" Mode="755" Min="7.0.0">
<URL>&txzURL;</URL>
<SHA256>&txzSHA256;</SHA256>
</FILE>
+7 -1
View File
@@ -307,7 +307,13 @@ function files_inventory(
break 2;
}
}
if ($is_dir) $queue[] = [$full, $relative, $depth + 1];
// A filtered discovery call is meant to locate collection roots.
// Once a directory itself matches, return that root but do not also
// flood the bounded result with matching descendants. A follow-up
// call with this path and an empty filter inventories the collection.
if ($is_dir && !($needle !== '' && $matches)) {
$queue[] = [$full, $relative, $depth + 1];
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ import { createHash, randomUUID } from "node:crypto";
// ── Konstanten ──────────────────────────────────────────────────────────
export const MUA_SERVER_NAME = "mua";
export const MUA_VERSION = "2026.08.24.r020";
export const MUA_VERSION = "2026.08.24.r021";
export const MUA_PROTOCOL_VERSION = "2025-03-26";
export const PHP_HELPER = "/usr/local/bin/unraid-docker-mcp-helper.php";
export const STATUS_HELPER = "/usr/local/bin/unraid-mcp-status-helper.php";
+1 -1
View File
@@ -542,7 +542,7 @@ export const TOOLS: ToolDef[] = [
properties: {
share: str("Exact Unraid share name, for example Audiobooks"),
relative_path: str("Optional path below the share; never use /mnt/user or an absolute path"),
name_contains: str("Optional case-insensitive basename fragment, for example 'drei'. It filters returned entries; use a second call on a matched directory to list its descendants"),
name_contains: str("Optional case-insensitive basename fragment, for example 'drei'. A matching directory is returned as a collection root and pruned from further discovery; use a second call on that directory with an empty filter to list its descendants"),
max_depth: int("Maximum directory depth below relative_path (1-20, default 10)"),
max_entries: int("Maximum returned entries (1-5000, default 2000)"),
include_files: { type: "boolean", description: "Include files (default true)" },