Bug 194549 - Appending songs to playlist via PopupDropper instantly plays them - should be quiet and just append
Summary: Appending songs to playlist via PopupDropper instantly plays them - should be...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Unclassified
Component: Playback (show other bugs)
Version: 2.6.90 (2.7 beta)
Platform: Ubuntu Packages Unspecified
: NOR minor with 26 votes (vote)
Target Milestone: 2.8
Assignee: Amarok Developers
URL:
Keywords:
: 308764 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-29 15:39 UTC by Peter Paulsen
Modified: 2013-06-27 18:35 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.8


Attachments
Patch to do this wish. ( add only if required ). (702 bytes, patch)
2012-02-24 12:07 UTC, PARTHASARATHY
Details
Second patch. ( never starts playing, just appends to the playlist) . (1.13 KB, patch)
2012-02-24 12:32 UTC, PARTHASARATHY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Paulsen 2009-05-29 15:39:13 UTC
Version:           2.0.90 (using KDE 4.2.85)
Installed from:    Ubuntu Packages

I'm cautious and mark this as wishlist though to me it is a bug:
When I drag a song from the collection towards the playlist and drop it on the middle pane over the "append to playlist" (translated from german "an Wiedergabeliste anhängen") entry the added file is played instantly in case that nothing else is played at that moment. That shouldn't happen, I only want to add it to the end of the playlist. If I would want to play the file I wouldn't choose to append it, I would doubleclick it in the collection (which in this case has the same effect but shouldn't).
There should be made a difference between appending a song and appending plus playing it.
Comment 1 langstr 2010-03-20 18:33:19 UTC
Hi,

If you drag the song to the playlist pane instead of that middle pane thing, Amarok does what you want.
Comment 2 Myriam Schweingruber 2010-05-29 15:17:30 UTC
Solved since quite some time, current Amarok is 2.3.0, 2.3.1 is to be released next week.
Comment 3 Sven Krohlas 2010-05-30 13:41:15 UTC
I can reprocude this perfectly since ages and also still in git master:

Steps to reproduce:
1. make sure Amarok is stopped
2. drag and drop a song from media sources to the popup dropper "add to playlist" entry

Result:
Song gets appended and starts playing.

Expected:
Song gets appended and that's it.
Comment 4 Jeff Mitchell 2010-05-30 21:35:10 UTC
I'm assuming the playlist is empty when you do this?
Comment 5 Sven Krohlas 2010-05-30 21:39:47 UTC
The bug can also be seen when there are already songs in the playlist.
Comment 6 Lamarque V. Souza 2010-06-04 04:10:49 UTC
This bug still happens in Amarok 2.3.1.
Comment 7 Myriam Schweingruber 2011-06-04 11:47:51 UTC
This is an automated message from the triager:

Amarok 2.4.1 has been released on May 8 already. Could you please upgrade and test if you can still reproduce this bug?

Without feedback within a month we will close this bug as resolved.

Thank you for your understanding.
Comment 8 Lamarque V. Souza 2011-06-04 19:30:04 UTC
This still happens in Amarok 2.4.1. In my oppinion or Amarok does not play anything or it plays the song that has just been added. There is no point in playing a song that user has not selected.
Comment 9 Myriam Schweingruber 2011-06-04 21:20:06 UTC
Thank you for the fast feedback :)
Comment 10 PARTHASARATHY 2012-02-24 10:06:13 UTC
I have found the problem with this but wanted to confirm,

There are two modes :
Dynamic Mode and Normal Mode.

When in Normal mode ( and no is song is currently being played ) , whether or not it is in pause clicking "add to playlist" ( from right click ) or drag and drop makes the new song to start playing.

When in Dynamic mode ( and no song is being played ) , if it is not paused ( meaning nothing in queue ) new song starts playing, and if it is in pause, it gets appended to playlist.

My change :

 Keep rest same, but in Normal mode, when song is paused i will make it to append to playlist when we click " add to playlist ".

