Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 647904 - media-sound/clementine-1.3.1_p20180203: last.fm login fails
Summary: media-sound/clementine-1.3.1_p20180203: last.fm login fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fat-Zer
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-02-16 22:30 UTC by jorgicio
Modified: 2018-02-19 19:01 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The patch to fix the last.fm support (clementine-liblastfm-qt5-fix.patch,2.97 KB, patch)
2018-02-16 22:31 UTC, jorgicio
Details | Diff
A patch to fix the last.fm auth (clementine-lastfm-auth-fix.patch,1.08 KB, patch)
2018-02-19 13:16 UTC, jorgicio
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jorgicio 2018-02-16 22:30:34 UTC
Hi!

I noticed that Clementine is now migrated to Qt5, but that support is quite experimental.

I was trying that version of Clementine, and although I have the USE-flag lastfm enabled, it's disabled by default.

I made a patch to get rid of that, but it can't log in.

I'll upload the patch then.

Thanks.

Reproducible: Always
Comment 1 jorgicio 2018-02-16 22:31:14 UTC
Created attachment 519848 [details, diff]
The patch to fix the last.fm support
Comment 2 Andrew Ammerlaan gentoo-dev 2018-02-17 10:43:28 UTC
This patch works in getting lastfm back into the settings menu, however when trying to login the lastfm webpage returns this: "Invalid API key. If you are a third party developer see our authentication how-to to find out more."

Also, did you notice that the sidebar menu items all contain an extra '&' symbol in their text? What's up with that? Is that due to qt5?
Comment 3 jorgicio 2018-02-17 14:27:07 UTC
(In reply to Andrew Ammerlaan from comment #2)
> This patch works in getting lastfm back into the settings menu, however when
> trying to login the lastfm webpage returns this: "Invalid API key. If you
> are a third party developer see our authentication how-to to find out more."
> 
> Also, did you notice that the sidebar menu items all contain an extra '&'
> symbol in their text? What's up with that? Is that due to qt5?

This is what I mean when I tried to make it work with the last.fm support because of the liblastfm directories list. Yes, the menu is back, but I know it fails when trying to login with a Last.fm account.

Also, I think it may be due to qt5 because I compared the lastfmservice.cpp between the qt4 and qt5 branches. But in essential, the code may be the same, but with different functions.

So I can't understand why with qt5 fails but with qt4 works. Also, the qt5 support is still experimental.
Comment 4 Andrew Ammerlaan gentoo-dev 2018-02-17 14:37:40 UTC
Well according to the lastfm webpage: https://www.last.fm/api/authentication
You need to apply for an API key, which is specific to the application. What I think is that the key that works for qt4 does not work for qt5 because lastfm sees clementine-qt5 as a different application then celementine-qt4. Thus it returns a key mismatch.
You can create an API account here: https://www.last.fm/api/account/create
but maybe that is something the clementine devs need to do, as it is their application.
Comment 5 jorgicio 2018-02-17 15:00:23 UTC
(In reply to Andrew Ammerlaan from comment #4)
> Well according to the lastfm webpage: https://www.last.fm/api/authentication
> You need to apply for an API key, which is specific to the application. What
> I think is that the key that works for qt4 does not work for qt5 because
> lastfm sees clementine-qt5 as a different application then celementine-qt4.
> Thus it returns a key mismatch.
> You can create an API account here: https://www.last.fm/api/account/create
> but maybe that is something the clementine devs need to do, as it is their
> application.

Fine. I reported that issue in the Clementine tracker to make the developers do something with that. Also I added your answer in a screenshot.

Thanks.
Comment 6 Andreas Sturmlechner gentoo-dev 2018-02-17 19:14:09 UTC
Whatever the problem, the appname seems to not be it. I patched it to drop the awkward -qt5 postfix but it made no difference.
Comment 7 Andrew Ammerlaan gentoo-dev 2018-02-17 19:35:59 UTC
(In reply to Andreas Sturmlechner from comment #6)
> Whatever the problem, the appname seems to not be it. I patched it to drop
> the awkward -qt5 postfix but it made no difference.

Maybe it sends additional info about the app. I would imagine that lastfm would implement something to make sure that the api key that is sent actually comes from the legit registered application that it belongs to. Otherwise one could just make a fake application with just the name of the real one and use the same api key to connect it to lastfm's servers. Which I imigine is something they don't want, why would you otherwise implement this whole abi key thing.

But I'm just guessing here, hopefully the bug report on clementine's github will enlighten us.
Comment 8 jorgicio 2018-02-19 13:16:48 UTC
Created attachment 520104 [details, diff]
A patch to fix the last.fm auth

Someone sent a pull request in the issue I reported in Clementine and it says it fixes the auth issue, so I turned it into this patch.

https://github.com/clementine-player/Clementine/issues/5993
Comment 9 Andrew Ammerlaan gentoo-dev 2018-02-19 15:29:34 UTC
Thank you, it works now.

I had to authenticate clementine's request in konqueror instead of firefox, firefox-58.0.1 returned: "An error occurred during a connection to localhost:35973. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG" after clicking the "yes, allow access" button. It worked just fine in konqueror though, anyone else also had this issue?
Comment 10 jorgicio 2018-02-19 16:37:38 UTC
(In reply to Andrew Ammerlaan from comment #9)
> Thank you, it works now.
> 
> I had to authenticate clementine's request in konqueror instead of firefox,
> firefox-58.0.1 returned: "An error occurred during a connection to
> localhost:35973. SSL received a record that exceeded the maximum permissible
> length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG" after clicking the "yes,
> allow access" button. It worked just fine in konqueror though, anyone else
> also had this issue?

This is a known issue with Firefox, but they must solve it. In other browsers this doesn't happen. I also had to do the same with Qupzilla.

More information in https://github.com/clementine-player/Clementine/issues/5936
Comment 11 Larry the Git Cow gentoo-dev 2018-02-19 19:01:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fb120d06ebcd23c2668d7f838a35445c2900c1e

commit 2fb120d06ebcd23c2668d7f838a35445c2900c1e
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2018-02-19 18:47:26 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2018-02-19 19:00:47 +0000

    media-sound/clementine: Bump snapshot 1.3.1_p200182019 to fix lastfm
    
    Closes: https://bugs.gentoo.org/647904
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 media-sound/clementine/Manifest                    |   1 +
 .../clementine/clementine-1.3.1_p20180219.ebuild   | 191 +++++++++++++++++++++
 media-sound/clementine/clementine-9999.ebuild      |   6 +-
 3 files changed, 195 insertions(+), 3 deletions(-)