From 5f136451224aa73e1b970d627275b432af59c116 Mon Sep 17 00:00:00 2001 From: Kallum Jones Date: Wed, 3 Aug 2022 20:52:23 +0100 Subject: [PATCH] Add versions to Mod type --- src/mods/{mod.ts => mod.d.ts} | 1 + src/mods/sources/modrinth_source.ts | 2 ++ 2 files changed, 3 insertions(+) rename src/mods/{mod.ts => mod.d.ts} (85%) diff --git a/src/mods/mod.ts b/src/mods/mod.d.ts similarity index 85% rename from src/mods/mod.ts rename to src/mods/mod.d.ts index b08c1e7..282b553 100644 --- a/src/mods/mod.ts +++ b/src/mods/mod.d.ts @@ -3,6 +3,7 @@ declare global { id: string name: string fileName: string, + version: string source: string, } } diff --git a/src/mods/sources/modrinth_source.ts b/src/mods/sources/modrinth_source.ts index 2277b35..d8e158b 100644 --- a/src/mods/sources/modrinth_source.ts +++ b/src/mods/sources/modrinth_source.ts @@ -146,6 +146,7 @@ export default class ModrinthSource implements ModSource { const fileName = latestFile.filename; const url = latestFile.url; + const modVersion = results[0].version_number; const task: DownloadTask = { fileName: fileName, @@ -159,6 +160,7 @@ export default class ModrinthSource implements ModSource { name: await this.getProjectName(id), id: id, fileName: fileName, + version: modVersion, source: this.getSourceName() };