Is this ok?
Comment 11 PARTHASARATHY 2012-02-24 12:07:27 UTC
Created attachment 69055 [details]
Patch to do this wish. ( add only if required ).
Comment 12 Lamarque V. Souza 2012-02-24 12:24:32 UTC
Well, what I would like is what the title of this bug says: Amarok do not try to  play anything when I am filling the playlist, just append the song. I want to device when Amarok should start playing and from each song. Nowadays Amarok plays a random song.
Comment 13 PARTHASARATHY 2012-02-24 12:28:44 UTC
(In reply to comment #12)
  Yes once check my attachment. It will append to the playlist when you click add to playlist. But if no song is playing, it will start it.
Comment 14 PARTHASARATHY 2012-02-24 12:32:38 UTC
Created attachment 69057 [details]
Second patch. ( never starts playing, just appends to the playlist) .
Comment 15 PARTHASARATHY 2012-02-24 12:34:50 UTC
1) Applying both patches - Never start playing automatically, only append to playlist.

2) Applying only first patch - Play if no song is being played, append if song is paused.

Hope this is fine.
Comment 16 Myriam Schweingruber 2012-02-24 16:01:15 UTC
@Parthasarathy: Please submit the patch to reviewboard.kde.org and take the discussion about code to the amarok-devel@kde.org mailinglist, the bug report is not the place to do that.
Comment 17 Myriam Schweingruber 2012-10-22 01:10:29 UTC
*** Bug 308764 has been marked as a duplicate of this bug. ***
Comment 18 Ralf Engels 2013-01-09 17:36:26 UTC
For me it seems to be a feature:
If nothing is playing then "append to playlist" also starts it.

Personally this is too confusing for me. I would have clean and simple behaviour, but this bug entry is not the place to discuss this. 
The correct place would be reviewboard or the developer mailing list.

