After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 561811 - Jamendo plugin
Jamendo plugin
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Plugins
2.24.x
Other Linux
: Normal enhancement
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-11-21 14:44 UTC by izi
Modified: 2008-12-05 13:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Jamendo totem plugin patch (53.67 KB, patch)
2008-11-21 14:46 UTC, izi
needs-work Details | Review
Jamendo totem plugin patch (v2) (55.99 KB, patch)
2008-11-26 11:33 UTC, izi
needs-work Details | Review
Jamendo totem plugin patch (v3) (59.68 KB, patch)
2008-12-04 20:37 UTC, izi
none Details | Review
Fix for 5819/5820 (16.21 KB, patch)
2008-12-05 13:47 UTC, izi
committed Details | Review

Description izi 2008-11-21 14:44:50 UTC
Hey there,

attached a patch (against trunk) for a Jamendo totem plugin.
This plugin allows to search, browse and listen to the large collection of creative commons licensed albums provided by jamendo.

More info on jamendo: http://www.jamendo.com

As a Jamendo developper, I am willing to maintain/upgrade/enhance this plugin, should I ask for a gnome svn account ?

Thanks,

--
David JEAN LOUIS <izimobil@gmail.com>
Comment 1 izi 2008-11-21 14:46:06 UTC
Created attachment 123174 [details] [review]
Jamendo totem plugin patch

Patch again up-to-date trunk
Comment 2 Philip Withnall 2008-11-25 07:34:59 UTC
This looks interesting, but it uses Python 2.5 features (try...except...finally), so I won't be able to try it for a while (since I'm still on Python 2.4, and it's hell to change over). The only comment I can make at the moment is that changes to configure.in to enable compilation of the plugin seem to be missing.

Looks like a formidable piece of work though!
Comment 3 izi 2008-11-25 08:53:44 UTC
Hey Philip,
thanks for your remarks.
Should I make the code python 2.4 compatible ? is it preferred ?
I'll dig into the configure.in stuff and update the patch.

Bye.

--
David JEAN LOUIS <izimobil@gmail.com>
Comment 4 Bastien Nocera 2008-11-25 13:30:25 UTC
I couldn't make the plugin play any of the songs it found. No errors on the command-line, nothing, it just did nothing when I clicked on the play button for the tracks themselves.

To be honest, I'm not certain Totem is the best interface to browse for music. Rhythmbox has great support for Jamendo, including "buying" the song. Is there any reasons we should merge this code when Rhythmbox has Jamendo support already?
Comment 5 izi 2008-11-25 14:01:27 UTC
>> I couldn't make the plugin play any of the songs it found. No errors on the
>> command-line, nothing, it just did nothing when I clicked on the play button
>> for the tracks themselves.

You have to double click (activate) on the tracks or an album to play them, maybe the play icon is just confusing and should be present only on the current played song...

>> To be honest, I'm not certain Totem is the best interface to browse for music.

Well it is at least for me, I don't use rythmbox, I like totem simplicity.

>> Is there any reasons we should merge this code when Rhythmbox has
>> Jamendo support already?

Do what you want with the code. I think it would be a great addition, but I won't push for it's inclusion if people doesn't find it useful :(

Bye,

--
David JEAN LOUIS <izimobil@gmail.com>
Comment 6 izi 2008-11-26 11:33:44 UTC
Created attachment 123413 [details] [review]
Jamendo totem plugin patch (v2)

Updated patch:

* made relevant changes in configure.in and totem.spec.in
* now the "play" icon is only displayed when a track is actually being played to avoid confusion
Comment 7 Bastien Nocera 2008-12-03 12:17:17 UTC
Don't use action_set_mrl_and_play(), use add_to_playlist_and_play() (which might not be exported to Python yet...)

I still can't it to play anything, and the plugin is low on debug output.
Comment 8 izi 2008-12-03 13:55:51 UTC
(In reply to comment #7)
> Don't use action_set_mrl_and_play(), use add_to_playlist_and_play() (which
> might not be exported to Python yet...)

AttributeError: 'totem.Object' object has no attribute 'add_to_playlist_and_play'

Apparently it is not exported...
What should I use then ? 
self.totem.action_remote(totem.REMOTE_COMMAND_REPLACE, url) ?
BTW, I took the action_set_mrl_and_play() from the bbc plugin.

> 
> I still can't it to play anything, and the plugin is low on debug output.
> 

