Browse Source

fix: Thumbnail fallback not working for SoundCloud media

Owen Diffey 1 year ago
parent
commit
b73bd239ed
3 changed files with 10 additions and 3 deletions
  1. 2 1
      backend/.dockerignore
  2. 0 1
      frontend/.dockerignore
  3. 8 1
      frontend/src/components/SongThumbnail.vue

+ 2 - 1
backend/.dockerignore

@@ -1,3 +1,4 @@
 node_modules/
 Dockerfile
-config/default.json
+config/local*.json
+build/

+ 0 - 1
frontend/.dockerignore

@@ -1,4 +1,3 @@
 node_modules/
 Dockerfile
-config/default.json
 build/

+ 8 - 1
frontend/src/components/SongThumbnail.vue

@@ -39,7 +39,14 @@ const onLoadError = () => {
 	// 1 - Error occured with thumbnail, fallback enabled
 	// 2 - Error occured with youtube thumbnail, fallback enabled
 	if (!props.fallback) loadError.value = -1;
-	else if (loadError.value === 0 && !isYoutubeThumbnail.value)
+	else if (
+		loadError.value === 0 &&
+		!isYoutubeThumbnail.value &&
+		!(
+			props.song.mediaSource &&
+			props.song.mediaSource.startsWith("soundcloud:")
+		)
+	)
 		loadError.value = 1;
 	else loadError.value = 2;
 	emit("loadError", loadError.value);