Browse Source

Some YouTube module bugfixes

Kristian Vos 4 years ago
parent
commit
146ba22953
1 changed files with 9 additions and 2 deletions
  1. 9 2
      backend/logic/youtube.js

+ 9 - 2
backend/logic/youtube.js

@@ -153,10 +153,17 @@ class _YouTubeModule extends CoreClass {
 						);
 					},
 
+					(songs, next) => {
+						next(
+							null,
+							songs.map(song => song.contentDetails.videoId)
+						);
+					},
+
 					(songs, next) => {
 						if (!payload.musicOnly) return next(true, { songs });
 						return YouTubeModule.runJob(
-							"FILTER_MUSIC_VIDEOS_YOUTUBE",
+							"FILTER_MUSIC_VIDEOS",
 							{
 								videoIds: songs.slice()
 							},
@@ -173,7 +180,7 @@ class _YouTubeModule extends CoreClass {
 						YouTubeModule.log("ERROR", "GET_PLAYLIST", "Some error has occurred.", err.message);
 						reject(new Error("Some error has occurred."));
 					} else {
-						resolve(response);
+						resolve({ songs: response.filteredSongs ? response.filteredSongs.songIds : response.songs });
 					}
 				}
 			);