For now I am closing the bug as invalid.
Comment 19 Lamarque V. Souza 2013-01-09 19:19:52 UTC
(In reply to comment #18)
> For me it seems to be a feature:
> If nothing is playing then "append to playlist" also starts it.

I do not agree with that, as far as I know no other song player does that. If someone is appending several songs that does not mean he/she wants to play right away or the first song added. Also the song played is not always the song being appended, that is really annoying when I in fact want to play the song I am appending to the playlist. That happens to me when playlist sorting is enabled and the song is inserted in the middle of the list instead of at the end.
Comment 20 Ralf Engels 2013-01-09 20:37:02 UTC
I agree.
But somebody consciously implemented the behaviour.
I just checked the code and it seems that is is distributed at four different places and in all places it's doing an AppendAndPlay or something similar.
The code goes back to 2008.

So again, definitely not a bug but I agree with you. There is a mailing list for this kind of discussion.
Comment 21 Lamarque V. Souza 2013-01-10 21:23:08 UTC
(In reply to comment #20)
> So again, definitely not a bug but I agree with you. There is a mailing list
> for this kind of discussion.

I still do not agree with that. Playing a song the user has never asked to do so is indeed a bug, there is no reasonable explanation for that. Auto-playing any song when appending to playlist is also a bad feature in my oppinion, it should be optional at most.

Sending this discussion to the mailing list will just make it disappear in the limbo that mailing lists usually are. Developers pay more attention to opened bugs than to a mail of somebody complaining about a feature that the developers do not care about (this bug has been opened for almost four years, so I guess most Amarok developers do not care much about it).
Comment 22 Matěj Laitl 2013-01-10 21:36:37 UTC
I agree that we should change the behaviour, but at all places consistently and probably not yet for 2.7.

Lamarque, on the other hand, your behaviour kinda surprises me, as you are a free software developer, too, and you must have faced users on bugreports that "are right" no matter what you say to them.

As Ralf correctly pointed out, the behavioural change should be discussed on a mailing list, so that all developers have a chance to participate. amarok-devel for sure isn't in a limbo, and behaviour change suggestion certainly isn't (or: should not be) a complaint.
Comment 23 Lamarque V. Souza 2013-01-10 23:50:27 UTC
(In reply to comment #22)
> I agree that we should change the behaviour, but at all places consistently
> and probably not yet for 2.7.

That's ok for me, this is not a show stopper.
 
> Lamarque, on the other hand, your behaviour kinda surprises me, as you are a
> free software developer, too, and you must have faced users on bugreports
> that "are right" no matter what you say to them.

Do you agree with me that Amarok playing a song that the user has never asked to play is indeed a bug? I can acknowledge obvious bugs in my code, I do that all time in Plasma NM even when the code is not mine and even if the reporter is very rude to me. I can point a bug entry where the guy were very rude and yet I acknowledged the problem and fixed it. The guy even thanked me after I fixed it. Here I am just pointing out that this is indeed a bug and this entry should not be closed until it is fixed. I also close bugs as invalid in a regular basis, but I would never close this one as invalid.
 
> As Ralf correctly pointed out, the behavioural change should be discussed on
> a mailing list, so that all developers have a chance to participate.
> amarok-devel for sure isn't in a limbo, and behaviour change suggestion
> certainly isn't (or: should not be) a complaint.

Ok, discussion is good but why close this bug as invalid if it is indeed a bug? After the discussion you will ended up with another bug entry similar to this one, right? There is also two patches attached to this bug that could be used as base for the fix, they will be lost if this bug entry remains closed.
Comment 24 Matěj Laitl 2013-01-11 00:49:54 UTC
Right.
Comment 25 Matěj Laitl 2013-05-25 11:15:49 UTC
Git commit a43e7e6f5a14307f543e7807a8d2351af027635a by Matěj Laitl.
Committed on 23/05/2013 at 18:54.
Pushed by laitl into branch 'master'.

Make playlist-related actions consistent throughout Amarok code (behaviour change)

This commits boasts a couple of changes, starting with the
uncontroversial ones:

 1. The Playlist::AddOptions enum is extended with extended with
"convenience consistency" aliases:
    OnDoubleClickOnSelectedItems
    OnMiddleClickOnSelectedItems
    OnReturnPressedOnSelectedItems
    OnPlayMediaAction
    OnAppendToPlaylistAction
    OnReplacePlaylistAction
    OnQueueToPlaylistAction

...and all callers of PlaylistController::insertOptioned() are modified
to use one of these values instead of the "low-level" flags like
DirectPlay that are actually tested for in the insertOptioned()
implementation. This serves that we remain consistent across Amarok
from now on.

 2. The actual "low-level" enum values have been changed and
insertOptioned() was updated accordingly:
    a) PrependToQueue, which implies Queue, was added.
    b) StartPlay (start playing unless something is already playing)
       was removed. No caller uses it anymore (see below) and this was
       convoluted anyway, IMO.
    c) DirectPlay now implies PrependToQueue. This may seem strange,
       but the rationale is following: when you directplay just one
       track (which is the case 90% of the time), it is played
       immediately, and this should apply even when you add more
       tracks. PrependToQueue makes this possible without hacks and is
       invisible in case of just one track, because it is immediately
       popped from the queue. Plus it has a positive side-effect of
       inserting the track at a meaningful place (affects what track is
       played next).
    d) LoadAndPlay and LoadAndPlayImmediatelly were removed, because
       they were replaces with consistency aliases.

 3. Thanks to 2b), 2c) and implementation changes, the actual action
    performed upon a certain trigger no longer depends on any state.
    The state of playlist search no longer affects whether a track will
    be played in case of DirectPlay.

 4. insertOptioned() was cleaned up and changed, for example it tries
    to choose the best place to insert tracks according to
    PrependToQueue or Queue.

 5. The convenience aliases were assigned as follows:

    OnDoubleClickOnSelectedItems = OnReturnPressedOnSelectedItems =
    = OnPlayMediaAction = DirectPlay.
    OnMiddleClickOnSelectedItems = OnAppendToPlaylistAction = Append (0).
    OnReplacePlaylistAction = Replace (no-brainer).
    OnQueueToPlaylistAction = Queue (no-brainer).

    These aren't of course set in stone, they were however chosen to be
    as much consistent with other KDE apps as possible.

Especially the "DirectPlay implies PrependToQueue" change is a bit
controversial, my opinion in that matter is anything but strong and I'm
open to any discussion. But perhaps try to use it for a couple of days
to get over the barrier of change.

