swingmusic/app/lib/trackslib.py
geoffrey45 51a5502efc add parsers to clean track titles .ie. remove remaster info
+ use getters to read flags
+ use the largest limit to get recent favorites
+ misc
2023-05-05 17:49:59 +03:00

20 lines
518 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:
"""
Gets all songs under the ~/ directory.
"""
for track in tqdm(TrackStore.tracks, desc="Checking for deleted tracks"):
if not os.path.exists(track.filepath):
TrackStore.tracks.remove(track)
tdb.remove_track_by_filepath(track.filepath)