mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
add colors to album page header
- add colors attribute to the album class - render color gradient in the album page
This commit is contained in:
committed by
Mungai Geoffrey
parent
f919ce35df
commit
a23b6200eb
@@ -82,6 +82,7 @@ class Album:
|
||||
Creates an album object
|
||||
"""
|
||||
|
||||
albumid: str
|
||||
title: str
|
||||
artist: str
|
||||
hash: str
|
||||
@@ -92,14 +93,21 @@ class Album:
|
||||
is_soundtrack: bool = False
|
||||
is_compilation: bool = False
|
||||
is_single: bool = False
|
||||
colors: List[str] = field(default_factory=list)
|
||||
|
||||
def __init__(self, tags):
|
||||
self.albumid = tags["_id"]["$oid"]
|
||||
self.title = tags["title"]
|
||||
self.artist = tags["artist"]
|
||||
self.date = tags["date"]
|
||||
self.image = tags["image"]
|
||||
self.hash = tags["hash"]
|
||||
|
||||
try:
|
||||
self.colors = tags["colors"]
|
||||
except KeyError:
|
||||
self.colors = []
|
||||
|
||||
@property
|
||||
def is_soundtrack(self) -> bool:
|
||||
keywords = ["motion picture", "soundtrack"]
|
||||
|
||||
Reference in New Issue
Block a user