From 9d4436b30e417e590a23c68769cae1a6c8a9108a Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 25 Mar 2025 05:44:43 +0000 Subject: [PATCH] Update code in endpoints/gospel.get.py --- endpoints/gospel.get.py | 51 +++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/endpoints/gospel.get.py b/endpoints/gospel.get.py index 1c5fe4a..8e328f0 100644 --- a/endpoints/gospel.get.py +++ b/endpoints/gospel.get.py @@ -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+" + "album": "The Gospel of The Kingdom", + "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" } \ No newline at end of file