check if album colors have contrast

- remove albumid field from album class
- set accent color to $red
This commit is contained in:
geoffrey45
2022-06-30 17:35:46 +03:00
committed by Mungai Geoffrey
parent a23b6200eb
commit 5acb8cb84d
9 changed files with 42 additions and 38 deletions
+2 -2
View File
@@ -61,11 +61,11 @@ class Albums(MongoAlbums):
album = self.collection.find_one({"hash": hash})
return convert_one(album)
def set_album_colors(self, colors: List[str], album_id: str) -> None:
def set_album_colors(self, colors: List[str], hash: str) -> None:
"""
Sets the colors for an album.
"""
self.collection.update_one(
{"_id": ObjectId(album_id)},
{"hash": hash},
{"$set": {"colors": colors}},
)