From 55fd1ba43cbaae4d03bfb284c4c9cbf1a50d4737 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 1 Jul 2023 13:17:08 -0400 Subject: [PATCH] Add links to the app info in web app --- CHANGELOG.md | 4 +++ playlet-web/src/lib/ScreenInfo.svelte | 36 ++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b59f5eb..cab4f410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- links to the app info in web app + ### Fixed - Video duration formatting in cast dialog diff --git a/playlet-web/src/lib/ScreenInfo.svelte b/playlet-web/src/lib/ScreenInfo.svelte index 2fc45e5b..6d640907 100644 --- a/playlet-web/src/lib/ScreenInfo.svelte +++ b/playlet-web/src/lib/ScreenInfo.svelte @@ -14,6 +14,26 @@ id: "App ID", }; + function transformValue(key, value) { + switch (key) { + case "version": + case "lib_version": + case "lib_version_latest": + return `${value}`; + case "lib_url": + return `${value}`; + case "git_commit_hash": + case "lib_git_commit_hash": + if (value === "unknown") { + return value; + } + return `${value}`; + default: + break; + } + return value; + } + let appInfo = {}; let deviceInfo = {}; let invidiousInfo = {}; @@ -52,13 +72,21 @@ ${JSON.stringify(invidiousInfo, null, 2)} \`\`\` ${JSON.stringify(preferencesInfo, null, 2)} \`\`\``; - return `https://github.com/iBicha/playlet/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`; + title = encodeURIComponent(title); + body = encodeURIComponent(body); + return `https://github.com/iBicha/playlet/issues/new?title=${title}&body=${body}`; }
- Thank you for using Playlet.
You have feedback? Let us know by creating an issue on Github. + Thank you for using Playlet.
You have feedback? Let us know by + creating an issue on Github.
@@ -72,10 +100,10 @@ ${JSON.stringify(preferencesInfo, null, 2)} {#each Object.entries(displayNames) as [key, value]} - + {/each}
{value}{appInfo[key]}{@html transformValue(key, appInfo[key])}
-
+