maweki / twitchlive-extension

TwitchLive-Panel Gnome Shell Extension displaying your favorite streamers
GNU General Public License v3.0
38 stars 8 forks source link

Difficulty obtaining streamer icons #90

Closed CubeTheThird closed 1 year ago

CubeTheThird commented 2 years ago

Although this used to work without issue, I seem to no longer have icons for new streamers I add to the list (existing ones show up fine). I have curl and ImageMagick (and thus mogrify) installed, so I doubt this is the source of the problem. When checking my system logs, this is the only message I see that could be relevant, though I have doubts:

Requiring Soup but it has 2 versions available; use imports.gi.versions to pick one

If there is anything additional I can try, or info I can provide to help figure this out, that would be much appreciated.

maweki commented 2 years ago

As we use curl, soup is actually not involved in the whole icon process. Let's check something:

Could you rename (or move all images out of) ~/.cache/twitchlive-extension/. We don't want to delete the images you already have. If you rename the whole directory, you have to redo the auth, because the oauth-token is in that directory as well.

Now what should happen is that (1) the directory is populated with the "raw" streamer icons and (2) the files are converted to png as twitchlive-[streamername].png. Maybe we see something there.

If nothing happens, the issue is with curl or these parts of the process. If they are downloaded but not converted, mogrify is the issue. And if they are indeed there, the images aren't loaded correctly.

CubeTheThird commented 2 years ago

Thanks. I've tested as suggested and nothing happens; the folder only hold the oauth-token. From what I gather, I guess this means either it can't find curl/mogrify, or it's not able to download the image?

maweki commented 2 years ago

If the extension of the picture is png, mogrify is optional. Some streamers upload pngs. Quite a few actually. And if mogrify isn't found, we would download only the png ones.

Strange. I currently can't try and reproduce this, so you might have to do some legwork. Are you comfortable with adding a few log statements to the icons.js file?

I think the following log statements would be good:

I think those three would be most important. Maybe something with the urls for the images changed. So if you have an example output, please post it. Maybe something goes wrong when doing the filename stuff from line 60-63 if enough stuff changed in the twitch filenames.

Remember that you have to restart the shell in order for the changes to take effect. The files are somewhere in ~/.local/share/gnome-shell/extensions/twichtlive or similar.

CubeTheThird commented 2 years ago

After digging through a rabbit-hole based on your recommendations, I found the issue. As it turns out, the 2 Soup versions IS the problem. None of the logging statements were outputting anything, and I narrowed it down to line 45 of icons.js. This makes reference to a session object, which I'd guess isn't formatted correctly when defaulting to Soup 3.0. I added an explicit version import before the actual import line in prefs.js:

imports.gi.versions.Soup = "2.4";

After doing this, the icons import correctly.

maweki commented 2 years ago

That's great work. Thank you very much. If you can manage, I would appreciate a PR. Otherwise, I'll do it manually in a few days. Thank you very much.

maweki commented 1 year ago

I added this line and uploaded a new extension version. Why the main panel works without it and why it needs to be added to prefs when the download should happen from the panel thread as well... I have no idea and I won't try to understand this.

Extension programming sucks and all the gnome documentation sucks.