Spaces:
Sleeping
Sleeping
Commit
·
02a15c2
1
Parent(s):
b8db82b
patch
Browse files
app.py
CHANGED
|
@@ -82,3 +82,13 @@ async def get_music_api(file_name: str):
|
|
| 82 |
response = load_balancer.download_music_to_best_instance(file_name=file_name)
|
| 83 |
if response:
|
| 84 |
return JSONResponse(content=response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
response = load_balancer.download_music_to_best_instance(file_name=file_name)
|
| 83 |
if response:
|
| 84 |
return JSONResponse(content=response)
|
| 85 |
+
|
| 86 |
+
@app.get('/api/get/category/all')
|
| 87 |
+
async def get_categories():
|
| 88 |
+
return load_balancer.get_all_categories()
|
| 89 |
+
|
| 90 |
+
@app.get("/api/get/category/{category}")
|
| 91 |
+
async def get_all_from_a_category(category: str):
|
| 92 |
+
if not category:
|
| 93 |
+
raise HTTPException(status_code=400, detail="category parameter is required")
|
| 94 |
+
return load_balancer.get_files_from_category(category)
|