Right now, there's no way to find a resource on hangar based on a jar file.
This can be useful for plugin managers that want to be able to "discover" manually added plugins, or simply dont want to have to track what plugins are installed in a separate, easily desynced, database.
Describe the solution you'd like.
All uploaded files already have sha256Hash keys, so maybe add an endpoint that allows reverse searching based on that
(it wont work for external jars, but since i cant exactly curl those i'll ignore it)
Modrinth has this in their api with getVersionFromHash and its multi-search siblings
Describe alternatives you've considered.
One alternative is to go the ore route and force all plugins to include the slug in their jar somewhere (in ore's case, the modid is the slug) but unfortunately, i think at this point Hangar has too many resources to feasibly do this retroactively without injecting the value into the jars... which could be viable.
alternatively, have the requirement from now on and simply dont present the un-tagged jars, or perhaps do the injection on those? maybe not automatically - perhaps as an option for authors to ensure full availability?
Other
As a side note, i think that external jars should simply be removed entirely.
I get it, but also why? As devs, being able to programmatically download stuff is basically half of what we do with apis!
Additionally, external downloads means that a resource could just.. stop existing and we wont be able to ever get those files again.
That actively goes against what a distribution platform should advocate.
Is your feature request related to a problem?
Right now, there's no way to find a resource on hangar based on a jar file.
This can be useful for plugin managers that want to be able to "discover" manually added plugins, or simply dont want to have to track what plugins are installed in a separate, easily desynced, database.
Describe the solution you'd like.
All uploaded files already have
sha256Hash
keys, so maybe add an endpoint that allows reverse searching based on that (it wont work for external jars, but since i cant exactly curl those i'll ignore it)Modrinth has this in their api with getVersionFromHash and its multi-search siblings
Describe alternatives you've considered.
One alternative is to go the ore route and force all plugins to include the slug in their jar somewhere (in ore's case, the modid is the slug) but unfortunately, i think at this point Hangar has too many resources to feasibly do this retroactively without injecting the value into the jars... which could be viable.
alternatively, have the requirement from now on and simply dont present the un-tagged jars, or perhaps do the injection on those? maybe not automatically - perhaps as an option for authors to ensure full availability?
Other
As a side note, i think that external jars should simply be removed entirely. I get it, but also why? As devs, being able to programmatically download stuff is basically half of what we do with apis! Additionally, external downloads means that a resource could just.. stop existing and we wont be able to ever get those files again. That actively goes against what a distribution platform should advocate.
Perhaps I should make an issue for that 🤔