Bug 229706 - "Append & Play" service menu entry not working: invalid dbus call / no autostart of Amarok
Summary: "Append & Play" service menu entry not working: invalid dbus call / no autost...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.2.90
Platform: Ubuntu Unspecified
: NOR normal with 1 vote (vote)
Target Milestone: 2.4.0
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-06 17:33 UTC by Daniel Hahler
Modified: 2010-11-26 12:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4


Attachments
A patch for the amarok_append.desktop file (352 bytes, patch)
2010-10-25 00:14 UTC, Pieter van der Kloet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Hahler 2010-03-06 17:33:10 UTC
Version:           2.2.2.90 (using KDE 4.4.1)
Installed from:    Ubuntu Packages

/usr/share/kde4/services/ServiceMenus/amarok_append.desktop contains:
  [Desktop Action appendAndPlay]
  Name=Append & Play
  Icon=amarok
  Exec=qdbus org.kde.amarok /PlayerList playMedia %U

This fails however:
  $ qdbus org.kde.amarok /PlayerList playMedia /foo
  Interface '' not available in object /PlayerList at org.kde.amarok:
  org.freedesktop.DBus.Error.UnknownObject (No such object path '/PlayerList')

Instead, "/TrackList AddTrack" should get used here probably (but supports a single item only), and does not autostart Amarok [1].
The fix for now appears to be adding a script, which receives the list of items (via %U) and then calls "AddTrack" for each. Also, it could start Amarok, if it's not running and this cannot be fixed via [1].

[1] I've tried to let Amarok autostart by creating /usr/share/dbus-1/services/org.kde.amarok.service:
[D-BUS Service]
Name=org.kde.amarok
Exec=/usr/bin/amarok
But without any luck:
  $ qdbus org.kde.amarok /TrackList AddTrack foo 0
  Service 'org.kde.amarok' does not exist.


Inititally reported for Ubuntu at: https://launchpad.net/bugs/458657
Comment 1 Mark Kretschmann 2010-08-20 20:37:47 UTC
I think the command you really want might be this here:

method int org.freedesktop.MediaPlayer.AddTrack(QString, bool)

Example:
"qdbus org.mpris.amarok /TrackList AddTrack /home/me/Music/foo.mp3 true"
Comment 2 Myriam Schweingruber 2010-08-20 21:05:08 UTC
Please confirm this solves your issue
Comment 3 Pieter van der Kloet 2010-10-25 00:14:44 UTC
Created attachment 52840 [details]
A patch for the amarok_append.desktop file
Comment 4 Pieter van der Kloet 2010-10-25 00:18:27 UTC
I'm sorry to send another mail. It seems you can't type your comment and then add an attachment with the web interface on bugs.kde.org.

Anyway, I can confirm this bug for Amarok 2.3.2 on Arch. Append&Play doesn't work. The service menu file amarok_append.desktop contains the following line:

Exec=qdbus org.kde.amarok /PlayerList playMedia %U

The service org.kde.amarok exists but there is no such thing as /PlayerList.
This issue is easily fixed however, without using DBUS calls. I attached a patch, see my previous mail.

Greetings,
Pieter van der Kloet.
Comment 5 Myriam Schweingruber 2010-10-25 19:56:36 UTC
Thank you for the patch, Pieter. Please register at http://identity.kde.org and submit your patch with reference to this report in http://git.reviewboard.kde.org
Comment 6 Leo Franchi 2010-10-30 15:55:44 UTC
commit f2ac5a2de7259fd143dca00d2ccbb133792918c8
branch master
Author: Leo Franchi <lfranchi@kde.org>
Date:   Sat Oct 30 09:54:11 2010 -0400

    Fix Append&Play when dragged from other apps. Thank you Pieter van der Kloet for the patch!
    
    BUG: 229706

diff --git a/ChangeLog b/ChangeLog
index f726069..9bcc4e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -50,6 +50,7 @@ VERSION 2.4-Beta 1
       pressing SHIFT while clicking the action will bypass trash.
 
   BUGFIXES:
+    * Fixed append&play action. Thanks Pieter van der Kloet for the patch. (BR 229706)
     * Don't ignore the "use relative path" checkbox in the playlist export dialog.
       (BR 250689)
     * Fixed applet explorer getting stuck. (BR 253058)
diff --git a/src/amarok_append.desktop b/src/amarok_append.desktop
index e3481c6..a6e7028 100644
--- a/src/amarok_append.desktop
+++ b/src/amarok_append.desktop
@@ -179,7 +179,7 @@ Name[x-test]=xxAppend & Playxx
 Name[zh_CN]=追加并播放
 Name[zh_TW]=添加並播放
 Icon=amarok
