gethomepage / homepage

A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations.
https://gethomepage.dev
GNU General Public License v3.0
18.73k stars 1.1k forks source link

Refactor: change RomM API endpoint #3886

Closed InsertDisc closed 1 month ago

InsertDisc commented 1 month ago

Proposed change

An update to the currently existing RomM widget. This update changes the endpoint from the currently set 'platforms' endpoint to the more concise and cleaner 'stats' endpoint. The stats endpoint gives three additional fields of information that the existing two give, also without needing the calculations of the existing endpoint. Documentation has been updated to reflect the changes as well.

InsertDisc commented 1 month ago

This isnt "your fault" but I think we should take the time to fix it. This widget is not constructed correctly.

The blocks should be basically:

if error { container with error }
if !response { container with empty blocks }
normal container

In particular there is a redundant responseError block here, and no block for !response. In the case of no response it should just return the container with blocks but no values. This is what makes homepage look like its "waiting" until data is returned.

Let me know if that makes sense. If you'd prefer not to make these changes NBD, I can take care of it of course.

Thanks for the PR

I added the empty blocks, removed the extra error handling, simplified label names, updated the readme with those changes, and edited the en locale. I'm not entirely sure how the locale process works so apologies in advance.

InsertDisc commented 1 month ago

Great thank you. One last thing sorry I didn't notice! Widgets should not have more than four blocks at a time. So this always requires a little bit of logic in terms of the defaults and limiting the total. You can look at other widgets that do that but it's relatively simple.

So you're saying there can be more than 4 available fields as long as it's limited to four? If so, do you know of an existing widget I could use as a guide?

Edit @adamantike has linked an example of this for me. I'll be updating to include your request.

shamoon commented 1 month ago

So like: https://github.com/gethomepage/homepage/blob/0d25f5789b2b46b8adb85eb31883f31fe07f61df/src/widgets/gamedig/component.jsx#L16-L25

InsertDisc commented 1 month ago

I think we should be all good now. Please let me know if further changes are needed. Thank you for your patience working with me through these changes.

github-actions[bot] commented 1 week ago

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns. See our contributing guidelines for more details.