Iris
Iris copied to clipboard
Spotify UI does not list all artists
Describe the bug I have Spotify Premium, and I have added the necessary keys etc to both mopidy.conf and to the user interface (so the UI says spotify is "Authorized".
However, the list of artists in the "Artists" tab for Spotify doesn't show everything. Looking at the Chrome network tab I see the following two requests as soon as I hit "refresh" on the Artists page:
https://api.spotify.com/v1/me/following?type=artist&limit=50&refetch=1613824413902
https://api.spotify.com/v1/me/following?type=artist&limit=50&refetch=1613824413902
(The second one takes a lot shorter and says "Failed to load response data" Not sure why there are two, one of which fails)
Anyway, looking at the first (successful) request, I see:
{ artists: {items: [{external_urls: {spotify: "https://open.spotify.com/artist/YYYY"},…},…],…}
cursors: {after: "XXXXX"}
href: "https://api.spotify.com/v1/me/following?type=artist&limit=50"
items: [{external_urls: {spotify: "https://open.spotify.com/artist/YYY"},…},…]
limit: 50
next: "https://api.spotify.com/v1/me/following?type=artist&after=YYY&limit=50"
total: 97
}
(I've replaced any tokeny things with XXXX/YYYY)
See that total: 97? I'd expect another request to happen to retrieve the rest of them. I'm only seeing the first 50. Maybe that's what the second (failing) one is attempting to do?
In the Albums tab, on refresh, however, I do see multiple requests as its downloads each page of results for the GUI from api.spotify.com.
To Reproduce Steps to reproduce the behavior:
- Enable Test Mode (Settings > Debug > Test Mode). This provides more verbose error logs.
- Setup Spotify Premium (have have more than 50 followed artists)
- Click on 'Artists'
- Click 'Refresh'
- Count the number of rows + columns shown and multiply them (== 50 exactly)
- Send bug report :)
Expected behavior To see all the artists.
Console log
Force-refetching "mopidy:library:artists"
instrument.js:109 Force-refetching "spotify:library:artists"
instrument.js:109 Loading more: 50
Environment details:
- OS: Arch Linux
- Browser Chrome mopidy 3.1.1-1 mopidy-iris 3.55.2-1 mopidy-spotify 4.1.0-1
When looking at those 'duplicate' requests, I would expect one to be an OPTIONS
request, and the other a GET
request. It could also be due to the ServiceWorker wrapper (if you're running behind a SSL proxy). Can you confirm whether either is the case?
OPTIONS vs GET (Firefox):
ServiceWorker (Chrome):
It is worth noting that all views in Iris are lazy-loaded to limit the number of React components on the page. This number is also 50. The console.log('Loading more: 50')
indicates the next batch to be loaded is being revealed.
So the upshot is that you have counted all rows in the table and there are only 50? Is this a manual count or using an element count (ie something like document.getElementsByClassName("list artists")[0].children.length
)? I haven't been able to replicate this.
Have you got any filters applied on the view?
I counted the number of rows and columns shown on the table with my eyeballs. there were 10x5 and all cells were filled.
Oh also, no SSL proxy involved.
I'll do some more investigation later.
Hey, yup, you're right, one is OPTIONS and one is a GET request.
However, I still cannot get it to load more than 50 artists:
- I've enabled debug.
- I go to the artists page and clear the (chrome) console + network log so there's no confusion.
- I hit refresh. console says:
instrument.js:109 Force-refetching "mopidy:library:artists"
instrument.js:109 Force-refetching "spotify:library:artists"
network tab says:
following?type=artist&limit=50&refetch=1614026053257 | 200 | | Other | 0 B | 36 ms
-- | -- | -- | -- | -- | --
following?type=artist&limit=50&refetch=1614026053257 | 200 | fetch | VM21:1 | 8.7 kB | 54 ms
(once again, I can see it thinks I have 101 artists, which matches the requests in Spotify's own web interface, which calls the same API URL.. I've added a few since last time which is why it is greater)
- I scroll to the bottom of the artists page (where I'd expect it to load the next 50):
console says:
instrument.js:109 Loading more: 50
network tab is unchanged: ie no new requests.
Just in case my adblocker is screwing it up, I've tried it in incognito mode as well. Exactly the same behaviour.
What can I do now to help debug this?
The "Loading more" message was relevant when lazy rendering big lists to avoid performance issues. I completely overhauled this a few months back in 3.57.0 so the best course of action is to upgrade to the latest version and see if this fixes your issue. Please be sure to clear your browser cache.
Closing this issue; there have been many improvements since 2021 so I trust this issue is now resolved. Please request this issue is reopened if it is still relevant.