From b11dbbd6d801a67e6dedff8a967b5a14d4f11afd Mon Sep 17 00:00:00 2001 From: Rick van Lieshout Date: Sun, 11 Feb 2024 22:42:45 +0100 Subject: [PATCH] - More Discord options: - Added the ability to hide the current song from the discord activity and display a custom text instead - Added the ability to customize the text that is shown when no song is playing - Discord now reacts to pausing/unpausing events - Refactored media info updates so it only updates the required info, fixes #342, #306 - Added 5.9.0 logs/versions/migrations --- CHANGELOG.md | 9 +++ package.json | 2 +- src/constants/settings.ts | 2 +- src/pages/settings/preload.ts | 8 +- src/pages/settings/settings.html | 10 +-- src/preload.ts | 121 +++++++++++++++++-------------- src/scripts/discord.ts | 91 ++++++++++++++--------- src/scripts/settings.ts | 35 ++++++++- 8 files changed, 172 insertions(+), 106 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 248b23d..8cb8db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.9.0] + +- More Discord options: + - Added the ability to hide the current song from the discord activity and display a custom text instead + - Added the ability to customize the text that is shown when no song is playing + - Discord now reacts to pausing/unpausing events +- Refactored media info updates so it only updates the required info, fixes #342, #306 +- Added 5.9.0 logs/versions/migrations + ## [5.8.0] - Updated Electron to 28.1.1 (fixes [325](https://github.com/Mastermindzh/tidal-hifi/issues/325)) diff --git a/package.json b/package.json index b4334b6..dcd47b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidal-hifi", - "version": "5.8.0", + "version": "5.9.0", "description": "Tidal on Electron with widevine(hifi) support", "main": "ts-dist/main.js", "scripts": { diff --git a/src/constants/settings.ts b/src/constants/settings.ts index 43c5d97..c435f76 100644 --- a/src/constants/settings.ts +++ b/src/constants/settings.ts @@ -26,7 +26,7 @@ export const settings = { includeTimestamps: "discord.includeTimestamps", showSong: "discord.showSong", idleText: "discord.idleText", - listeningText: "discord.listeningText", + usingText: "discord.usingText", }, ListenBrainz: { root: "ListenBrainz", diff --git a/src/pages/settings/preload.ts b/src/pages/settings/preload.ts index 53bfc98..c8573e5 100644 --- a/src/pages/settings/preload.ts +++ b/src/pages/settings/preload.ts @@ -57,7 +57,7 @@ let adBlock: HTMLInputElement, discord_button_text: HTMLInputElement, discord_show_song: HTMLInputElement, discord_idle_text: HTMLInputElement, - discord_listening_text: HTMLInputElement; + discord_using_text: HTMLInputElement; addCustomCss(app); @@ -148,7 +148,7 @@ function refreshSettings() { discord_button_text.value = settingsStore.get(settings.discord.buttonText); discord_show_song.checked = settingsStore.get(settings.discord.showSong); discord_idle_text.value = settingsStore.get(settings.discord.idleText); - discord_listening_text.value = settingsStore.get(settings.discord.listeningText); + discord_using_text.value = settingsStore.get(settings.discord.usingText); // set state of all switches with additional settings Object.values(switchesWithSettings).forEach((settingSwitch) => { @@ -263,7 +263,7 @@ window.addEventListener("DOMContentLoaded", () => { listenbrainz_delay = get("listenbrainz_delay"); discord_button_text = get("discord_button_text"); discord_show_song = get("discord_show_song"); - discord_listening_text = get("discord_listening_text"); + discord_using_text = get("discord_using_text"); discord_idle_text = get("discord_idle_text") refreshSettings(); @@ -301,5 +301,5 @@ window.addEventListener("DOMContentLoaded", () => { addInputListener(discord_button_text, settings.discord.buttonText); addInputListener(discord_show_song, settings.discord.showSong, switchesWithSettings.discord_show_song); addInputListener(discord_idle_text, settings.discord.idleText); - addInputListener(discord_listening_text, settings.discord.listeningText); + addInputListener(discord_using_text, settings.discord.usingText); }); diff --git a/src/pages/settings/settings.html b/src/pages/settings/settings.html index 41033ce..f9b521a 100644 --- a/src/pages/settings/settings.html +++ b/src/pages/settings/settings.html @@ -227,9 +227,9 @@
-

Listening Text

-

The text displayed on Discord's rich presence while listening to a song.

- +

Using Tidal Text

+

The text displayed on Discord's rich presence while "showSong" is turned off

+
@@ -432,7 +432,7 @@ tidal icon

TIDAL Hi-Fi

- 5.8.0 + 5.9.0