Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: improvements to getResourceUpdate #62

Closed
MartenM opened this issue Jan 3, 2022 · 3 comments
Closed

Suggestion: improvements to getResourceUpdate #62

MartenM opened this issue Jan 3, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@MartenM
Copy link

MartenM commented Jan 3, 2022

Hi there!

I am currently attempting to write an update notification system for one of my plugins. Old wikis point me to the legacy API endpoint, but I figured using this would be better.

While doing some testing I noticed that the getResourceUpdate action is rather confusing. This endpoint seemed most logical to use for checking for updates. Especially since the getResource does not have a field that gives you the ID of the last resource update.

Some of my notes:

getResourceUpdate includes the resource description

The first entry in the return array is the current resource page. This is not an update and is rather confusing. I would suggest removing this one from the response. Getting this information can already be done by using getResource.

No information about the pagination

The result is an array. This array can contain up to 10 results and is paginated. That's all clear. However, the max amount of pages is not sent. Getting the latest update would require going through all pages.
Edit: Noticed just that this is also referenced by issue #54
Deferring to #54 for the above.

No way of sorting the result

In order to get the last resource updates, it would be very useful to be able to sort it by resource updated descending.
This would allow users to get the last couple of updates.

See #64

Now I am not sure how achievable these suggestions are, but I wanted to point them out anyway! An action getLastResourceUpdate?resource= would also help greatly but I am not sure if would fit in with the current API.

I am well aware that getResource gives you the current version string, but if possible I would like to parse the update description in order to notify users of why they should actually update ;)

PS: I would love to help with this so if you want me to PR some of the features feel free to ask.

@jacobsandersen
Copy link
Collaborator

Thanks for submitting the suggestion. I'm not too active in MC anymore, so help is certainly welcome if you're interested. The main blocker to contribution though is that you need a XenForo installation so that you can inspect the DB tables and understand the schema. If you have that, then absolutely feel free to help out.

I agree with the need for these features, I just haven't had the time to work on this much.

@MartenM
Copy link
Author

MartenM commented Jan 21, 2022

I sadly don't have access to the XenForo plugin. However, I can make a pretty educated guess on how things should or do work.
I created a PR for one of the smaller features in the suggestion. Sadly I cannot test it, but I hope that won't take too much time :)

@jacobsandersen
Copy link
Collaborator

For your first suggestion, I don't think there is an easy way for me to do this without some sketchy query modification. Since ordering is coming in #64 (thanks), getting the latest update is as easy as ordering descending. I do agree though, that is confusing. Unfortunately, XF treats it as an update.

I'm deferring to #54 for your second suggestion and your third suggestion will be handled in #64. :)

I'm going to close this issue because it is tracking multiple things, but everything here should be handled. (Except for the first suggestion, sorry)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants