Merge - fix search and add correct image path for album card (#52)

This commit is contained in:
Mungai Geoffrey
2022-05-04 03:17:43 +03:00
committed by GitHub
parent e05c4602b0
commit d6a01cd35e
4 changed files with 30 additions and 18 deletions
+4 -1
View File
@@ -1,9 +1,12 @@
"""
Contains all the album routes.
"""
from typing import List
from app import api
from app import functions
from app import helpers
from app import models
from app.lib import albumslib
from app.lib import trackslib
from flask import Blueprint
@@ -71,7 +74,7 @@ def get_albumartists():
album = data["album"]
artist = data["artist"]
tracks = []
tracks: List[models.Track] = []
for track in api.TRACKS:
if track.album == album and track.albumartist == artist:
+2 -2
View File
@@ -99,7 +99,7 @@ def use_memoji():
Returns a path to a random memoji image.
"""
path = str(random.randint(0, 20)) + ".svg"
return settings.IMG_ARTIST_URI + "defaults/" + path
return "defaults/" + path
def check_artist_image(image: str) -> str:
@@ -112,7 +112,7 @@ def check_artist_image(image: str) -> str:
img_name)):
return use_memoji()
else:
return (settings.IMG_ARTIST_URI + img_name, )
return img_name
class Timer: