From c218b813c0b61b84a07da8a9d25d91ba802a9122 Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Sat, 13 May 2023 07:11:15 +0000 Subject: [PATCH] Fixed default value resolution for Modrinth/GitHub --- src/platforms/github/github-uploader.ts | 11 ++++++----- src/platforms/modrinth/modrinth-uploader.ts | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/platforms/github/github-uploader.ts b/src/platforms/github/github-uploader.ts index ef90e73..8d030fb 100644 --- a/src/platforms/github/github-uploader.ts +++ b/src/platforms/github/github-uploader.ts @@ -1,9 +1,10 @@ -import { GitHubUploadRequest as UploadRequest, GitHubUploadReport as UploadReport } from "@/action"; +import { GitHubUploadReport as UploadReport, GitHubUploadRequest as UploadRequest } from "@/action"; import { GenericPlatformUploader, GenericPlatformUploaderOptions } from "@/platforms/generic-platform-uploader"; import { PlatformType } from "@/platforms/platform-type"; -import { GitHubContext } from "./github-context"; import { ArgumentNullError } from "@/utils/errors"; +import { VersionType } from "@/utils/versioning"; import { GitHubApiClient } from "./github-api-client"; +import { GitHubContext } from "./github-context"; import { GitHubRelease } from "./github-release"; /** @@ -70,7 +71,7 @@ export class GitHubUploader extends GenericPlatformUploader ({ id: x.id, name: x.name, url: x.url })), + files: release.assets.map(x => ({ id: x.id, name: x.name, url: x.browser_download_url })), }; } @@ -104,9 +105,9 @@ export class GitHubUploader extends GenericPlatformUploader { const api = new ModrinthApiClient({ token: request.token.unwrap() }); + const unfeatureMode = request.unfeatureMode ?? request.featured ? ModrinthUnfeatureMode.SUBSET : ModrinthUnfeatureMode.NONE; const project = await this.getProject(request.id, api); const version = await this.createVersion(request, project, api); - await this.unfeaturePreviousVersions(version, request.unfeatureMode, api); + await this.unfeaturePreviousVersions(version, unfeatureMode, api); return { id: project.id,