Browse Source

fix: EditSong fixes

Kristian Vos 2 years ago
parent
commit
30a3b172d5
1 changed files with 6 additions and 23 deletions
  1. 6 23
      frontend/src/components/modals/EditSong/index.vue

+ 6 - 23
frontend/src/components/modals/EditSong/index.vue

@@ -376,24 +376,9 @@ const loadSong = _youtubeId => {
 				video.value.player.cueVideoById(_youtubeId, _song.skipDuration);
 			}
 		} else {
-			songNotFound.value = true;
-			if (bulk.value) {
-				setSong({
-					youtubeId: _youtubeId,
-					title: "",
-					artists: [],
-					genres: [],
-					tags: [],
-					duration: 0,
-					skipDuration: 0,
-					thumbnail: "",
-					verified: false
-				});
-			}
-			if (!newSong.value) {
-				new Toast("Song with that ID not found");
-				modalsStore.closeCurrentModal();
-			}
+			new Toast("Song with that ID not found");
+			if (bulk.value) songNotFound.value = true;
+			if (!bulk.value) modalsStore.closeCurrentModal();
 		}
 	});
 };
@@ -1214,11 +1199,9 @@ watch(
 	() => drawCanvas()
 );
 watch(youtubeId, (_youtubeId, _oldYoutubeId) => {
-	if (!(newSong.value && !bulk.value)) {
-		console.log("NEW YOUTUBE ID", _youtubeId);
-		unloadSong(_oldYoutubeId);
-		loadSong(_youtubeId);
-	}
+	console.log("NEW YOUTUBE ID", _youtubeId);
+	if (_oldYoutubeId) unloadSong(_oldYoutubeId);
+	if (_youtubeId) loadSong(_youtubeId);
 });
 
 onMounted(async () => {