From 9acfc490f095eb8df9ffdb2d28ac5d02ff22d898 Mon Sep 17 00:00:00 2001 From: skidoodle Date: Thu, 10 Oct 2024 18:35:02 +0200 Subject: [PATCH] +Seeding count --- data/data.json | 11 ----------- index.html | 35 +++++++++++++++++++++-------------- main.go | 40 ++++++++++++++++++++++++++++++---------- profiles.json | 4 +--- 4 files changed, 52 insertions(+), 38 deletions(-) delete mode 100644 data/data.json diff --git a/data/data.json b/data/data.json deleted file mode 100644 index 10f31ea..0000000 --- a/data/data.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "owner": "displayName", - "timestamp": "2024-10-10T17:30:21.0999256+02:00", - "rank": "", - "upload": "", - "current_upload": "", - "current_download": "", - "points": "" - } -] diff --git a/index.html b/index.html index 1d4cb8f..bb92143 100644 --- a/index.html +++ b/index.html @@ -151,16 +151,17 @@

${owner}

-
-

Rank: ${latestRecord.rank}

-

Upload: ${latestRecord.upload}

-

Current Upload: ${latestRecord.current_upload}

-

Current Download: ${latestRecord.current_download}

-

Points: ${latestRecord.points}

-
- - ` +

${owner}

+
+

Rank: ${latestRecord.rank}

+

Upload: ${latestRecord.upload}

+

Current Upload: ${latestRecord.current_upload}

+

Current Download: ${latestRecord.current_download}

+

Points: ${latestRecord.points}

+

Seeding Count: ${latestRecord.seeding_count}

+
+ + ` profilesDiv.appendChild(profileCard) } @@ -201,7 +202,7 @@

new Date(record.timestamp).toLocaleDateString() ) - const rankData = profileHistory.map(record => parseFloat(record.rank)) + const rankData = profileHistory.map(record => record.rank) const uploadData = profileHistory.map(record => parseStorageValue(record.upload) ) @@ -211,9 +212,9 @@

parseSpeedValue(record.current_download) ) - const pointsData = profileHistory.map(record => - parseFloat(record.points) - ) + const pointsData = profileHistory.map(record => record.points) + + const seedingCount = profileHistory.map(record => record.seeding_count) const chartData = { labels: labels, @@ -248,6 +249,12 @@

1 { + fmt.Sscanf(matches[1], "%d", &profile.SeedingCount) } }) diff --git a/profiles.json b/profiles.json index 07d39cb..0967ef4 100644 --- a/profiles.json +++ b/profiles.json @@ -1,3 +1 @@ -{ - "displayName": "userId" -} +{}