[Konversation-devel] [Bug 120362] New: /media not showing artist or album info for Kaffeine

Chris chris.kcat at gmail.com
Wed Jan 18 04:49:28 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=120362         
           Summary: /media not showing artist or album info for Kaffeine
           Product: konversation
           Version: 0.18
          Platform: Gentoo Packages
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: general
        AssignedTo: konversation-devel kde org
        ReportedBy: chris.kcat gmail com


Version:           0.18 (using KDE KDE 3.5.0)
Installed from:    Gentoo Packages
Compiler:          Gcc 3.4.4 
OS:                Linux

The /media command only shows the current song title if it's being played from Kaffeine, despite the ability to grab the album and artist name through dcop. I made a small patch against the media script in 0.18 (I don't know much of anything about perl, but this works so..).

--- old_media	2006-01-17 19:33:38.000000000 -0800
+++ media	2006-01-17 19:33:11.000000000 -0800
 @ -59,7 +59,7  @
     }
     else
     {
-	return "/me is playing $title";
+	return "/me is playing \x{266B} $title \x{266B}";
     }
 }
 
 @ -115,20 +115,25  @
 
 if($kaffeine)
 {
-    my $string=`dcop kaffeine KaffeineIface title`;
-    chomp $string;
-    
-    if($string)
+    my $title=`dcop kaffeine KaffeineIface title`;
+    my $artist=`dcop kaffeine KaffeineIface artist`;
+    my $album=`dcop kaffeine KaffeineIface album`;
+
+    chomp $title;
+    chomp $artist;
+    chomp $album;
+
+    if($title)
     {
-	utf8::decode($string);
-	exec 'dcop', $port, 'Konversation', 'say', $server, $target, "/me is playing \x{266B} $string \x{266B} \[Kaffeine\]";
+        my $string = pretty_print($title,$artist,$album)." [Kaffeine]";
+        exec 'dcop', $port, 'Konversation', 'say', $server, $target, $string;
     }
     else
     {
-	if($error)
-	{
-	    $error=join(',',$error,"Kaffeine");
-	}
+        if($error)
+        {
+            $error=join(',',$error,"Kaffeine");
+        }
         else
         {
             $error="Kaffeine";


More information about the Konversation-devel mailing list