diff --git a/server/app/lib/watchdoge.py b/server/app/lib/watchdoge.py index 2838077b..e1ee16eb 100644 --- a/server/app/lib/watchdoge.py +++ b/server/app/lib/watchdoge.py @@ -4,15 +4,15 @@ This library contains the classes and functions related to the watchdog file wat import os import time -from app.logger import logg +from app.logger import get_logger from app import instances -from app import models -from app.helpers import Get, create_album_hash -from app.lib.albumslib import create_album +from app.helpers import create_album_hash from app.lib.taglib import get_tags from watchdog.events import PatternMatchingEventHandler from watchdog.observers import Observer +log = get_logger() + class OnMyWatch: """ @@ -31,7 +31,7 @@ class OnMyWatch: try: self.observer.start() except OSError: - logg.error("Could not start watchdog.") + log.error("Could not start watchdog.") return try: @@ -55,18 +55,6 @@ def add_track(filepath: str) -> None: if tags is not None: hash = create_album_hash(tags["album"], tags["albumartist"]) tags["albumhash"] = hash - - album = instances.album_instance.find_album_by_hash(hash) - all_tracks = Get.get_all_tracks() - all_tracks.append(models.Track(tags)) - - if album is None: - album_data = create_album(tags, all_tracks) - album = models.Album(album_data) - - instances.album_instance.insert_album(album) - - tags["image"] = album.image instances.tracks_instance.insert_song(tags) @@ -75,8 +63,6 @@ def remove_track(filepath: str) -> None: Removes a track from the music dict. """ - filepath = filepath + "k" - instances.tracks_instance.remove_song_by_filepath(filepath) diff --git a/src/components/AlbumView/Header.vue b/src/components/AlbumView/Header.vue index 26a979d9..8b3d0d93 100644 --- a/src/components/AlbumView/Header.vue +++ b/src/components/AlbumView/Header.vue @@ -9,13 +9,12 @@ }" >