Bug 322428

Summary: Playback don't starts automatically when playlist is replaced or new items are inserted into blank playlist
Product: [Applications] amarok Reporter: Marian Kyral <mkyral>
Component: PlaylistAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: kretschmann, matej, sven
Priority: NOR    
Version: 2.7.90   
Target Milestone: 2.8   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 2.8
Sentry Crash Report:

Description Marian Kyral 2013-07-16 09:01:18 UTC
Recently I've updated to Amarok 2.7.90 and I've noticed one bug (or feature?).
Previously, when Amarok finished a playlist, the playback stopped. When I inserted a new songs into playlist by choosing "Replace playlist", the playback started automatically. In current version I've to start playback manually. I've searched for some option in settings, but it seems there is nothing relevant.

So question is, whether this is a bug or feature. If feature, please allow automatic start of playback in settings. Thanks

Reproducible: Always

Steps to Reproduce:
1. Start amarok
2. Stop playback
3. Choose songs and add then to playlist by "Replace playlist" command
Actual Results:  
Songs are added into playlist, playback have to be started manually.

Expected Results:  
Songs are added into playlist and playback starts automatically.

Amarok 2.7.90, KDE 4.10.5
Comment 1 Mark Kretschmann 2013-07-16 09:16:12 UTC
It's not a bug but a behavior change. The old behavior is now available when you middle-click items in the collection.
Comment 2 Myriam Schweingruber 2013-07-16 09:48:37 UTC
Erm, this is a bug, and a side-effect of the changes recently made for double-click/middle-click. 

If a playlist is completely changed or a new playlist is created the playback should start immediately. It should just not start to play newly added stuff when there already is something in the playlist.
Comment 3 Matěj Laitl 2013-07-16 14:57:51 UTC
(In reply to comment #0)
> Recently I've updated to Amarok 2.7.90 and I've noticed one bug (or
> feature?).
> Previously, when Amarok finished a playlist, the playback stopped. When I
> inserted a new songs into playlist by choosing "Replace playlist", the
> playback started automatically. In current version I've to start playback
> manually. I've searched for some option in settings, but it seems there is
> nothing relevant.

This is a behavioural change, as Markey said, to quote the ChangeLog:
   * Playlist-related actions were harmonized, double-clicking or pressing enter will
     append tracks to playlist, using any "play media" action will prepend tracks to queue
     and immediately start playing; middle-clicking or will append & play while other
     append or replace actions will no longer start playback. (BR 145468, BR 145490,
     BR 194549)

> So question is, whether this is a bug or feature. If feature, please allow
> automatic start of playback in settings. Thanks

As Markey said, the feature to start playback is now available using a middle-clicking. (it is however not available for a replace action)


@Markey, @Mamarok: it really seems that there is no solution that would please everyone, so perhaps it is justifiable to really create an option for this? Sven already proposed it on the ML, though at the time I thought that it may not be needed, but now I'm not sure.

I imagine something like this in the config (General or Playback section?):

Double-click behaviour: [Combo Box
 a) Append tracks to the playlist
 b) Append tracks to the playlist and starting playing if nothing else is playing
 c) Append to playback queue
 d) Prepend to playback queue and starting playing immediately
]

with the default being b) perhaps, we're music player in the end.

