build: extract helper methods in DownloadBrandLogosTask to reduce complexity#6326
build: extract helper methods in DownloadBrandLogosTask to reduce complexity#6326RubenKelevra wants to merge 1 commit intostreetcomplete:masterfrom
Conversation
…plexity Split run() method into downloadLogo() and computeSmallImageUrl() to improve readability and maintainability.
|
Well, I didn't really expect that you're working on the weekend. So the two tasks are still running for validation. Got bamboo piping - how we say in Germany - so this will take a while. But I noticed that we skip all svgs... that would be easily fixable, as Wikipedia does render SVGs, we would just need to convert the URL from the original SVG file to the rendered PNG ones. Should I add this, or is there no plan to ever use this again? |
At least I am appearing on this issue tracker quite randomly, especially as basically all of my issue tracker activity here is an unpaid hobby :) I would expect that PRs not yet finished and not yet ready for full review and merge would be created as drafts (I did it with say #6302) |
|
Sure, let's make it a draft. :) |
|
... and I think retries would also help. The current version is failing hard on a single timeout :/ |
|
Maybe the URLs are not current anymore. Or maybe in the meantime there is some sort of (LLM-training-induced) quota on getting these logos. In any case, this class is basically dead code. We don't actually download the brand logos for StreetComplete, because I noticed that they are just too big to include. The code just sits there because it also doesn't bothers anyone. So... anyway, let's just not spend time on that. |
|
Sad, I liked the idea to get small icons, say if you're asked about the opening hours, next to the name of the shop. I mean, instead of saving all of them inside the app, they could also be fetched on the fly and stored it in the cache of the app instead? |
|
And if it is dead and use is not planned then maybe it can be deleted? |
|
Well, I guess it would be possible to download them directly when being displayed and then cached for some time. That's how iD does it. It would be unusual though for StreetComplete, because otherwise all functionality is available offline. |
Split run() method into downloadLogo() and computeSmallImageUrl() to improve readability and maintainability.
Fixes two detekt complains: