Update code in endpoints/gospel.get.py
This commit is contained in:
parent
df23a9039d
commit
9d4436b30e
@ -1,47 +1,44 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter()
|
||||
import random
|
||||
|
||||
songs = [
|
||||
{
|
||||
"title": "Imole De",
|
||||
"year": 2023,
|
||||
"album": "The Glory Experience",
|
||||
"streams": "10M+"
|
||||
"album": "The Gospel of The Kingdom",
|
||||
"year": 2022
|
||||
},
|
||||
{
|
||||
"title": "Adua",
|
||||
"album": "The Gospel of The Kingdom",
|
||||
"year": 2022
|
||||
},
|
||||
{
|
||||
"title": "Breathe",
|
||||
"year": 2022,
|
||||
"album": "The Gospel of The Kingdom",
|
||||
"streams": "8M+"
|
||||
"year": 2022
|
||||
},
|
||||
{
|
||||
"title": "Adoring You",
|
||||
"year": 2021,
|
||||
"album": "The Gospel of The Kingdom",
|
||||
"streams": "5M+"
|
||||
"title": "Na You",
|
||||
"album": "Single",
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"title": "Yahweh",
|
||||
"year": 2020,
|
||||
"album": "Kingdom Now",
|
||||
"streams": "12M+"
|
||||
},
|
||||
{
|
||||
"title": "Higher",
|
||||
"year": 2019,
|
||||
"album": "Code Life",
|
||||
"streams": "7M+"
|
||||
"title": "Your Love",
|
||||
"album": "Single",
|
||||
"year": 2020
|
||||
}
|
||||
]
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/gospel")
|
||||
async def get_dunsin_songs():
|
||||
"""Get Dunsin Oyekan's most popular songs"""
|
||||
async def get_random_song():
|
||||
"""Returns a random Dunsin Oyekan song"""
|
||||
random_song = random.choice(songs)
|
||||
|
||||
return {
|
||||
"artist": "Dunsin Oyekan",
|
||||
"genre": "Gospel",
|
||||
"popular_songs": songs,
|
||||
"message": "Random song generated",
|
||||
"song": random_song,
|
||||
"method": "GET",
|
||||
"_verb": "get"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user