Bug 231209

Summary: change track after "stopping playing after this track"
Product: [Applications] amarok Reporter: Silver Salonen <silver.salonen>
Component: PlaylistAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: both1970, nhn, stuffcorpse, teo
Priority: NOR    
Version: 2.3.0   
Target Milestone: 2.3.1   
Platform: openSUSE   
OS: Unspecified   
Latest Commit: Version Fixed In: 2.3.2

Description Silver Salonen 2010-03-18 11:56:21 UTC
Version:           2.3.0 (using KDE 4.4.1)
Installed from:    openSUSE RPMs

When "Stop Playing After This Track" is set and playing stops, the next track is not selected (although the track will change when pressing Play).

It's just a bit confusing, because it seems like the "stopped playing after this" track is active and starts playing again.
Comment 1 Sven Krohlas 2010-03-18 12:11:06 UTC
Yep, I can confirm this.
Comment 2 Marcelo Vanzin 2010-04-03 21:36:03 UTC
Actually, this seems to have an effect when you quit / restart amarok:

1. Start playing the playlist.
2. Choose "stop after current track".
3. Wait for playback to stop, quit amarok.
4. Start amarok.
5. Press play.

Amarok will play the same track again, instead of playing the next one.
Comment 3 Sven Krohlas 2010-05-10 17:53:54 UTC
*** Bug 237090 has been marked as a duplicate of this bug. ***
Comment 4 Rick W. Chen 2010-05-30 16:58:42 UTC
commit 0b36fc90a2727adbaf68111b94a587d560946122
Author: Rick W. Chen <stuffcorpse@archlinux.us>
Date:   Mon May 31 02:47:51 2010 +1200

    Fix track not changing for "stop after current track" action
    
    BUG: 231209

diff --git a/ChangeLog b/ChangeLog
index fb3a4d3..9d4b0f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@ VERSION 2.3.2-Beta 1
       Patch by Richard Longland <rlongland@hotmail.com>.
 
   BUGFIXES:
+    * Fixed tracks not changing for "stop after this track" action. (BR 231209)
     * Cleaned up some tooltips/what's this strings in the Organize dialog
       to make it easier to read and, hopefully, understand. (BR 237857)
     * Fixed organize dialog's handling of the year tag. If there is no year
diff --git a/src/playlist/PlaylistActions.cpp b/src/playlist/PlaylistActions.cpp
index 453ddaa..c114e04 100644
--- a/src/playlist/PlaylistActions.cpp
+++ b/src/playlist/PlaylistActions.cpp
@@ -135,10 +135,15 @@ Playlist::Actions::requestNextTrack()
         return;
     }
 
-    if ( stopAfterMode() == StopAfterCurrent )  //stop after current / stop after track starts here
+    if( stopAfterMode() == StopAfterCurrent )  //stop after current / stop after track starts here
+    {
+        The::playlist()->setActiveId( m_nextTrackCandidate );
         setStopAfterMode( StopNever );
+    }
     else
+    {
         play( m_nextTrackCandidate, false );
+    }
 }
 
 void