Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

OneClick download #21

Closed
Splamy opened this issue Apr 9, 2019 · 17 comments
Closed

OneClick download #21

Splamy opened this issue Apr 9, 2019 · 17 comments
Labels
enhancement New feature or request

Comments

@Splamy
Copy link

Splamy commented Apr 9, 2019

The old modloader (from lolpants) had the feature to open modsaber (oneclick download) links to download a song from beatsaver. This new modmanager is missing such feature.

Would you accept such feature?
If yes I could properly implement it and create a pull request for it.
I have already tried a bit around and it doesnt seem to be too complicated.

Ui-wise maybe something like that:
image

@megalon megalon added the enhancement New feature or request label Apr 9, 2019
@megalon
Copy link
Member

megalon commented Apr 9, 2019

Yes, I would be interested in this feature, but haven't really looked into it.
Would it persist between updates of the Mod Manager?
Since each version is a standalone exe, would you need to "register" it each time?

@Splamy
Copy link
Author

Splamy commented Apr 9, 2019

The way in windows would be to create a registry entry Computer\HKEY_CLASSES_ROOT\modsaber\shell\open\command and set the path to the exe into it.
This means it would persist after each update, but when you move the exe somewhere else it would break.
My solution for this would be to check on startup in the config if the 'register onclick' was enabled and check if the path is correct, otherwise update it. This way fixing the link after moving the exe would just require the program to start once.

On linux, I don't have that much experience, but it should be similar but with a '.destop' file instead of a registry entry.

@megalon
Copy link
Member

megalon commented Apr 10, 2019

That sounds good to me.
I'll accept the PR if you can get it to work for Windows.

@Assistant
Copy link
Collaborator

I'd prefer if you used a different URI for it, though.

@Splamy
Copy link
Author

Splamy commented Apr 10, 2019

@Assistant could you explain what you mean with that?
Do you mean the protocol modsaber://?
Using a different or even multiple protocols would be no problem implementing, however someone would have to get in contact with a maintainer of beatsaver.com to change it on the website.

@Assistant
Copy link
Collaborator

Yes, that's what I mean. I'm the current owner of beatsaver.com so that won't be an issue.

@Splamy
Copy link
Author

Splamy commented Apr 10, 2019

Sure, how about simply beatsaver://? Or just make a suggestion and I can change it in my pr

@Assistant
Copy link
Collaborator

BeatDrop will have a similar feature and will use beatdrop://download/967-650, so using that and allowing the user to pick would be the best, imo.

@Splamy
Copy link
Author

Splamy commented Apr 10, 2019

Interesting, do you know if (or how) this scheme also applies to the avatar, platforms and sabers urls like modsaber://avatar/https://modelsaber.com/files/avatar/1553498853/Gnoll.avatar

@Assistant
Copy link
Collaborator

BeatDrop doesn't support ModelSaber one click installs yet, so we can come up with a standard and I can tell the programmer to use that.

@Splamy
Copy link
Author

Splamy commented Apr 10, 2019

Some suggestions

Var A:

  • Just modsaber as beatdrop protocol
beatdrop://avatar/https://modelsaber.com/files/avatar/1553498853/Gnoll.avatar
beatdrop://saber/https://modelsaber.com/files/saber/1553559541/Hestia%20Sword.saber
beatdrop://platform/https://modelsaber.com/files/platform/1553212170/Arch.plat

Var B:

  • short
  • somewhat more consistent with beatdrop://download/967-650
beatdrop://avatar/1553498853/Gnoll.avatar
beatdrop://saber/1553559541/Hestia%20Sword.saber
beatdrop://platform/1553212170/Arch.plat

(the part after the id could be omitted and inferred, but would need an additional request to the modelsaber api afaik)

Var C:

  • decentralized, allows other websites to provide such files
beatdrop://avatar?url=https://modelsaber.com/files/avatar/1553498853/Gnoll.avatar
beatdrop://saber?url=https://modelsaber.com/files/saber/1553559541/Hestia%20Sword.saber
beatdrop://platform?url=https://modelsaber.com/files/platform/1553212170/Arch.plat

Variant B seems the most reasonable to me.

@Assistant
Copy link
Collaborator

A and C are functionally the same, aren't they? It was designed that way with the full URL so that it would be decentralized.

I like option B. Would registering multiple protocols be a hassle? I'll see what the BeatDrop dev has to say about making it be modelsaber://

@Splamy
Copy link
Author

Splamy commented Apr 10, 2019

A and C are functionally the same, aren't they?

Hm, haha yes, I guess I'm too tired to think properly anymore

I've also thought about adding another protocol for modelsabel, my thought was like model_avatar://, .. for each, but that seems like too much clutter. But I like the modelsaber:// approach as it more or less ties the protocol to the website 'beatsaver:beatdrop' and 'modelsaber:modelsaber'

Btw, I rewrote the code in my pr a bit; It now supports the old modsaber protocol, the new beatdrop and is extensible for adding/removing protocols without much effort.

@Assistant
Copy link
Collaborator

I played with the idea to separate the BeatSaver protocol from BeatDrop, but I think that BeastSaber will also use it, so it doesn't make much sense to name it beatsaver://.

By the way, does your PR handle ModelSaber installations? I could change it to the new format so you can test it if you'd like.

@Splamy
Copy link
Author

Splamy commented Apr 10, 2019

I currently added modsaber:// with song,avatar,platform,saber and beatdrop:// with songs only, as I didn't know yet which variant we would take.
You can swap it and I can check it tomorow; (it's really late here and I'm not at my pc anymore)

And I actually think beatsaver:// could make sense. The protocol specifies what data it gives not which program shoud read it. It's kinda like mailto:, the website gives you a mail and you choose what email program you want to use. Same here with songs and models

@Splamy
Copy link
Author

Splamy commented Apr 11, 2019

Ok, I quickly updated the code. It now supports all modsaber:// (until all links are changed), beatdrop:// for songs and preliminary all model types too (treats them like modelsaber), and modelsabel:// with all model types. For now I have implemented uri parsing as in variant B.

@Assistant
Copy link
Collaborator

Just went ahead and updated ModelSaber to use modelsaber:// with variant B.

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

No branches or pull requests

3 participants