Bug 831594 - can't register a new lastfm session
can't register a new lastfm session
Product: Fedora
Classification: Fedora
Component: qmmp (Show other bugs)
Unspecified Linux
medium Severity low
: ---
: ---
Assigned To: Karel Volný
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-06-13 07:48 EDT by Karel Volný
Modified: 2012-06-15 01:47 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-13 09:34:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Karel Volný 2012-06-13 07:48:02 EDT
Description of problem:
After activationg the scrobbler plugin and choosing to register a new session, the session id is not saved.
Manually copying the id from the authorization request URL and storing it in the configfuration doesn't help.

Version-Release number of selected component (if applicable):

How reproducible:

Additional info:
see bug #828257
Comment 1 Karel Volný 2012-06-13 09:34:15 EDT
after all, it looks like PEBKAC combined with last.fm service outage/unresponsiveness

also, there is a problem with saving settings from the configuration dialogue which contributes to the problem, see below, but that is out of scope here ...

from the commandline:

1) delete the session key from ~/.qmmp/qmmp.rc so that it reads:


2) run qmmp, let it play something

3) as the session key is empty, qmmp calls getToken which queries m_server (ws.audiosrobbler.com) for the API token, using qmmp API key and hardcoded (!) SECRET

4) the contents of the reply should be printed at the console like:

Scrobbler2[lastfm]: token: 397c072c10fa4667f4e51663fdd790ab

then openUrl is called with the API_KEY and the received token which opens the authorization request in your preset browser

5) after two minutes qmmp calls getSession which asks for the session key

6) when it receives the reply, it prints it at the console:

Scrobbler2[lastfm]: name: kavol
Scrobbler2[lastfm]: key: your_key_as_a_long_hex_number___
Scrobbler2[lastfm]: subscriber: 0

if it receives a known error, it either re-requests the session or the token, otherwise it gives up completely (until restarted)

7) *after* the song is finished when the new one is started, it submits the song and sends now playing notification

Scrobbler2[lastfm]: submit request
===== metadata ======
ARTIST = Glenn Miller
TITLE = A String Of Pearls
ALBUM = The Swing Aera
== end of metadata ==
Scrobbler2[lastfm]: submited 1 song(s)
Scrobbler2[lastfm] sending notification
Scrobbler2[lastfm]: Now-Playing notification done

8) close qmmp, check ~/.qmmp/qmmp.rc - now it should have the session key stored:


- note that it is stored only on regular quit

there is

            QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
            settings.setValue("Scrobbler/lastfm_session", m_session);

right after printing the reply (step 6) - but it seems that the file is not written immediately, then when you open the configuration dialogue the session key is lost (it is not re-read from the file; and it cannot be as the file is not saved yet)

so do not touch the scrobbler configuration dialogue in the process of registering new session, just close qmmp to have the key stored (compare the configfile with the console output)

after restarting qmmp, you can now see the session key also in the scrobbler configuration dialogue
Comment 2 Gerald Cox 2012-06-15 01:47:03 EDT
Thanks for the explanation... working for me now also...

Note You need to log in before you can comment on or make changes to this bug.