Package: pidgin-lastfm
Version: 0.4a-2
Severity: important
Tags: patch upstream

Dear Maintainer,

the plugin in question malfunctions because lastfm slightly changed
formatting of their xml responses. It can't figured out the song's artist
anymore.

How to reproduce: enable plugin, set some lastfm username in settings,
e.g. cocacooler,
write %s in your status. See that it will replace it with something like
" - SongName".

patch is attached

In my case the plugin makes the following request:
https://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&user=cocacooler&api_key=4b9aa27d34af5238708afa6807e6a18a

lastfm responds with this (lines after the first 3 are omitted):

<?xml version="1.0" encoding="UTF-8" ?>
<lfm status="ok"><recenttracks user="cocacooler" page="1" perPage="50"
totalPages="849" total="42405"><track nowplaying="true"><artist mbid="">Kotobuki
Minako</artist>
<name>Dear My Keys ~Kenban no Mahou~ (Instrumental)</name>

-- System Information:
Debian Release: 9.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pidgin-lastfm depends on:
ii  perl    5.24.1-3
ii  pidgin  2.12.0-1

pidgin-lastfm recommends no packages.

pidgin-lastfm suggests no packages.

-- no debconf information
--- usr/lib/pidgin/lastfm.pl    2009-03-23 22:42:11.000000000 +0300
+++ /usr/lib/pidgin/lastfm.pl   2017-06-30 02:53:00.724214434 +0300
@@ -314,17 +314,17 @@
    foreach (@lines) {
     my $line = $_;
  
-    if ($line =~ /^\s*<artist mbid=.*?>(.*?)<\/artist>$/) {
+    if ($line =~ /<artist mbid=.*?>(.*?)<\/artist>/) {
      $artist = $1;
-    } elsif ($line =~ /^\s*<name>(.*?)<\/name>$/) {
+    } elsif ($line =~ /<name>(.*?)<\/name>/) {
      $title = $1;
-    } elsif ($line =~ /^\s*<date uts="(\d*)".*$/) {
+    } elsif ($line =~ /<date uts="(\d*)"/) {
      $timestamp = $1;
     } elsif ($line =~ /nowplaying="true"/) {
      $nowplaying = 1;
     }
  
-    if ($line =~ /^\s*<\/track>$/) {
+    if ($line =~ /<\/track>/) {
      last;
     }
    }

Reply via email to