mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-07 03:35:35 +00:00

+ hide some progressbars + rewrite telemetry into a class + remove obsolete start info logs + update contributing.md to include contributing.md + send posthog event in a bg thread + related side effects
19 lines
541 B
Python
19 lines
541 B
Python
"""
|
|
This library contains all the functions related to tracks.
|
|
"""
|
|
import os
|
|
|
|
|
|
from app.db.sqlite.tracks import SQLiteTrackMethods as tdb
|
|
from app.store.tracks import TrackStore
|
|
from app.utils.progressbar import tqdm
|
|
|
|
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)
|