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

Should we allow replay URLs to specify the shirt as a query parameter? #2

Open
j-masci opened this issue Dec 2, 2022 · 1 comment

Comments

@j-masci
Copy link

j-masci commented Dec 2, 2022

loadReplay: function(recName, shirts) {

The loadReplay function does already have a parameter for shirts. However, while looking at a way to implement shirts to elmadev/web, it's occurred to me that the path of least resistance might be to put the shirt in the replay URL as a query parameter. So i've written some code for recplayer-react so that when it calls controller.loadReplay, it will parse the shirt from the URL and pass it as the second argument. But now i'm wondering if it might make more sense to just include this logic inside of recplayer instead, so it's available everywhere.

So instead of passing a URL like: https://space.elma.online/replays/1qdh0g89a8/porco969BZ1994.rec

We could add the shirt: https://space.elma.online/replays/1qdh0g89a8/porco969BZ1994.rec?shirt=https://api.elma.online/dl/shirt/15307 (obviously we'd have to encode the shirt URL here)

(then this repo can be updated to parse the shirt data)

I think using this approach would be compatible with any existing back-ends which serve the replay data. If it's an issue, we could detect if recName is a url, and if it contains a shirt parameter, and if so remove it. Just in case adding query parameters would break any URLs that otherwise serve replay files.

My main question then is whether it seems good to update recplayer with the above. If not I could update recplayer-react instead.

@j-masci
Copy link
Author

j-masci commented Dec 2, 2022

it's also possible to add ?shirtKuskiId=, and rely on api.elma.online to serve the shirt file.

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

No branches or pull requests

1 participant