-Exec=qdbus org.kde.amarok /PlayerList playMedia %U
+Exec=amarok --append %U --play
 
 [Desktop Action queueTrack]
 Name=Queue Track
Comment 7 campos.pauloaleixo 2010-11-23 00:08:53 UTC
-----
Kubuntu 10.04.1 LTS
Qt:4.6.2                                                                        KDE Development Platform: 4.4.2 (KDE 4.4.2)                             
Amarok 2.3.0
-----

In version 4.4.2 of KDE, the "Append&Play" is still not executing correctly, that is, the file /usr/share/kde4/services/ServiceMenus/amarok_append.desktop is still un-patched.

I've fixed it locally, but can we do anything to apply the patch into a KDE's update? 

The other day I was "converting" a friend of mine from Windowz into Kubuntu, and said to him how great it is for ethical reasons, and how fast sowftware evolves in OpenSource because of the contributions of many volunteers - making this patch go forward and fixing the action would help him and many other people to have an easier experience with konqueror/Amarok :)  Also it would make me proud to tell him that it got fixed because of our little involvement :) 


If I can help in any way, please tell me.
Comment 8 Myriam Schweingruber 2010-11-23 02:08:50 UTC
If you want this to be backported to your Kubuntu version, you need to ask your distribution, we don't make the packages.
Comment 9 campos.pauloaleixo 2010-11-23 14:10:49 UTC
Ok, thanks for the clarifying - I was not aware that this was at the
"distro" level :)

Greetings

On Tue, Nov 23, 2010 at 2:08 AM, Myriam Schweingruber <myriam@kde.org>wrote:

> https://bugs.kde.org/show_bug.cgi?id=229706
>
>
>
>
>
> --- Comment #8 from Myriam Schweingruber <myriam kde org>  2010-11-23
> 02:08:50 ---
> If you want this to be backported to your Kubuntu version, you need to ask
> your
> distribution, we don't make the packages.
>
> --
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are a voter for the bug.
> You are on the CC list for the bug.
>
Comment 10 Daniel Hahler 2010-11-23 15:20:06 UTC
Campos, just for information: to get this into a stable release of Ubuntu, you would have to follow http://wiki.ubuntu.com/SRU - but it does not really fit those criteria.
The Kubuntu team however backports KDE (including Amarok) often to the current stable release (e.g. for KDE 4.5.3 see http://www.kubuntu.org/news/kde-sc-4.5.3).

However, there is no official Amarok release yet which includes this fix, but distro packages might integrate the patch of course.

You could fix it yourself, by getting the current Amarok sources (e.g. from Ubuntu "apt-get source amarok", add the patch and submit it to your PPA at launchpad.net, where it would get build and made available for others to install).
For more information please refer to the Ubuntu documentation, e.g. via https://wiki.ubuntu.com/UbuntuDevelopment - thank you!
Comment 11 campos.pauloaleixo 2010-11-26 12:11:06 UTC
Daniel, thanks a lot for all the explanaition - it certainly shows me more
that can be done :)

I'll have a look when I can :)

And thanks again :)

PS: this (new to me) "open collaborative" attitude among people feels very
natural :)

On Tue, Nov 23, 2010 at 3:20 PM, Daniel Hahler <kde-bugzilla@thequod.de>wrote:

> https://bugs.kde.org/show_bug.cgi?id=229706
>
>
>
>
>
> --- Comment #10 from Daniel Hahler <kde-bugzilla thequod de>  2010-11-23
> 15:20:06 ---
> Campos, just for information: to get this into a stable release of Ubuntu,
> you
> would have to follow http://wiki.ubuntu.com/SRU - but it does not really
> fit
> those criteria.
> The Kubuntu team however backports KDE (including Amarok) often to the
> current
> stable release (e.g. for KDE 4.5.3 see
> http://www.kubuntu.org/news/kde-sc-4.5.3).
>
> However, there is no official Amarok release yet which includes this fix,
> but
> distro packages might integrate the patch of course.
>
> You could fix it yourself, by getting the current Amarok sources (e.g. from
> Ubuntu "apt-get source amarok", add the patch and submit it to your PPA at
> launchpad.net, where it would get build and made available for others to
> install).
> For more information please refer to the Ubuntu documentation, e.g. via
> https://wiki.ubuntu.com/UbuntuDevelopment - thank you!
>
> --
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are a voter for the bug.
> You are on the CC list for the bug.
>