Update code in endpoints/gospel.get.py
This commit is contained in:
parent
608b658be6
commit
ce3b9c4d3e
@ -1,49 +1,28 @@
|
|||||||
from fastapi import APIRouter, HTTPException
|
from fastapi import APIRouter, HTTPException
|
||||||
|
|
||||||
songs = [
|
gospel_entries = [] # In-memory storage
|
||||||
{
|
|
||||||
"title": "Imela",
|
|
||||||
"year": 2012,
|
|
||||||
"album": "Supernatural",
|
|
||||||
"duration": "5:23"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Oluwatogbemiga",
|
|
||||||
"year": 2015,
|
|
||||||
"album": "No Other Name",
|
|
||||||
"duration": "6:12"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Onise Iyanu",
|
|
||||||
"year": 2016,
|
|
||||||
"album": "This God is Too Good",
|
|
||||||
"duration": "4:56"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Hallelujah Eh",
|
|
||||||
"year": 2018,
|
|
||||||
"album": "The Son of God",
|
|
||||||
"duration": "5:34"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "Someone's at the Door",
|
|
||||||
"year": 2020,
|
|
||||||
"album": "Revival",
|
|
||||||
"duration": "6:45"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.get("/gospel")
|
@router.get("/gospel")
|
||||||
async def get_nathaniel_bassey_songs():
|
async def get_gospel():
|
||||||
"""Get Nathaniel Bassey's most popular songs"""
|
"""Demo gospel endpoint"""
|
||||||
return {
|
return {
|
||||||
"message": "Retrieved Nathaniel Bassey songs successfully",
|
"message": "Gospel entries retrieved",
|
||||||
"artist": "Nathaniel Bassey",
|
"entries": [
|
||||||
"songs": songs,
|
{
|
||||||
|
"id": "g1",
|
||||||
|
"title": "Matthew",
|
||||||
|
"chapters": 28
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "g2",
|
||||||
|
"title": "Mark",
|
||||||
|
"chapters": 16
|
||||||
|
}
|
||||||
|
],
|
||||||
"features": {
|
"features": {
|
||||||
"total_songs": len(songs),
|
"rate_limit": 100,
|
||||||
"latest_year": 2020
|
"expires_in": 3600
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user