k
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user