mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
add new album header
This commit is contained in:
+1
-1
@@ -197,7 +197,7 @@ def get_artist_data(artist: str):
|
||||
|
||||
|
||||
@bp.route("/f/<folder>")
|
||||
# @cache.cached(30)
|
||||
@cache.cached()
|
||||
def get_folder_tree(folder: str):
|
||||
"""
|
||||
Returns a list of all the folders and tracks in the given folder.
|
||||
|
||||
+16
-7
@@ -35,12 +35,11 @@ def add_track(filepath: str) -> None:
|
||||
Processes the audio tags for a given file ands add them to the music dict.
|
||||
"""
|
||||
tags = functions.get_tags(filepath)
|
||||
print(tags)
|
||||
|
||||
if tags is not None:
|
||||
print("🔵: tags okay")
|
||||
track_id = instances.songs_instance.insert_song(tags)
|
||||
track = instances.songs_instance.get_song_by_id(track_id)
|
||||
print(track_id)
|
||||
instances.songs_instance.insert_song(tags)
|
||||
track = instances.songs_instance.get_song_by_path(tags["filepath"])
|
||||
|
||||
track_obj = functions.create_track_class(track)
|
||||
api.all_the_f_music.append(track_obj)
|
||||
@@ -55,7 +54,6 @@ def remove_track(filepath: str) -> None:
|
||||
|
||||
for track in api.all_the_f_music:
|
||||
if track.track_id == track_id:
|
||||
pprint(track)
|
||||
api.all_the_f_music.remove(track)
|
||||
|
||||
|
||||
@@ -90,8 +88,19 @@ class Handler(PatternMatchingEventHandler):
|
||||
Fired when a move event occurs on a supported file.
|
||||
"""
|
||||
print("🔘 moved -->")
|
||||
remove_track(event.src_path)
|
||||
add_track(event.dest_path)
|
||||
tr = "share/Trash"
|
||||
|
||||
if tr in event.dest_path:
|
||||
print("trash ++")
|
||||
remove_track(event.src_path)
|
||||
|
||||
elif tr in event.src_path:
|
||||
add_track(event.dest_path)
|
||||
|
||||
elif tr not in event.dest_path and tr not in event.src_path:
|
||||
add_track(event.dest_path)
|
||||
remove_track(event.src_path)
|
||||
|
||||
|
||||
def on_closed(self, event):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user