You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.
When I add a recipe without any picture, if this recipe becomes the first one in alphabetic order, the category has not anymore any picture.
It would be nice to look after the first picture found in this category, or to be able to choose a recipe for this category's picture.
Thanks. .
The text was updated successfully, but these errors were encountered:
I also hate the current behavior but sadly there is nothing we can do with the current api implementation.
The cookbook api only gives us a category name and a recipe count.
We then need to fetch all recipes in that category and can only guess wich one to chose.
Sadly a recipe always has an image (even the default one) and there is no way for us to easily find out wich one has a real picture without fetching it.
And I think you can get why fetching all pictures of the recipes until we find one isn't the best for performance.
I'm going to raise it on the upstream cookbook issue tracker (if it doesn't already exist) and request some better options although they might take a time to be implemented.
@Leptopoda What i dont understand is why they provide the default svg from backend. The backend should just send a recipe with NO image. Then the frontend (or client) can handle how this image should be replaced, possibly with an svg or maybe something different.
This already caused so much headache because the image libraray tries to fetch and decode the image but receives an svg and then crashes terribly without any good way to catch the error. (you most likely already have seen to error log spam due to it)
:(
I think #171 handles this quite elegantly by just checking if the returned bytes can be decoded into a String thus indicating it is an svg => the fallback.
But yeas those are just hacky workarrounds. I mean I understand that not having to deal with null image fields is easier but maybe the server could just make the default image url static so we can at least check before fetching.
Also on a side note the category object should jsut contain the image url. I mean in a browser this might not make a difference but on a mobile device not having to do 2(n+2) fetches (n = number of category) can save quite a bit of load time.
When I add a recipe without any picture, if this recipe becomes the first one in alphabetic order, the category has not anymore any picture.
It would be nice to look after the first picture found in this category, or to be able to choose a recipe for this category's picture.
Thanks. .
The text was updated successfully, but these errors were encountered: