mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
861a854f91
+ extract colors in watchdogg + rename color db files
20 lines
525 B
Python
20 lines
525 B
Python
"""
|
|
This library contains all the functions related to tracks.
|
|
"""
|
|
import os
|
|
|
|
from tqdm import tqdm
|
|
|
|
from app.db.sqlite.tracks import SQLiteTrackMethods as tdb
|
|
from app.store.tracks import TrackStore
|
|
|
|
|
|
def validate_tracks() -> None:
|
|
"""
|
|
Removes track records whose files no longer exist.
|
|
"""
|
|
for track in tqdm(TrackStore.tracks, desc="Validating tracks"):
|
|
if not os.path.exists(track.filepath):
|
|
TrackStore.remove_track_obj(track)
|
|
tdb.remove_tracks_by_filepaths(track.filepath)
|