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

CurseForge URL handling #981

Merged
merged 20 commits into from Aug 17, 2023
Merged

Conversation

Ryex
Copy link
Contributor

@Ryex Ryex commented Apr 7, 2023

This is a modernizing of #465

it is based off of #961 to take advantage of the substep progress (and so I won't have to modify it once #961 is merged)

Does the CF curseforge:// url scheme handling on the import page so that the Pack name is detected and the extra info for metadata can be be passed along just as if it was imported form the FlamePage class.

EDIT: With the latest revisions this PR also fixes a bug where mod which contained internal resource or data packs would be identified as a resource or datapack instead of a mod.

launcher/tasks/Task.cpp Fixed Show fixed Hide fixed
launcher/tasks/ConcurrentTask.cpp Fixed Show fixed Hide fixed
@flowln flowln added the blocked Blocked until another PR is merged label Apr 8, 2023
timoreo22 and others added 4 commits May 5, 2023 15:05
Signed-off-by: timoreo <contact@timoreo.fr>
Signed-off-by: timoreo <contact@timoreo.fr>
Signed-off-by: timoreo <contact@timoreo.fr>
refactor: Move curseforge:// url scheme detection to Import Page
feat: pass along extra CF pack info so pack metadata is established.

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
@Ryex
Copy link
Contributor Author

Ryex commented May 12, 2023

No longer blocked

@Scrumplex Scrumplex removed the blocked Blocked until another PR is merged label May 12, 2023
@Scrumplex Scrumplex changed the title Curseforge url handleing CurseForge URL handling May 12, 2023
launcher/Application.cpp Outdated Show resolved Hide resolved
launcher/Application.cpp Outdated Show resolved Hide resolved
launcher/Application.cpp Outdated Show resolved Hide resolved
launcher/InstanceImportTask.cpp Outdated Show resolved Hide resolved
launcher/InstanceImportTask.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/modplatform/ImportPage.cpp Outdated Show resolved Hide resolved
Ryex and others added 2 commits May 12, 2023 01:47
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
@DioEgizio
Copy link
Member

doesn't work for resourcepacks and mods

Ryex added 2 commits May 15, 2023 16:34
…port.

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
@Ryex
Copy link
Contributor Author

Ryex commented May 15, 2023

doesn't work for resourcepacks and mods

I wasn't thinking about it. but there, now it does :P

as a side effect it now pre-downloads remote resources and attempts to identify them before import just as if they were local resources.

launcher/ui/MainWindow.cpp Fixed Show fixed Hide fixed
@@ -50,45 +49,47 @@
class ImportPage;
class FlamePage;

