Spaces:
Sleeping
Sleeping
Upload 8 files
Browse files
routes.py
CHANGED
|
@@ -43,11 +43,6 @@ def search():
|
|
| 43 |
required: false
|
| 44 |
default: 25
|
| 45 |
description: Maximum number of results
|
| 46 |
-
- name: official
|
| 47 |
-
in: query
|
| 48 |
-
type: boolean
|
| 49 |
-
required: false
|
| 50 |
-
description: Prefer official music videos when filter=videos
|
| 51 |
responses:
|
| 52 |
200:
|
| 53 |
description: Search results
|
|
@@ -60,12 +55,11 @@ def search():
|
|
| 60 |
|
| 61 |
flt: Optional[str] = request.args.get("filter", type=str)
|
| 62 |
limit: int = request.args.get("limit", default=25, type=int)
|
| 63 |
-
official: Optional[bool] = request.args.get("official", default=None, type=lambda v: v.lower() == "true")
|
| 64 |
|
| 65 |
if flt and flt not in ALLOWED_FILTERS:
|
| 66 |
return jsonify({"error": f"Invalid filter. Allowed: {sorted(list(ALLOWED_FILTERS))}"}), 400
|
| 67 |
|
| 68 |
-
results = _client().search(query, filter=flt, limit=limit, ignore_spelling=False
|
| 69 |
return jsonify({"results": results})
|
| 70 |
|
| 71 |
|
|
|
|
| 43 |
required: false
|
| 44 |
default: 25
|
| 45 |
description: Maximum number of results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
responses:
|
| 47 |
200:
|
| 48 |
description: Search results
|
|
|
|
| 55 |
|
| 56 |
flt: Optional[str] = request.args.get("filter", type=str)
|
| 57 |
limit: int = request.args.get("limit", default=25, type=int)
|
|
|
|
| 58 |
|
| 59 |
if flt and flt not in ALLOWED_FILTERS:
|
| 60 |
return jsonify({"error": f"Invalid filter. Allowed: {sorted(list(ALLOWED_FILTERS))}"}), 400
|
| 61 |
|
| 62 |
+
results = _client().search(query, filter=flt, limit=limit, ignore_spelling=False)
|
| 63 |
return jsonify({"results": results})
|
| 64 |
|
| 65 |
|