24 lines
712 B
Python
24 lines
712 B
Python
|
|
#!/usr/bin/env python
|
||
|
|
import sys
|
||
|
|
sys.path.insert(0, '.')
|
||
|
|
from helper.file_storage import LocalStorageBackend
|
||
|
|
from config import get_local_storage_path
|
||
|
|
import json
|
||
|
|
|
||
|
|
config = json.load(open('config.json'))
|
||
|
|
# Get the location string properly
|
||
|
|
location = get_local_storage_path(config)
|
||
|
|
if isinstance(location, dict):
|
||
|
|
location = location.get('path') or str(location)
|
||
|
|
|
||
|
|
backend = LocalStorageBackend(config)
|
||
|
|
|
||
|
|
# Test searches
|
||
|
|
for query in ['sie*', 'sie', '*']:
|
||
|
|
print(f"\n=== Searching for: {query} ===")
|
||
|
|
results = backend.search(query, location=str(location), limit=5)
|
||
|
|
print(f"Found {len(results)} results")
|
||
|
|
for r in results:
|
||
|
|
print(f" - {r.get('title')} ({r.get('ext')}) @ {r.get('path')}")
|
||
|
|
|