mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
break down store.py into multiple files in a module
+ fix last updated date bug
This commit is contained in:
@@ -5,16 +5,16 @@ import os
|
||||
|
||||
from tqdm import tqdm
|
||||
|
||||
from app.db.store import Store
|
||||
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(Store.tracks, desc="Removing deleted tracks"):
|
||||
for track in tqdm(TrackStore.tracks, desc="Removing deleted tracks"):
|
||||
if not os.path.exists(track.filepath):
|
||||
print(f"Removing {track.filepath}")
|
||||
Store.tracks.remove(track)
|
||||
TrackStore.tracks.remove(track)
|
||||
tdb.remove_track_by_filepath(track.filepath)
|
||||
|
||||
Reference in New Issue
Block a user