remove default images and memoji implementation
@ -103,7 +103,7 @@ def get_albumartists():
|
|||||||
for artist in artists:
|
for artist in artists:
|
||||||
artist_obj = {
|
artist_obj = {
|
||||||
"name": artist,
|
"name": artist,
|
||||||
"image": helpers.check_artist_image(helpers.create_safe_name(artist)),
|
"image": helpers.create_safe_name(artist) + ".webp",
|
||||||
}
|
}
|
||||||
final_artists.append(artist_obj)
|
final_artists.append(artist_obj)
|
||||||
|
|
||||||
|
@ -85,26 +85,6 @@ def is_valid_file(filename: str) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def use_memoji():
|
|
||||||
"""
|
|
||||||
Returns a path to a random memoji image.
|
|
||||||
"""
|
|
||||||
path = str(random.randint(0, 20)) + ".svg"
|
|
||||||
return "defaults/" + path
|
|
||||||
|
|
||||||
|
|
||||||
def check_artist_image(image: str) -> str:
|
|
||||||
"""
|
|
||||||
Checks if the artist image is valid.
|
|
||||||
"""
|
|
||||||
img_name = image.replace("/", "::") + ".webp"
|
|
||||||
app_dir = settings.APP_DIR
|
|
||||||
if not os.path.exists(os.path.join(app_dir, "images", "artists", img_name)):
|
|
||||||
return use_memoji()
|
|
||||||
else:
|
|
||||||
return img_name
|
|
||||||
|
|
||||||
|
|
||||||
def create_album_hash(title: str, artist: str) -> str:
|
def create_album_hash(title: str, artist: str) -> str:
|
||||||
"""
|
"""
|
||||||
Creates a simple hash for an album
|
Creates a simple hash for an album
|
||||||
|
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 25 KiB |