Pluchon iOS reader - reload icon cache

Hoping @Tiberius lurks around here still.

I had occasion to clear the icon cache….I didn’t realise how much i subconsciously used then not they’re all default.

What do I have to do to get the icons to reload. It’s been a number of days, and I did try removing, re-adding the app.

Hi,

Yes, still here :slight_smile:

Cleaning the cache from the app settings (or reinstalling the app) should have worked…

Can you install the app on another device and connect to your tt-rss instance with your credentials to see if the icons are correct ?

BTW, I don’t know if you sent me a mail from the website, but the email address was wrong, so I could not answer.

Yeah that was me off your site.

I have it on two devices. iPad and iPhone.

iPad I cleared cache about a week ago. And they haven’t returned. I think I did remove and reinstall app on here as well.

iPhone has most icons but not all (I had to sort some out after pulling a new docker version). I have not tried clearing icons on the phone yet.

I have a feeling it has something to do with this. I haven’t had feed icons in iOS reader since this change was implemented.

https://discourse.tt-rss.org/t/favicons-cache-implementation-overhaul/5698?u=sam302psu

Ahh, very well could be. So the ui is able to pull them from whereever they come from.

But if I read this correctly the api does not get the icon now because it hadn’t been worked out. Is my understanding correct?

So I just tried the api on two entries https://your.site//tt-rss//public.php?op=feed_icon&id=193
And one returned me an image in the middle of the screen. The other, which I notice in the phone doesn’t have a logo, tried to download a bmp file.

Unsure how (or if ) this would be handled by the ios app.

there’s isn’t an API-specific endpoint at the moment, I can add one if needed.

the generic endpoint which web UI is using is not authenticated so you can you use that one for the time being. basically just change the URL in the app.

tried to download a bmp file.

how does this API endpoint look? i’d rather not return the icon as an encoded JSON payload, it seems wrong.

	function getFeedIcon(): bool {
		$id = (int)$_REQUEST['id'];
		$cache = DiskCache::instance('feed-icons');

		if ($cache->exists((string)$id)) {
			$cache->send((string)$id);
		} else {
			return $this->_wrap(self::STATUS_ERR, array("error" => self::E_OPERATION_FAILED));
		}
	}

you’ll need to check if returned data is error JSON or image binary, which you then save or do whatever else with.

e: Comparing c30b24d09f...b10e54ecca - tt-rss - Tiny Tiny RSS gonna wait for feedback on this.

I can’t comment on it too much being the end user of an app, rather than the developer.

Yeah same here I assume that’s all good but @Tiberius would need to update the app to utilize it I suppose. I never bothered to reach out for support because I wasn’t all that worried about it. But if fox is going to put in the effort to do something about it I think we’d need to get Tiberius to comment.

For now, I retrieve the icon path in the “icons_url” of the getConfig.
Then I download the icon with this url icons_url/feed_id.ico

Of course, if @fox adds getFeedIcon I’ll need to update the app to use this new function depending on the API level. I’m checking API level with getApiLevel but don’t use it for now (I think we are still at level 1 ?)

we’re at level 19 :slight_smile:

https://dev.tt-rss.org/tt-rss/tt-rss/commit/a2af3a6bb4060af2903112101c9b6f4b2801b878

in the end i got this merged so you can try using it.

Hi, any potential new builds for the iOS app on the horizon?

Thanks

I’m using an old version of Tiny Tiny RSS (with API 14) and I’m not going to updated it for now.

So, for testing, if someone could provide me with a test instance, I could update and test the iOS app.

@fox the problem is if I use this endpoint, there is no local cache, so every time I download a feed, I need to get it’s icon. Perhaps if the getFeeds return the icon in the JSON this should avoid multiple calls to the API ?

what do you mean? you can save the resulting data to file and refresh it at your own leisure.

1 Like

Yes, I can save the data locally, but how can I know if I need to update the data ?
Or I can just let the user to force the refresh if he wants (there is already an option in the app for that)

When you say “image binary”, what is the format of the result ? a json containing base64 image data ?
Because every API call returns a JSON, so sending the image in a base64 JSON is logical. Otherwise, it will break the logic of my software because all calls are made the same way and the JSON decoding is automatic.

an image.

it would be incredibly idiotic to return an image as a JSON (how? base64 encoded? why?)

i’m sorry to hear that.

p.s.

sounds like ios developers live in some kind of nightmarish world i want no part of.

it would be incredibly idiotic to return an image as a JSON (how? base64 encoded? why?)

To keep the logic of returning a JSON. For small images, you can easily base64_encode your file to send it in a JSON message. This is one of the ways that is used in the Rest APIs for transfering binaries. And with a JSON, you can also sent other data with this file if you want, a comment for example, or whatever you want, with just one JSON.

I’m not saying that getting the file is difficult, but I’m working on this app on my spare time, if I can easily add this call, i’ll do it, otherwise, I won’t, at least for now, until I find time to work on it.