write LASTFM_API_KEY to config file

+ remove alive bar
This commit is contained in:
mungai-njoroge
2023-08-31 21:36:34 +03:00
parent 4271a6f4a0
commit da88bbd9cc
9 changed files with 34 additions and 69 deletions
+6 -8
View File
@@ -5,7 +5,6 @@ Contains methods relating to albums.
from dataclasses import asdict
from typing import Any
from alive_progress import alive_bar
from app.logger import log
from app.models.track import Track
@@ -23,20 +22,19 @@ def validate_albums():
album_hashes = {t.albumhash for t in TrackStore.tracks}
albums = AlbumStore.albums
with alive_bar(len(albums)) as bar:
log.info("Validating albums")
for album in albums:
if album.albumhash not in album_hashes:
AlbumStore.remove_album(album)
bar()
for album in albums:
if album.albumhash not in album_hashes:
AlbumStore.remove_album(album)
def remove_duplicate_on_merge_versions(tracks: list[Track]) -> list[Track]:
"""
Removes duplicate tracks when merging versions of the same album.
"""
pass
def sort_by_track_no(tracks: list[Track]) -> list[dict[str, Any]]:
tracks = [asdict(t) for t in tracks]