^^^^ What do you think? Perhaps we don't need to have all these options. If there are no objections, I'd be happy to code that, we're in string freeze, but I can easily ask for an exception.
Comment 4 Myriam Schweingruber 2013-07-16 15:45:02 UTC
Wouldn't it be easier to just have one option in the playback settings: Start playing immediately or not? 
That would probably suit everyone. I just don't want it to start playing when I make a playlist, or interrupt what is currently playing when things are added, but apparently other people do want that, so that single on/off would be the best solution IMHO.
Comment 5 Marian Kyral 2013-07-16 20:04:52 UTC
(In reply to comment #4)
> Wouldn't it be easier to just have one option in the playback settings:
> Start playing immediately or not? 
> That would probably suit everyone. I just don't want it to start playing
> when I make a playlist, or interrupt what is currently playing when things
> are added, but apparently other people do want that, so that single on/off
> would be the best solution IMHO.

I agree. There should be an option to start an playback when I create a new playlist and amarok is not playing. In other case (add to playlist or amarok is already playing, it will stay as is). The problem with middle click is that this is "hidden". I'm usually creating a new playlist by D'n'D of albums to "Replace playlist" in the content panel. Maybe there could be a new option (and in context menu as well) "Replace playlist and start playback".
Comment 6 Mark Kretschmann 2013-07-21 06:40:35 UTC
Although I'm generally very much against adding options just because the developers can't decide on a proper solution, in this case it might be the right thing to do.

I think Myriam's suggestion is good. It's simple, and it completely restores the behavior from former Amarok versions. The beauty of it is also that it does not need special casing for double-click, triple-click, moon phases, etc. There is just one switch that enables or disables automatic playing, and it should probably default-enabled, to be compatible with all former Amarok versions and to not confuse our users.

Matej, I hope that this time there won't be any misunderstandings, like we had so many before.  So I'll say it again: Enable this option -> Amarok behaves 100% like version 2.7 Disable it, Amarok behaves like 2.8-beta. I'd be glad if you could implement the code :)
Comment 7 Matěj Laitl 2013-07-21 11:13:11 UTC
(In reply to comment #6)
> Although I'm generally very much against adding options just because the
> developers can't decide on a proper solution, in this case it might be the
> right thing to do.
> 
> I think Myriam's suggestion is good. It's simple, and it completely restores
> the behavior from former Amarok versions. The beauty of it is also that it
> does not need special casing for double-click, triple-click, moon phases,
> etc. There is just one switch that enables or disables automatic playing,
> and it should probably default-enabled, to be compatible with all former
> Amarok versions and to not confuse our users.
> 
> Matej, I hope that this time there won't be any misunderstandings, like we
> had so many before.  So I'll say it again: Enable this option -> Amarok
> behaves 100% like version 2.7 Disable it, Amarok behaves like 2.8-beta. I'd
> be glad if you could implement the code :)

Good, I'll go for this exactly as you say it.

@Myriam: please note that disabling that option would mean that it will *never* automatically start playing, even if you add the very first song to the playlist.
Comment 8 Myriam Schweingruber 2013-07-21 11:18:06 UTC
(In reply to comment #7)

> Good, I'll go for this exactly as you say it.
> 
> @Myriam: please note that disabling that option would mean that it will
> *never* automatically start playing, even if you add the very first song to
> the playlist.

Yep, no problem from me :)
Comment 9 Matěj Laitl 2013-07-21 21:29:17 UTC
https://git.reviewboard.kde.org/r/111635/
Comment 10 Matěj Laitl 2013-07-27 10:23:33 UTC
Git commit 8339ee262efbd9e5a8ad1d42d54aeaf6c0053c92 by Matěj Laitl.
Committed on 21/07/2013 at 21:09.
Pushed by laitl into branch 'master'.

PlaybackConfig: add option whether playback should start on track add

CHANGES:
 * Added an option whether adding tracks to playlist should start playing.

Also changed the entry in the 2.8 Beta ChangeLog, which is a bit strange,
but I believe the ChangeLog is most useful for differences between major
releases and it would be really confusing if the entry wasn't changed.
FIXED-IN: 2.8

M  +3    -3    ChangeLog
M  +4    -0    src/amarokconfig.kcfg
M  +16   -3    src/configdialog/dialogs/PlaybackConfig.ui
M  +10   -3    src/playlist/PlaylistController.cpp
M  +8    -7    src/playlist/PlaylistController.h

http://commits.kde.org/amarok/8339ee262efbd9e5a8ad1d42d54aeaf6c0053c92