class NewInstanceDialog : public QDialog, public BasePageProvider
{
class NewInstanceDialog : public QDialog, public BasePageProvider {

Check notice

Code scanning / CodeQL

Undisciplined multiple inheritance Note

Multiple inheritance should not be used with 1 interfaces, 0 private implementations, 0 protected implementations, and 1 public implementations.
launcher/ui/MainWindow.cpp Outdated Show resolved Hide resolved
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
@Ryex Ryex requested a review from Scrumplex May 27, 2023 19:35
launcher/ui/MainWindow.cpp Outdated Show resolved Hide resolved
launcher/ui/MainWindow.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/modplatform/ImportPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/modplatform/ImportPage.cpp Show resolved Hide resolved
@flowln flowln added bug Something isn't working enhancement New feature or request labels May 28, 2023
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
@TheKodeToad TheKodeToad added the changelog:added A PR that appears under "Added" in the changelog label Jul 30, 2023
@Scrumplex Scrumplex changed the base branch from develop to staging August 4, 2023 18:24
launcher/ui/MainWindow.cpp Outdated Show resolved Hide resolved
@TheKodeToad
Copy link
Member

Ready to review?

@Scrumplex Scrumplex changed the base branch from staging to develop August 12, 2023 08:53
@Scrumplex Scrumplex changed the base branch from develop to staging August 12, 2023 08:54
@Scrumplex
Copy link
Member

When using this to install a CurseForge mod, it seems like it doesn't store mod metadata:

Example mod (AppleSkin for Fabric 1.20): curseforge://install?addonId=248787&fileId=4573208

Launcher log
     0.100 D | <> Main window shown.
     0.100 D | <> Importing from url: QList(QUrl("curseforge://install?addonId=248787&fileId=4573208"))
     0.100 D | Processing QUrl("curseforge://install?addonId=248787&fileId=4573208")
     0.102 D | [qt6ct]: palette support is disabled
     0.199 D | Setting up api download
     0.208 D | Dir changed: "/media/DATA/Projects/PrismLauncher/PrismLauncher/install/translations"
     0.272 D | Returned CFURL Json:
 {"data":{"id":4573208,"gameId":432,"modId":248787,"isAvailable":true,"displayName":"appleskin-fabric-mc1.20-2.5.0.jar","fileName":"appleskin-fabric-mc1.20-2.5.0.jar","releaseType":2,"fileStatus":4,"hashes":[{"value":"f01bcf9adbaaeb5f6b185864c0b879e8e3923991","algo":1},{"value":"9cb6542d471672c9f1131c5cb68a36f3","algo":2}],"fileDate":"2023-06-08T07:37:50.68Z","fileLength":1063094,"downloadCount":23790,"downloadUrl":"https://edge.forgecdn.net/files/4573/208/appleskin-fabric-mc1.20-2.5.0.jar","gameVersions":["Fabric","1.20","1.20.1"],"sortableGameVersions":[{"gameVersionName":"Fabric","gameVersionPadded":"0","gameVersion":"","gameVersionReleaseDate":"2022-09-01T00:00:00Z","gameVersionTypeId":68441},{"gameVersionName":"1.20","gameVersionPadded":"0000000001.0000000020","gameVersion":"1.20","gameVersionReleaseDate":"2023-06-07T00:00:00Z","gameVersionTypeId":75125},{"gameVersionName":"1.20.1","gameVersionPadded":"0000000001.0000000020.0000000001","gameVersion":"1.20.1","gameVersionReleaseDate":"2023-06-12T14:26:38.477Z","gameVersionTypeId":75125}],"dependencies":[{"modId":306612,"relationType":3},{"modId":306612,"relationType":3}],"alternateFileId":0,"isServerPack":false,"fileFingerprint":1922629205,"modules":[{"name":"META-INF","fingerprint":1294400590},{"name":"LICENSE_appleskin-fabric","fingerprint":589621802},{"name":"assets","fingerprint":1303586888},{"name":"fabric.mod.json","fingerprint":3884073684},{"name":"pack.mcmeta","fingerprint":2520837536},{"name":"appleskin.mixins.json","fingerprint":3682194994},{"name":"appleskin-fabric-refmap.json","fingerprint":522741154},{"name":"squeek","fingerprint":3021335357}]}}
     0.273 D | Setting up api download
     0.284 D | Got translations index!
     0.284 D | Dir changed: "/media/DATA/Projects/PrismLauncher/PrismLauncher/install/translations"
     0.287 D | Finished loading RSS feed.
     0.289 D | Loaded news entry "[MALWARE WARNING] RCE Vulnerability on some modded servers - Bleeding Pipe"
     0.289 D | Loaded news entry "Prism Launcher Release 7.2, now available"
     0.289 D | Loaded news entry "Prism Launcher Release 7.1, now available"
     0.290 D | Loaded news entry "Prism Launcher Release 7.0, now available"
     0.290 D | Loaded news entry "FTB Modpack Downloading Removal."
     0.290 D | Loaded news entry "[MALWARE WARNING] \"fractureiser\" malware in many popular Minecraft mods and modpacks"
     0.290 D | Loaded news entry "[SECURITY UPDATE] Prism Launcher Release 6.3, now available"
     0.290 D | Loaded news entry "Prism Launcher Release 6.2, now available"
     0.290 D | Loaded news entry "Prism Launcher Release 6.1, now available"
     0.290 D | Loaded news entry "Prism Launcher Release 6.0, now available"
     0.290 D | Loaded news entry "Prism Launcher Release 5.2, now available"
     0.290 D | Loaded news entry "Prism Launcher Release 5.1, now available"
     0.290 D | Loaded news entry "Prism Launcher Release 5.0, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.4.2, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.4.1, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.4.0, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.3.2, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.3.1, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.3.0, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.2.2, now available (CurseForge Hotfix)"
     0.290 D | Loaded news entry "PolyMC Update 1.2.1, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.2.0, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.1.1, now available"
     0.290 D | Loaded news entry "PolyMC Update 1.1.0, now available"
     0.290 D | Loaded news entry "Moving on"
     0.290 D | Loaded news entry "Modrinth support and Mod downloading"
     0.290 D | Loaded news entry "New maintainers and step down."
     0.290 D | News loading succeeded.
     0.892 D | "appleskin-fabric-mc1.20-2.5.0.jar" is a mod
     2.376 D | Adding resource "/media/DATA/Projects/PrismLauncher/PrismLauncher/install/cache/edge.forgecdn.net/files/4573/208/appleskin-fabric-mc1.20-2.5.0.jar" to "1.20.1(1)"
     2.376 D | Installing:  "/media/DATA/Projects/PrismLauncher/PrismLauncher/install/cache/edge.forgecdn.net/files/4573/208/appleskin-fabric-mc1.20-2.5.0.jar"
     4.853 D | Component list save performed now for "1.20.1"

@TheKodeToad
Copy link
Member

It doesn't when importing via any other method either

@Scrumplex
Copy link
Member

It doesn't when importing via any other method either

I mean importing a mod, not a modpack. I would expect it to work like the built-in mod browser and add metadata about its source.

@Trial97
Copy link
Member

Trial97 commented Aug 12, 2023

Can we have it as a separate issue?
As this should solve the basic requirements of installing using the link right?

@Trial97 Trial97 changed the base branch from staging to develop August 15, 2023 08:49
 into curseforge-url-handle3

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
@Scrumplex Scrumplex merged commit 85f36eb into PrismLauncher:develop Aug 17, 2023
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog:added A PR that appears under "Added" in the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants