mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
add "&" character to genre separators
+ handle r&b genre and rock&roll
This commit is contained in:
+1
-1
@@ -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
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user