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