diff --git a/components/navigation/LinksContainer.vue b/components/navigation/LinksContainer.vue index 04941e8..521d16d 100644 --- a/components/navigation/LinksContainer.vue +++ b/components/navigation/LinksContainer.vue @@ -7,7 +7,7 @@ let urls = new Map(); for (let type of projectTypeList) { const urlList = [ {title: "Downloads", url: `/${type}/downloads`}, - {title: "Versions", url: `/${type}/counts`}, + {title: "Versions", url: `/${type}/versions`}, ] urls.set(type, urlList) diff --git a/pages/[type]/counts.vue b/pages/[type]/versions.vue similarity index 89% rename from pages/[type]/counts.vue rename to pages/[type]/versions.vue index 1cac85c..8f36989 100644 --- a/pages/[type]/counts.vue +++ b/pages/[type]/versions.vue @@ -14,6 +14,6 @@ Each version will be counted separately for every loader or game-version it supp \ No newline at end of file diff --git a/server/api/stats.ts b/server/api/stats.ts index d2cc237..c197ccf 100644 --- a/server/api/stats.ts +++ b/server/api/stats.ts @@ -7,8 +7,8 @@ export default defineEventHandler(async (event): Promise => { let mode = query.mode as string; let type = query.type as ProjectTypes; - if (query.stat == "count") { - return exportStats(mode, type, value => value.count) + if (query.stat == "versions") { + return exportStats(mode, type, value => value.versions) } else { return exportStats(mode, type, value => value.downloads) } diff --git a/server/utils/statistics.ts b/server/utils/statistics.ts index dc07532..81516e9 100644 --- a/server/utils/statistics.ts +++ b/server/utils/statistics.ts @@ -139,7 +139,7 @@ function onlyMinorVersions(gameVersions: GameVersion[], all: Stats): { continue } - loader.values[index].count += stats[0].count + loader.values[index].versions += stats[0].versions loader.values[index].downloads += stats[0].downloads } @@ -177,7 +177,7 @@ function onlyMajorVersions(gameVersions: GameVersion[], all: Stats): Stats { for (let loader of downloads.data) { let stats = loader.values.splice(index, 1); - loader.values[index].count += stats[0].count + loader.values[index].versions += stats[0].versions loader.values[index].downloads += stats[0].downloads } @@ -210,7 +210,7 @@ function StatsFromData(versions: GameVersion[], data: StatsData): Stats { downloads = downloads.map((value) => { return { downloads: Math.round(value.downloads), - count: value.count + versions: value.count } }) diff --git a/server/utils/types/stats.ts b/server/utils/types/stats.ts index e947af5..075fc25 100644 --- a/server/utils/types/stats.ts +++ b/server/utils/types/stats.ts @@ -6,4 +6,4 @@ export type Stats = { }[] } -export type StatsValue = { downloads: number, count: number } \ No newline at end of file +export type StatsValue = { downloads: number, versions: number } \ No newline at end of file