Update code in endpoints/gospel.get.py

This commit is contained in:
Backend IM Bot 2025-03-25 05:44:43 +00:00
parent df23a9039d
commit 9d4436b30e

View File

@ -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"
}