This commit is contained in:
2026-01-14 14:54:18 -08:00
parent 0c70aab725
commit 25c940351a
3 changed files with 39 additions and 7 deletions

View File

@@ -204,6 +204,8 @@ def create_app():
"""Check server health and storage availability."""
status = {
"status": "ok",
"service": "remote_storage",
"name": os.environ.get("MM_SERVER_NAME", "Remote Storage"),
"storage_configured": STORAGE_PATH is not None,
"timestamp": datetime.now().isoformat(),
}
@@ -236,13 +238,13 @@ def create_app():
query = request.args.get("q", "")
limit = request.args.get("limit", 100, type=int)
if not query:
return jsonify({"error": "Search query required"}), 400
# Allow empty query or '*' for "list everything"
db_query = query if query and query != "*" else ""
try:
with LocalLibrarySearchOptimizer(STORAGE_PATH) as db:
results = db.search_by_name(query, limit)
tag_results = db.search_by_tag(query, limit)
results = db.search_by_name(db_query, limit)
tag_results = db.search_by_tag(db_query, limit)
all_results = {
r["hash"]: r
for r in (results + tag_results)