CHANGES:
 * Playlist-related actions were harmonized: double-clicking, pressing
   enter or using any "play media" action will prepend tracks to queue
   and immediately start playing; middle-clicking appends to playlist;
   append or replace actions will no longer start playback.

CCMAIL: amarok-promo@kde.org
CCMAIL: amarok-devel@kde.org
Related: bug 145468, bug 145490
FIXED-IN: 2.8
GUI: Behavioural change in some places, to increase consistency. Please
check that the docs don't mention the old behaviour, see CHANGES.
DIGEST: Amarok harmonizes playlist-related actions (double-clicking,
pressing Enter, middle clicking...)

M  +4    -0    ChangeLog
M  +4    -5    playground/src/context/applets/coverbling/CoverBlingApplet.cpp
M  +1    -1    playground/src/context/applets/coverbling/CoverBlingApplet.h
M  +1    -1    playground/src/context/applets/covergrid/AlbumItem.cpp
M  +5    -8    src/App.cpp
M  +5    -5    src/MainWindow.cpp
M  +1    -1    src/amarokurls/BookmarkTreeView.cpp
M  +8    -11   src/browsers/CollectionTreeView.cpp
M  +1    -1    src/browsers/CollectionTreeView.h
M  +7    -7    src/browsers/filebrowser/FileView.cpp
M  +1    -1    src/browsers/playlistbrowser/DynamicView.cpp
M  +10   -12   src/browsers/playlistbrowser/PlaylistBrowserView.cpp
M  +3    -3    src/browsers/playlistbrowser/PlaylistBrowserView.h
M  +12   -6    src/context/applets/albums/AlbumsView.cpp
M  +2    -1    src/context/applets/albums/AlbumsView.h
M  +2    -2    src/context/applets/similarartists/ArtistWidget.cpp
M  +2    -1    src/dbus/mpris1/TrackListHandler.cpp
M  +1    -1    src/dbus/mpris2/MediaPlayer2Player.cpp
M  +63   -48   src/playlist/PlaylistController.cpp
M  +19   -7    src/playlist/PlaylistController.h
M  +0    -1    src/playlist/PlaylistModel.cpp
M  +12   -18   src/playlist/view/listview/InlineEditorWidget.cpp
M  +9    -9    src/playlist/view/listview/PrettyListView.cpp
M  +1    -1    src/playlistgenerator/Preset.cpp
M  +2    -2    src/scriptengine/AmarokPlaylistScript.cpp
M  +1    -1    src/services/amazon/AmazonStore.cpp
M  +1    -1    src/services/lastfm/LastFmService.cpp
M  +3    -3    src/services/lastfm/LastFmTreeView.cpp
M  +1    -1    src/services/lastfm/SimilarArtistsAction.cpp

http://commits.kde.org/amarok/a43e7e6f5a14307f543e7807a8d2351af027635a
Comment 26 Matěj Laitl 2013-06-27 18:35:27 UTC
Git commit 71a0e27a7aa1899f063affd4854abf650978887b by Matěj Laitl.
Committed on 27/06/2013 at 10:40.
Pushed by laitl into branch 'master'.

Finally harmonize the double-click and other playlist-related actions

CHANGES:
 * Playlist-related actions were harmonized, double-clicking or pressing enter will
   append tracks to playlist, middle-clicking or using any "play media" action will
   prepend tracks to queue and immediately start playing; append or replace actions will
   no longer start playback.

Funnily enough, this is exactly what Myriam suggested from the start, but
wasn't understood by me, because her Amarok behaved differently than mine
(how so?) and we both referred to that behaviour.

The CHANGES above are current state vs. Amarok 2.7.1 and ignore any
intermediate steps.
Related: bug 145468, bug 145490
FIXED-IN: 2.8
GUI: revisit playlist-related actions, the changes are more subtle now, see CHANGES
CCMAIL: amarok-devel@kde.org
CCMAIL: amarok-promo@kde.org

M  +4    -4    ChangeLog
M  +3    -3    src/playlist/PlaylistController.h

http://commits.kde.org/amarok/71a0e27a7aa1899f063affd4854abf650978887b