diff --git a/app/Observers/AlbumObserver.php b/app/Observers/AlbumObserver.php index 8f6bd383..688921ef 100644 --- a/app/Observers/AlbumObserver.php +++ b/app/Observers/AlbumObserver.php @@ -16,6 +16,11 @@ class AlbumObserver } public function deleted(Album $album): void + { + $this->deleteAlbumCover($album); + } + + private function deleteAlbumCover(Album $album): void { if (!$album->has_cover) { return; diff --git a/app/Observers/SongObserver.php b/app/Observers/SongObserver.php index 711124c8..87901123 100644 --- a/app/Observers/SongObserver.php +++ b/app/Observers/SongObserver.php @@ -15,6 +15,11 @@ class SongObserver } public function creating(Song $song): void + { + $this->setFileHashAsId($song); + } + + private function setFileHashAsId(Song $song): void { $song->id = $this->helperService->getFileHash($song->path); }