That's weird, it works for me on ubuntu and fedora, i'll add debug logging and will update the patch.
In the meantime could you please add a "raise" statement (just before the "pass") in on_treeview_row_activated() method ?

Comment 9 Bastien Nocera 2008-12-03 15:41:37 UTC
Traceback (most recent call last):
  • File "plugins/jamendo/jamendo.py", line 435 in on_treeview_row_activated
    self.totem.action_set_mrl_and_play(url)
AttributeError: 'totem.Object' object has no attribute 'action_set_mrl_and_play'

Against which version of Totem are developing this plugin?

Those bindings were removed in 2.24.x:

2008-04-08  Philip Withnall  <pwithnall@svn.gnome.org>

        * bindings/python/totem.defs: Remove set_mrl_* functions from the
        bindings, as they bypass the playlist.

I've added add_to_playlist_and_play() to the Python bindings in SVN trunk.

2008-12-03  Bastien Nocera  <hadess@hadess.net>

	* bindings/python/totem.defs: Add add_to_playlist_and_play to the
	bindings, add toggle-aspect and stop to the possible remote commands
Comment 10 izi 2008-12-03 15:51:11 UTC
(In reply to comment #9)
> Traceback (most recent call last):
>   File "plugins/jamendo/jamendo.py", line 435, in on_treeview_row_activated
>     self.totem.action_set_mrl_and_play(url)
> AttributeError: 'totem.Object' object has no attribute
> 'action_set_mrl_and_play'
> 
> Against which version of Totem are developing this plugin?
> 
> Those bindings were removed in 2.24.x:
> 
> 2008-04-08  Philip Withnall  <pwithnall@svn.gnome.org>
> 
>         * bindings/python/totem.defs: Remove set_mrl_* functions from the
>         bindings, as they bypass the playlist.
> 
> I've added add_to_playlist_and_play() to the Python bindings in SVN trunk.
> 
> 2008-12-03  Bastien Nocera  <hadess@hadess.net>
> 
>         * bindings/python/totem.defs: Add add_to_playlist_and_play to the
>         bindings, add toggle-aspect and stop to the possible remote commands
> 

Ahh...

The patch is against trunk but I'm testing against 2.24.3 (ubuntu 8.10).
But ok, thanks, I'll update the patch and use add_to_playlist_and_play().

While I'm at it, do you know if there's some way to be notified of a stop event of a previously played track from the python bindings ?

Comment 11 Bastien Nocera 2008-12-03 16:05:31 UTC
You shouldn't be showing the play icon anymore, that's the job of the playlist (but you could listen to the file-opened/file-closed signals).
Comment 12 izi 2008-12-03 18:38:06 UTC
You made a typo in your last commit (totem.defs):
s/of-object "Totem"/of-object "TotemObject"/

With this corrected add_to_playlist_and_play() now works as expected.
Comment 13 Bastien Nocera 2008-12-03 23:32:27 UTC
Fixed, thanks.
Comment 14 izi 2008-12-04 20:37:28 UTC
Created attachment 123963 [details] [review]
Jamendo totem plugin patch (v3)

* more integration with totem playlist: added a popup menu on the treeview with an "add to play list button" and an "open jamendo album page button",
* optimized json fetching,
* minor cosmetic changes.
Comment 15 Bastien Nocera 2008-12-05 10:51:43 UTC
Committed in trunk. Feel free to open new bugs if you have changes to make.

Note that I removed the "webbrowser" dependency and used xdg-open instead.

2008-12-05  Bastien Nocera  <hadess@hadess.net>

        * configure.in:
        * src/plugins/jamendo/Makefile.am:
        * src/plugins/jamendo/jamendo.glade:
        * src/plugins/jamendo/jamendo.py:
        * src/plugins/jamendo/jamendo.totem-plugin.in:
        * totem.spec.in: Patch from David JEAN LOUIS <izimobil@gmail.com>
        to add the Jamendo plugin (Closes: #561811)
Comment 16 izi 2008-12-05 13:47:35 UTC
Created attachment 124002 [details] [review]
Fix for 5819/5820

Err... sorry but what you commited is not the last patch I posted, you seem to have commited the obsoleted v2 (the one with set_mrl_and_play()).

Attached a patch that fix the commit errors (in revisions 5819/5820, with the xdg modification kept).
Comment 17 Bastien Nocera 2008-12-05 13:56:35 UTC
Committed, but please create new bugs in the future.