luludotdev / beatsaver-reloaded

BeatSaver Again
ISC License
179 stars 49 forks source link

Bulk API endpoint (for eg beatlist) #106

Closed mhombach closed 3 years ago

mhombach commented 3 years ago

Platform

This feature request concerns: (select all that apply)

Details

The famous and broadly used extension "beatlist" (playlists for beatsaber) is pulling the data from beatsaver-API but get's ratel-limited often because for each map the information needs to be retrieved seperately. It would be in favour of both systems (beatlist and beatsaver) if there would be bulk-endpoints for sending an array of keys/hashes.

Preferred Solution

There should be bulk-endpoints for retreiving the same type of information (details) for multiple songs. This will drastically lower the load on the database and all server-systems between the client and the database. For finale endpoint-definitions I suggest to communicate with the developer of beatlist (even though, this change is not only for beatlist, but will be used also by beatlist). I think those 2 endpoints

are the primary targets for bulk operations. An request could contain an array of keys/hashes, either in the url, the body or header-fields. The response would have a array that could be looking like this:

[
    { "key": "1bd", "details": "..."},
    { "key": "2gef", "details": "..."},
    { "key": "3ce", "details": "..."},
]

If there are any questions or hesistations about this, feel free to comment and I'm happy to answer.

Here is the conversation about this problem on the beatlist-repo: https://github.com/Alaanor/beatlist/issues/76#issuecomment-751520178

luludotdev commented 3 years ago

This is actually already a thing on the rewrite. As for when that gets finished I cannot say. I've been increasingly busy over the last couple months and maintaining this repo is not a high priority.

mhombach commented 3 years ago

@lolPants Would it be ok for you if I create a PR for the bulk endpoints? The tools used here (mongoose, typescript, koa) are well known to me and I would gladly help getting those 2 bulk endpoints shipped :)

luludotdev commented 3 years ago

I'm not accepting PRs until the rewrite is shipped.

mhombach commented 3 years ago

Alright :)