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 mod downloads fail when .download.url is present in .pw.toml file but contains an empty string #77

Open
LadyAelita opened this issue Apr 22, 2024 · 0 comments

Comments

@LadyAelita
Copy link

For example, the following works:

filename = 'betterfpsdist-1.19.2-4.1.jar'
name = 'betterfpsdist mod'
side = 'both'

[download]
hash = '0dc6528d4e9208221485bc8fa6e0e5fdf427364e'
hash-format = 'sha1'
mode = 'metadata:curseforge'

[update.curseforge]
file-id = 5100224
project-id = 551520

But this produces an error:

filename = 'betterfpsdist-1.19.2-4.1.jar'
name = 'betterfpsdist mod'
side = 'both'

[download]
hash = '0dc6528d4e9208221485bc8fa6e0e5fdf427364e'
hash-format = 'sha1'
mode = 'metadata:curseforge'
url = ''

[update.curseforge]
file-id = 5100224
project-id = 551520
java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no scheme was found for 
	at okhttp3.HttpUrl$Builder.parse$okhttp(SourceFile:1261)
	at okhttp3.HttpUrl$Companion.get(SourceFile:1634)
	at link.infra.packwiz.installer.metadata.ModFile$Download$Companion$mapper$lambda-1$$inlined$decoder$1.invoke(SourceFile:223)
	at link.infra.packwiz.installer.metadata.ModFile$Download$Companion$mapper$lambda-1$$inlined$decoder$1.invoke(SourceFile:178)
	at link.infra.packwiz.installer.metadata.ModFile$Download$Companion$mapper$lambda-1$$inlined$decoder$2.invoke(SourceFile:153)
	at link.infra.packwiz.installer.metadata.ModFile$Download$Companion$mapper$lambda-1$$inlined$decoder$2.invoke(SourceFile:149)
	at cc.ekblad.toml.transcoding.TomlDecoder$decoderFor$1$1.invoke(SourceFile:48)
	at cc.ekblad.toml.transcoding.TomlDecoder$decoderFor$1$1.invoke(SourceFile:45)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.decode(SourceFile:72)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.toDataClass(SourceFile:172)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.toObject(SourceFile:131)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.decode(SourceFile:79)
	at cc.ekblad.toml.TomlMapper.decode(SourceFile:69)
	at link.infra.packwiz.installer.metadata.ModFile$Companion$mapper$lambda-1$$inlined$delegateTransitive$7.invoke(SourceFile:224)
	at link.infra.packwiz.installer.metadata.ModFile$Companion$mapper$lambda-1$$inlined$delegateTransitive$7.invoke(SourceFile:178)
	at link.infra.packwiz.installer.util._4KDelegationKt$delegateTransitive$$inlined$decoder$2.invoke(SourceFile:153)
	at link.infra.packwiz.installer.util._4KDelegationKt$delegateTransitive$$inlined$decoder$2.invoke(SourceFile:149)
	at cc.ekblad.toml.transcoding.TomlDecoder$decoderFor$1$1.invoke(SourceFile:48)
	at cc.ekblad.toml.transcoding.TomlDecoder$decoderFor$1$1.invoke(SourceFile:45)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.decode(SourceFile:72)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.toDataClass(SourceFile:172)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.toObject(SourceFile:131)
	at cc.ekblad.toml.transcoding.TomlDecoderKt.decode(SourceFile:79)
	at cc.ekblad.toml.TomlMapper.decode(SourceFile:69)
	at link.infra.packwiz.installer.metadata.IndexFile$File.downloadMeta(SourceFile:99)
	at link.infra.packwiz.installer.DownloadTask.downloadMetadata(SourceFile:110)
	at link.infra.packwiz.installer.UpdateManager.processIndex$lambda-9(SourceFile:300)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)
	at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

I would like it if Packwiz Installer skipped .download.url if it's equal to "", treating it as if it was null/undefined. Prism Launcher generates CurseForge metadata files with url = '', and it would be super inconvenient to have to pre-process all those files and drop the url = '' lines.

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