mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
861a854f91
+ extract colors in watchdogg + rename color db files
23 lines
540 B
Python
23 lines
540 B
Python
"""
|
|
Contains methods relating to albums.
|
|
"""
|
|
|
|
from tqdm import tqdm
|
|
from app.store.albums import AlbumStore
|
|
from app.store.tracks import TrackStore
|
|
|
|
|
|
def validate_albums():
|
|
"""
|
|
Removes albums that have no tracks.
|
|
|
|
Probably albums that were added from incompletely written files.
|
|
"""
|
|
|
|
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)
|