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 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", "year": 2022
"streams": "8M+"
}, },
{ {
"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"
} }