Bug 427277 - Getting a discogs release data by id
Summary: Getting a discogs release data by id
Status: RESOLVED FIXED
Alias: None
Product: kid3
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: Urs Fleisch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-03 03:14 UTC by ggnnotdie
Modified: 2021-02-09 15:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
results (64.39 KB, image/png)
2020-10-03 03:14 UTC, ggnnotdie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ggnnotdie 2020-10-03 03:14:43 UTC
Created attachment 132080 [details]
results

SUMMARY
Unfortunately, the search result is not fully available to non-authorized users. example, a recently added release to discogs database

STEPS TO REPRODUCE
1. Try find any recent added to db release
2. 
3. 

OBSERVED RESULT
In attachment

EXPECTED RESULT
In attachment


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Urs Fleisch 2020-10-11 15:01:33 UTC
I tried to fix this issue in a (hopefully) better way. If you are an authorized user in Discogs, you can generate a token on their web site (Settings/Developers, Generate new token). You can then enter this token in the "Import from Discogs" dialog in Kid3 (don't forget to click "Save Settings" to make it persistent). If a token is set, Kid3 will use a JSON import via the Discogs API using the token, so you should get the full search results. If you set the token to an empty string, the existing import which parses the HTML from the Discogs web site is used.

Please test version git20201011 from https://sourceforge.net/projects/kid3/files/kid3/development/ and tell me if it solves the problem.
Comment 2 ggnnotdie 2020-12-23 20:19:30 UTC
Hi, I just want to remind you. I worked with this version for a couple of months, I can say that I did not find any problems. Thank you for this feature. \o
Comment 3 Urs Fleisch 2021-01-31 08:26:17 UTC
Fixed in version 3.8.5.
Comment 4 djbacons 2021-02-08 17:46:50 UTC
(In reply to Urs Fleisch from comment #3)
> Fixed in version 3.8.5.

Unfortunately it's buggy!

I just registered new token and did album search. It found album. I filled in token and it imported successfully. 
I closed Kid3.
Then opened Kid3 again to tag another album. It gave me results. Then i entered token again and got Not Found error again. Tried with couple more albums and same error.

Another thing. If I enter token before I search for release, i get no results. Then I clear token field and search again and I get desired results.
Unfortunately It does  not import release anymore.

Kid3: 3.8.5
OS: Pop!_OS 20.10 (64bit)
Comment 5 djbacons 2021-02-08 17:48:58 UTC
Oh and I regereneted discogs token, but it still did not import results.
Comment 6 Urs Fleisch 2021-02-08 19:01:35 UTC
I am using this for quite a while now without problems. You should click the "Save Settings" button after entering the token, it will then be stored in the configuration and used for all subsequent imports.
Comment 7 djbacons 2021-02-08 19:48:26 UTC
I did save settings, but still getting error.
Comment 8 djbacons 2021-02-08 19:50:48 UTC
Oh, if I enter token before searching then I get no results. If i search without token, I get normal results, but with or without token i get error when importing.
Comment 9 djbacons 2021-02-08 19:53:24 UTC
I just tried "apt purge kid3" and reinstalled it, but no change.
Comment 10 Urs Fleisch 2021-02-09 05:30:50 UTC
Sorry for your trouble. The "purge" option for "apt" won't make a difference since the Kid3 package does not install any system wide configuration files. The token is stored in the user configuration, which can be found in ~/.config/Kid3/Kid3.conf for kid3-qt and ~/.config/kid3rc for kid3. In my ~/.config/Kid3/Kid3.conf I have in the section "[Discogs]" and entry "Properties=token, 40CharactersOfToken". The token is visible in my Discogs account, when clicking at the login avatar at the top right after logging in, then Profile, Settings, Applications, and finally clicking on the "Manage your applications and API keys here" link. There I can see "Current token: 40CharactersOfToken", which is the same token as seen in the configuration and which is displayed in after "Token:" in the "Import from Discogs" dialog if it has been saved by clicking the "Save Settings" button.
Comment 11 djbacons 2021-02-09 07:17:26 UTC
(In reply to Urs Fleisch from comment #10)
> Sorry for your trouble. The "purge" option for "apt" won't make a difference
> since the Kid3 package does not install any system wide configuration files.
> The token is stored in the user configuration, which can be found in
> ~/.config/Kid3/Kid3.conf for kid3-qt and ~/.config/kid3rc for kid3. In my
> ~/.config/Kid3/Kid3.conf I have in the section "[Discogs]" and entry
> "Properties=token, 40CharactersOfToken". The token is visible in my Discogs
> account, when clicking at the login avatar at the top right after logging
> in, then Profile, Settings, Applications, and finally clicking on the
> "Manage your applications and API keys here" link. There I can see "Current
> token: 40CharactersOfToken", which is the same token as seen in the
> configuration and which is displayed in after "Token:" in the "Import from
> Discogs" dialog if it has been saved by clicking the "Save Settings" button.

I have ~/.config/kid3rc and there is Discogs sections with token property. I deleted ~/.config/kid3rc, but that did not change anything either. I saved settings, so the config file is filled in and ... nothing changed.

Searching and importing goes the same: if token field is not empty (in search window), I get no search results. If I empty token field, I get search results, but I cannot import. If i search without token and try to import with token, i still get error.
I tried with saving settings and tried without, every time i get same error. :(

I have no idea why it worked first time, but not anymore. :(
Comment 12 djbacons 2021-02-09 08:25:57 UTC
Just tried it on different system with same OS and got same situation as first one.
Comment 13 Urs Fleisch 2021-02-09 13:29:07 UTC
Git commit 97464a9f8a042182b918dc436444eefc1ec5e5dc by Urs Fleisch.
Committed on 09/02/2021 at 13:22.
Pushed by ufleisch into branch 'master'.

Fix Discogs import
Related: bug 432678, bug 432566

M  +5    -3    src/core/import/serverimporter.cpp
M  +348  -240  src/plugins/discogsimport/discogsimporter.cpp
M  +14   -4    src/test/testdiscogsimporter.cpp

https://invent.kde.org/multimedia/kid3/commit/97464a9f8a042182b918dc436444eefc1ec5e5dc
Comment 14 Urs Fleisch 2021-02-09 14:08:04 UTC
Still wondering why the import with the API token does not work for you. But now you should be able to import without API token again when using version kid3-git20210209 from https://sourceforge.net/projects/kid3/files/kid3/development/.
Comment 15 djbacons 2021-02-09 15:40:42 UTC
(In reply to Urs Fleisch from comment #14)
> Still wondering why the import with the API token does not work for you. But
> now you should be able to import without API token again when using version
> kid3-git20210209 from
> https://sourceforge.net/projects/kid3/files/kid3/development/.

This works. :)
Thank you.