mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
feat: curseforge modpack downloading via binaryname:// uri (#4872)
This commit is contained in:
commit
662a448080
1 changed files with 11 additions and 1 deletions
|
|
@ -947,10 +947,20 @@ void MainWindow::processURLs(QList<QUrl> urls)
|
|||
(url.path().startsWith("/import", Qt::CaseInsensitive));
|
||||
|
||||
QUrl dl_url;
|
||||
if (url.scheme() == "curseforge") {
|
||||
if (url.scheme() == "curseforge" || (url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME && url.host() == "install")) {
|
||||
// need to find the download link for the modpack / resource
|
||||
// format of url curseforge://install?addonId=IDHERE&fileId=IDHERE
|
||||
// format of url binaryname://install?platform=curseforge&addonId=IDHERE&fileId=IDHERE
|
||||
QUrlQuery query(url);
|
||||
|
||||
// check if this is a binaryname:// url
|
||||
if (url.scheme() == BuildConfig.LAUNCHER_APP_BINARY_NAME) {
|
||||
// check this is an curseforge platform request
|
||||
if (query.queryItemValue("platform").toLower() != "curseforge") {
|
||||
qDebug() << "Invalid mod distribution platform:" << query.queryItemValue("platform");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (query.allQueryItemValues("addonId").isEmpty() || query.allQueryItemValues("fileId").isEmpty()) {
|
||||
qDebug() << "Invalid curseforge link:" << url;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue