add "&" character to genre separators

+ handle r&b genre and rock&roll
This commit is contained in:
mungai-njoroge
2023-09-04 00:49:45 +03:00
parent da88bbd9cc
commit 5ff3e5d28a
4 changed files with 31 additions and 7 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ def create_api():
Creates the Flask instance, registers modules and registers all the API blueprints.
"""
app = Flask(__name__)
CORS(app)
CORS(app, origins="*")
Compress(app)
app.config["COMPRESS_MIMETYPES"] = [
+11 -1
View File
@@ -216,7 +216,17 @@ def get_artist(artisthash: str):
artist.is_favorite = favdb.check_is_favorite(artisthash, FavType.artist)
return {"artist": artist, "tracks": serialize_tracks(tracks[:limit])}
genres = set()
for t in tracks:
if t.genre is not None:
genres = genres.union(t.genre)
return {
"artist": artist,
"tracks": serialize_tracks(tracks[:limit]),
"genres": list(genres),
}
@api.route("/artist/<artisthash>/albums", methods=["GET"])