diff --git a/index.js b/index.js
index df08653..50569ee 100644
--- a/index.js
+++ b/index.js
@@ -52,10 +52,10 @@ if (!fs.existsSync(path.join(cachePath, "emojis"))) {
app.use(pageUpdater.middleWare)
-process.on('uncaughtException', (err, origin) => {
- fs.writeSync(
- process.stderr.fd,
- `Caught exception: ${err}\n` +
- `Exception origin: ${origin}`,
- );
- });
\ No newline at end of file
+// process.on('uncaughtException', (err, origin) => {
+// fs.writeSync(
+// process.stderr.fd,
+// `Caught exception: ${err}\n` +
+// `Exception origin: ${origin}`,
+// );
+// });
\ No newline at end of file
diff --git a/overcomplicatedStatuses.js b/overcomplicatedStatuses.js
index a429db7..bc7c6b8 100644
--- a/overcomplicatedStatuses.js
+++ b/overcomplicatedStatuses.js
@@ -1,5 +1,5 @@
const path = require("path"),
-fs = require("fs")
+ fs = require("fs")
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json')))
@@ -33,7 +33,7 @@ function makeCompat(string) {
}
function timeFormatter(seconds) {
- seconds = Math.ceil(seconds)
+ seconds = Math.ceil(seconds / 1000)
var minutes = Math.floor(seconds / 60)
if (seconds % 60 < 10) {
@@ -44,7 +44,7 @@ function timeFormatter(seconds) {
}
function gameTimeFormatter(seconds) {
- seconds = Math.ceil(seconds)
+ seconds = Math.ceil(seconds / 1000)
var minutes = Math.ceil(seconds / 60)
var hours = Math.floor(minutes / 60)
if (seconds <= 60) {
@@ -87,63 +87,47 @@ module.exports = {
continue
}
-
function get_img(activity, size = "large_image") {
return "https://cache.violets-purgatory.dev/cached/" + get_img_url(activity, size)
}
- function songStats() {
- var html = ``
-
- if (activity.assets && activity.assets.large_text != activity.details && activity.details.length + activity.state.length + activity.assets.large_text.length < 100) {
- html += `
-
Album: ${makeCompat(activity.assets.large_text || " ")}
-
Artist: ${makeCompat(activity.state || " ")}
- `
- } else {
- html += "
"
- if (activity.state.includes(";"))
- { html += "Artists: " }
- else { html += "Artist: " }
- html += `${makeCompat(activity.state || " ")}`
- }
-
- return html
- }
- if (activity.type == 2) {
- var timeLeft = Math.round((activity.timestamps.end - Date.now()) / 1000)
- var currentPercent = (Date.now() - activity.timestamps.start) / (activity.timestamps.end - activity.timestamps.start) * 100
- addedHTML += `
-
- Listening to ${activity.name}
-
Song: ${makeCompat(activity.details || " ")}
- ${songStats()}
+ function activityTime() {
+ if (activity.timestamps) {
+ if (activity.timestamps.start) {
+ if (activity.timestamps.end) {
+ var timeLeft = Math.round((activity.timestamps.end - Date.now()) / 1000)
+ var currentPercent = (Date.now() - activity.timestamps.start) / (activity.timestamps.end - activity.timestamps.start) * 100
+ return `
-
- ${timeFormatter((activity.timestamps.end - activity.timestamps.start) / 1000)}
-
- Playing ${activity.name}
- ${onlyIfExists("
" + (activity.details || activity.assets.large_text), activity.details || activity.assets.large_text)}
- ${onlyIfExists("
" + (activity.state || activity.assets.small_text), activity.state || activity.assets.small_text)}
-
${gameTimeFormatter((Date.now() - time) / 1000)}
-
- ${activity.name}
-
${(activity.details || activity.assets.large_text || " ")}
-
${(activity.state || activity.assets.small_text || " ")}
-
${gameTimeFormatter((Date.now() - time) / 1000)}
+
+ ${activity.name}
+ ${onlyIfExists("
" + text1, text1)}
+ ${onlyIfExists("
" + text2, text2)}
+ ${onlyIfExists("
" + text3, text3)}
+ ${onlyIfExists("
" + activityTime(), activityTime())}