File tree 1 file changed +19
-3
lines changed
1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,20 @@ module.exports = {
400
400
} ) ;
401
401
for ( let i = 0 ; i < spotifyPlaylistItems . length ; i ++ ) {
402
402
try {
403
- const video = await searchOne ( spotifyPlaylistItems [ i ] . track ) ;
403
+ let trackData ;
404
+ if ( data . type == 'album' ) {
405
+ trackData = {
406
+ artists : spotifyPlaylistItems [ i ] . artists ,
407
+ name : spotifyPlaylistItems [ i ] . name
408
+ } ;
409
+ } else {
410
+ trackData = {
411
+ artists : spotifyPlaylistItems [ i ] . track . artists ,
412
+ name : spotifyPlaylistItems [ i ] . track . name
413
+ } ;
414
+ }
415
+
416
+ const video = await searchOne ( trackData ) ;
404
417
405
418
if ( nextFlag || jumpFlag ) {
406
419
flagLogic ( interaction , video , jumpFlag ) ;
@@ -413,8 +426,11 @@ module.exports = {
413
426
)
414
427
) ;
415
428
}
416
- } catch ( error ) {
417
- return interaction . followup ( error ) ;
429
+ } catch ( err ) {
430
+ processingMessage . delete ( ) ;
431
+ return interaction . followUp (
432
+ 'Failed to process playlist, please try again later'
433
+ ) ;
418
434
}
419
435
}
420
436
processingMessage . edit ( 'Playlist Processed!' ) ;
You can’t perform that action at this time.
0 commit comments