@@ -271,8 +271,10 @@ class SoundCloudAdapter extends BaseAdapter {
271271 for ( const selector of selectors ) {
272272 try {
273273 const el = document . querySelector ( selector ) ;
274- const text = el ?. textContent ?. trim ( ) ;
274+ let text = el ?. textContent ?. trim ( ) ;
275275 if ( text && text . length > 0 ) {
276+ // Remove "Current track:" prefix if present
277+ text = text . replace ( / ^ C u r r e n t t r a c k : \s * / i, '' ) ;
276278 return text . substring ( 0 , 100 ) ;
277279 }
278280 } catch ( e ) { }
@@ -328,13 +330,14 @@ class SoundCloudAdapter extends BaseAdapter {
328330 duration : this . getDuration ( ) ,
329331 currentTime : this . getCurrentTime ( ) ,
330332 isPlaying : this . isPlaying , // Use our tracked state
331- hasSkip : ! ! this . getNextButton ( ) ,
333+ hasSkip : true ,
332334 mediaType : 'audio'
333335 } ;
334336 }
335337
336338 hasSkipButton ( ) {
337- return ! ! this . getNextButton ( ) ;
339+ // Always available - can click next or seek to end
340+ return true ;
338341 }
339342
340343 // ===== Controls =====
@@ -402,9 +405,43 @@ class SoundCloudAdapter extends BaseAdapter {
402405
403406 skip ( mediaId ) {
404407 Logger . debug ( 'SoundCloud: Skip command' ) ;
408+
409+ // Try SoundCloud's next button first
405410 const nextBtn = this . getNextButton ( ) ;
406411 if ( nextBtn ) {
407412 nextBtn . click ( ) ;
413+ return ;
414+ }
415+
416+ // Fallback: seek to end of current track
417+ const audioElements = document . querySelectorAll ( 'audio' ) ;
418+ for ( const audio of audioElements ) {
419+ if ( ! audio . paused && isFinite ( audio . duration ) && audio . duration > 0 ) {
420+ Logger . debug ( 'SoundCloud: Seeking to end' , audio . duration ) ;
421+ audio . currentTime = audio . duration ;
422+ return ;
423+ }
424+ }
425+ }
426+
427+ prev ( mediaId ) {
428+ Logger . debug ( 'SoundCloud: Prev command' ) ;
429+
430+ // Try SoundCloud's prev button first
431+ const prevBtn = this . getPrevButton ( ) ;
432+ if ( prevBtn ) {
433+ prevBtn . click ( ) ;
434+ return ;
435+ }
436+
437+ // Fallback: seek to start of current track
438+ const audioElements = document . querySelectorAll ( 'audio' ) ;
439+ for ( const audio of audioElements ) {
440+ if ( ! audio . paused && isFinite ( audio . duration ) && audio . duration > 0 ) {
441+ Logger . debug ( 'SoundCloud: Seeking to start' ) ;
442+ audio . currentTime = 0 ;
443+ return ;
444+ }
408445 }
409446 }
410447}
0 commit comments