This commit is contained in:
mungai-njoroge
2023-07-17 11:30:05 +03:00
parent 861a854f91
commit e70d787580
4 changed files with 26 additions and 7 deletions
+9 -4
View File
@@ -2,9 +2,11 @@
Contains methods relating to albums.
"""
from tqdm import tqdm
from alive_progress import alive_bar
from app.store.albums import AlbumStore
from app.store.tracks import TrackStore
from app.logger import log
def validate_albums():
@@ -17,6 +19,9 @@ def validate_albums():
album_hashes = {t.albumhash for t in TrackStore.tracks}
albums = AlbumStore.albums
for album in tqdm(albums, desc="Validating albums"):
if album.albumhash not in album_hashes:
AlbumStore.remove_album(album)
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()