use album colors on album header play button

- use alnum chars only on hashes
- add underline on track album hover
This commit is contained in:
geoffrey45
2022-06-30 21:02:01 +03:00
committed by Mungai Geoffrey
parent 5acb8cb84d
commit 34a214df22
6 changed files with 87 additions and 19 deletions
+2 -10
View File
@@ -1,9 +1,7 @@
"""
This module contains mini functions for the server.
"""
from dataclasses import dataclass
import os
from pprint import pprint
import threading
from datetime import datetime
from typing import Dict, Set
@@ -13,7 +11,6 @@ import requests
from app import models
from app import instances
from app.lib.albumslib import Thumbnail
def background(func):
@@ -53,8 +50,6 @@ def run_fast_scandir(__dir: str, full=False) -> Dict[List[str], List[str]]:
return subfolders, files
class RemoveDuplicates:
def __init__(self, tracklist: List[models.Track]) -> None:
self.tracklist = tracklist
@@ -77,15 +72,12 @@ def is_valid_file(filename: str) -> bool:
return False
ill_chars = '/\\:*?"<>|#&'
def create_album_hash(title: str, artist: str) -> str:
"""
Creates a simple hash for an album
"""
lower = (title + artist).replace(" ", "").lower()
hash = "".join([i for i in lower if i not in ill_chars])
hash = "".join([i for i in lower if i.isalnum()])
return hash
@@ -99,7 +91,7 @@ def create_safe_name(name: str) -> str:
"""
Creates a url-safe name from a name.
"""
return "".join([i for i in name if i not in ill_chars])
return "".join([i for i in name if i.isalnum()])
class UseBisection:
+1 -3
View File
@@ -54,10 +54,8 @@ class Track:
@staticmethod
def create_unique_hash(*args):
ill_chars = '/\\:*?"<>|#&'
string = "".join(str(a) for a in args).replace(" ", "")
return "".join(string).strip(ill_chars).lower()
return "".join([i for i in string if i.isalnum()]).lower()
@dataclass(slots=True)