?

Log in

No account? Create an account
Tag support? - LogJam [entries|archive|friends|userinfo]
LogJam

[ website | LogJam ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Tag support? [Aug. 4th, 2005|11:38 am]
LogJam

logjam

[labrown]
Is there any hope of supporting LJ's new Tags feature in logjam?
LinkReply

Comments:
[User Picture]From: labrown
2005-08-04 04:03 pm (UTC)
Ya. Thanks. I saw the post further down in the community after posting my query... Some days my brain is just not running on all cylinders....
(Reply) (Parent) (Thread)
From: mirrorbox
2005-08-04 07:27 pm (UTC)
Np =)
(Reply) (Parent) (Thread)
[User Picture]From: ouij
2005-08-04 03:53 pm (UTC)
Seconded. That would be really neat.
(Reply) (Thread)
[User Picture]From: ouij
2005-08-04 03:54 pm (UTC)
oh. and I just thought of one more thing--it'd be nice if there were a plugin that detected music from Rhythmbox, as well. I like XMMS, but I'm moving more towards Rhythmbox.
(Reply) (Parent) (Thread)
[User Picture]From: smigs
2005-08-04 03:57 pm (UTC)
uhh.. there is. at least in the version i've got.. if it isn't in your version, just use "rhythmbox --print-playing" as the custom command.
(Reply) (Parent) (Thread)
[User Picture]From: psr
2005-08-04 11:08 pm (UTC)
Annoyingly this (both the Logjam support and the rhythmbox command line switch, which I think amount to the same thing) only prints the title of the song, and not Artist - Title as XMMS does.

I have a python script somewhere that used Bonobo to query both, but it would start a copy of rhythmbox if one wasn't running. I think this is really a bug in Rhythmbox.
(Reply) (Parent) (Thread)
[User Picture]From: smigs
2005-08-04 11:10 pm (UTC)
yeah, the not-printing-artist thing has been bugging me for as long as i've been using rhythmbox, but i'm not sufficiently motivated or skilled to do anything about it...
could i have a copy of the python script? i have rhythmbox running all the time anyway..
(Reply) (Parent) (Thread)
[User Picture]From: psr
2005-08-04 11:35 pm (UTC)
Wow, that was quick!

I posted here when I wrote it. At the time I thought my hard work had been cruely ignored, but it seems that after I last looked at the coments, I recieved encouraging words from evan.

It seems the code has bitrotted a little since then. If you're running the same python-gnome2 that I am, you will have to replace:

obj = bonobo.activation.activate_from_id("OAFIID:GNOME_Rhythmbox")

with:

obj, oafID = bonobo.activation.activate_from_id("OAFIID:GNOME_Rhythmbox").

Also it only seems to work when Rhythmbox is playing. I know Python nowadays, so I'll fix it a bit better in a minute.
(Reply) (Parent) (Thread)
[User Picture]From: psr
2005-08-05 12:16 am (UTC)
Right, this will not try to print anything when Rhythmbox isn't playing, leaving Logjam to print a semi-sensible error message, rather than a Python stack trace.

I've also attempted to deal with artists and titles with non-latin-1 characters in them (I haven't tested this thoroughly, when searching for things to test them on all I could think of was Mötley Crüe).

It outputs in UTF-8, which Logjam seems happy enough with, but running in a terminal it prints unpronouncable things. If you get rid of the .encode('utf-8') parts of the final line, python seems to work out the correct character coding to use for the terminal, but can't work it out for the pipe that rhythmbox (presumably) uses. I only got into trying to make this work right because people keep going on about unicode on Planet Python at the moment.

As I said, Rhythmbox should really just provide a command-line switch to get a better explanation of whats playing. This is ugly, and not going to get much better.

#!/usr/bin/env python
import pygtk; pygtk.require("2.0")
import bonobo

corbaObj, oafID = bonobo.activation.activate_from_id("OAFIID:GNOME_Rhythmbox")
song = corbaObj.getPlayerProperties().getValue("song")
if song.value() is not None:
    artist = unicode(song.value().artist, 'utf-8')
    title = unicode(song.value().title, 'utf-8')
    print artist.encode('utf-8'),  ' - ',  title.encode('utf-8')
(Reply) (Parent) (Thread)
[User Picture]From: smigs
2005-08-05 02:15 pm (UTC)
thanks a lot :)
(Reply) (Parent) (Thread)
[User Picture]From: smigs
2005-08-05 02:29 pm (UTC)
when i try and run this i get:
[matthew ~]$ ./rbp
Traceback (most recent call last):
  File "./rbp", line 5, in ?
    corbaObj, oafID = bonobo.activation.activate_from_id("OAFIID:GNOME_Rhythmbox")
TypeError: unpack non-sequence
(Reply) (Parent) (Thread)
[User Picture]From: psr
2005-08-07 03:04 am (UTC)
Try running the original version. Does it still happen?
(Reply) (Parent) (Thread)
[User Picture]From: smigs
2005-08-07 10:32 am (UTC)
nope... the original version works fine :) thanks!
(Reply) (Parent) (Thread)
[User Picture]From: broonie
2005-08-04 04:18 pm (UTC)
Alternatively, is there any ETA for a new release integrating this any and of the other pending changes?
(Reply) (Thread)
(Deleted comment)
[User Picture]From: asim
2005-08-04 05:28 pm (UTC)
What, you're here as well? :)
(Reply) (Thread)
[User Picture]From: labrown
2005-08-04 07:32 pm (UTC)
Yippee skippy! Logjam is my preferred LJ client.
(Reply) (Parent) (Thread)