From 76a6b14565827ca6b541750f6ebfd6aacccfc55e Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Mon, 2 May 2022 12:40:54 +0200 Subject: [PATCH 01/18] add hide timestamp to rpc code --- src/main/plugins/discordrpc.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index 92f613e3..460b57bc 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -223,10 +223,12 @@ export default class DiscordRPC { ] //To change attributes.url => preload/cider-preload.js } - // Add the timestamp if its playing - if (attributes.status) { - this._activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime) - this._activity.endTimestamp = attributes.endTime + // Add the timestamp if its playing and people want them + if (!this._utils.getStoreValue("general.discordrpc.hide_timestamp")) { + if (attributes.status) { + this._activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime) + this._activity.endTimestamp = attributes.endTime + } } // If the user wants to keep the activity when paused From b021f8d43a4c16e66c5849a591895cd01ccf780a Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Mon, 2 May 2022 12:42:16 +0200 Subject: [PATCH 02/18] add to store --- src/main/base/store.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/base/store.ts b/src/main/base/store.ts index 6741395c..5de4dc33 100644 --- a/src/main/base/store.ts +++ b/src/main/base/store.ts @@ -17,6 +17,7 @@ export class Store { "client": "Cider", "clear_on_pause": true, "hide_buttons": false, + "hide_timestamp": false, "state_format": "by {artist}", "details_format": "{title}", }, From f7f0db98bc12bbded5872e01195df1e2ed21709a Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Mon, 2 May 2022 12:47:12 +0200 Subject: [PATCH 03/18] add to en_us and source --- src/i18n/en_US.json | 1 + src/i18n/source/en_US.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 78413968..6236b726 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -427,6 +427,7 @@ "settings.option.connectivity.discordRPC.clientName": "Client Name", "settings.option.connectivity.discordRPC.clearOnPause": "Clear Discord Rich Presence on Pause", "settings.option.connectivity.discordRPC.hideButtons": "Hide buttons on Discord Rich Presence", + "settings.option.connectivity.discordRPC.hideTimestamp": "Hide timestamp on Discord Rich Presence", "settings.option.connectivity.discordRPC.detailsFormat": "Details Format", "settings.option.connectivity.discordRPC.stateFormat": "State Format", "settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling", diff --git a/src/i18n/source/en_US.json b/src/i18n/source/en_US.json index 71d7a3d8..6f0ce8f2 100644 --- a/src/i18n/source/en_US.json +++ b/src/i18n/source/en_US.json @@ -428,6 +428,7 @@ "settings.option.connectivity.discordRPC.clientName": "Client Name", "settings.option.connectivity.discordRPC.clearOnPause": "Clear Discord Rich Presence on Pause", "settings.option.connectivity.discordRPC.hideButtons": "Hide buttons on Discord Rich Presence", + "settings.option.connectivity.discordRPC.hideTimestamp": "Hide timestamp on Discord Rich Presence", "settings.option.connectivity.discordRPC.detailsFormat": "Details Format", "settings.option.connectivity.discordRPC.stateFormat": "State Format", "settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling", From c4acb794e64c735c08de136a85f9f74b11dd3883 Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Mon, 2 May 2022 12:48:54 +0200 Subject: [PATCH 04/18] add to hu_hu --- src/i18n/hu_HU.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n/hu_HU.json b/src/i18n/hu_HU.json index 55706b2c..ec5a97de 100644 --- a/src/i18n/hu_HU.json +++ b/src/i18n/hu_HU.json @@ -414,6 +414,7 @@ "settings.option.connectivity.discordRPC.clientName": "Kliensnév", "settings.option.connectivity.discordRPC.clearOnPause": "Rich Presence törlése megállításnál", "settings.option.connectivity.discordRPC.hideButtons": "Rich Presence gombok elrejtése", + "settings.option.connectivity.discordRPC.hideTimestamp": "Rich Presence visszaszámláló elrejtése", "settings.option.connectivity.discordRPC.detailsFormat": "Részletek formátuma", "settings.option.connectivity.discordRPC.stateFormat": "Állapot formátuma", "settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling", From 7566fe6743cbbc4f9843970274b746a0ac43f28b Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Sat, 7 May 2022 06:35:33 +0100 Subject: [PATCH 05/18] Fixed app version --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d7b5b75..44c7279f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,9 +15,6 @@ jobs: executor: cider-ci steps: - checkout - - run: - name: Set App Version - command: echo "export APP_VERSION=$(grep '"version":.*' package.json | cut -d '"' -f 4 | head -1)" >> $BASH_ENV # - run: # name: Rename Repository # command: sed -i 's/github:ciderapp\/Cider/github:ciderapp\/cider-releases/' package.json @@ -155,6 +152,9 @@ jobs: mv ~/Cider/dist/*.blockmap ~/Cider/dist/artifacts - store_artifacts: path: ~/Cider/dist/artifacts + - run: + name: Set App Version + command: echo "export APP_VERSION=$(grep '"version":.*' package.json | cut -d '"' -f 4 | head -1)" >> $BASH_ENV - run: name: Publish Release command: | From c2e768837fb91a4046e8bbe55bf1bee15852c2d9 Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Sat, 7 May 2022 20:39:39 +0200 Subject: [PATCH 06/18] Update discordrpc.ts --- src/main/plugins/discordrpc.ts | 316 ++++++++++++++------------------- 1 file changed, 132 insertions(+), 184 deletions(-) diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index 460b57bc..c943eb68 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -1,30 +1,29 @@ -import * as RPC from 'discord-rpc' +import {AutoClient} from 'discord-auto-rpc' import {ipcMain} from "electron"; import fetch from 'electron-fetch' export default class DiscordRPC { - /** - * Private variables for interaction in plugins - */ - private _utils: any; - private _app: any; - private _attributes: any; - private _connection: boolean = false; - /** * Base Plugin Details (Eventually implemented into a GUI in settings) */ public name: string = 'Discord Rich Presence'; public description: string = 'Discord RPC plugin for Cider'; - public version: string = '1.0.0'; + public version: string = '1.1.0'; public author: string = 'vapormusic/Core (Cider Collective)'; + /** + * Private variables for interaction in plugins + */ + private _utils: any; + private _attributes: any; + private ready: boolean = false; + /** * Plugin Initialization */ private _client: any = null; - private _activity: RPC.Presence = { + private _activityCache: any = { details: '', state: '', largeImageKey: '', @@ -34,15 +33,72 @@ export default class DiscordRPC { instance: false }; - private _activityCache: RPC.Presence = { - details: '', - state: '', - largeImageKey: '', - largeImageText: '', - smallImageKey: '', - smallImageText: '', - instance: false - }; + /******************************************************************************************* + * Public Methods + * ****************************************************************************************/ + + /** + * Runs on plugin load (Currently run on application start) + */ + constructor(utils: any) { + this._utils = utils; + console.debug(`[Plugin][${this.name}] Loading Complete.`); + } + + /** + * Runs on app ready + */ + onReady(_win: any): void { + const self = this + this.connect(); + console.debug(`[Plugin][${this.name}] Ready.`); + ipcMain.on('updateRPCImage', (_event, imageurl) => { + if (!this._utils.getStoreValue("general.privateEnabled")) { + fetch('https://api.cider.sh/v1/images', { + + method: 'POST', + body: JSON.stringify({url: imageurl}), + headers: { + 'Content-Type': 'application/json', + 'User-Agent': _win.webContents.getUserAgent() + }, + }) + .then(res => res.json()) + .then(function (json) { + self._attributes["artwork"]["url"] = json.url + self.setActivity(self._attributes) + }) + } + }) + } + + /** + * Runs on app stop + */ + onBeforeQuit(): void { + console.debug(`[Plugin][${this.name}] Stopped.`); + } + + /** + * Runs on playback State Change + * @param attributes Music Attributes (attributes.status = current state) + */ + onPlaybackStateDidChange(attributes: object): void { + this._attributes = attributes + this.setActivity(attributes) + + } + + /** + * Runs on song change + * @param attributes Music Attributes + */ + onNowPlayingItemDidChange(attributes: object): void { + this._attributes = attributes + this.setActivity(attributes) + + } + /******************************************************************************************* * Private Methods @@ -58,58 +114,86 @@ export default class DiscordRPC { } const clientId = this._utils.getStoreValue("general.discordrpc.client") === "Cider" ? '911790844204437504' : '886578863147192350'; - // Apparently needed for ask to join, join, spectate etc. - RPC.register(clientId) - // Create the client - this._client = new RPC.Client({transport: "ipc"}); + this._client = new AutoClient({transport: "ipc"}); // Runs on Ready - this._client.on('ready', () => { + this._client.once('ready', () => { console.info(`[DiscordRPC][connect] Successfully Connected to Discord. Authed for user: ${this._client.user.id}.`); + + if (this._activityCache && this._activityCache.details && this._activityCache.state) { + console.info(`[DiscordRPC][connect] Restoring activity cache.`); + this._client.setActivity(this._activityCache) + } }) - // Handles Errors - this._client.on('error', (err: any) => { - console.error(`[DiscordRPC] ${err}`); - this.disconnect() - }); - - // If Discord is closed, allow reconnecting - this._client.transport.once('close', () => { - console.info(`[DiscordRPC] Connection closed`); - this.disconnect() - }); - // Login to Discord - this._client.login({clientId}) + this._client.endlessLogin({clientId: clientId}) .then(() => { - this._connection = true; + this.ready = true }) .catch((e: any) => console.error(`[DiscordRPC][connect] ${e}`)); } /** - * Disconnects from Discord RPC + * Sets the activity + * @param attributes Music Attributes */ - private disconnect() { + private setActivity(attributes: any) { if (!this._client) { return } - this._client.destroy().then(() => { - this._connection = false; - console.log('[DiscordRPC][disconnect] Disconnected from discord.') - }).catch((e: any) => console.error(`[DiscordRPC][disconnect] ${e}`)); + // Check if show buttons is (true) or (false) + let activity: Object = { + details: this._utils.getStoreValue("general.discordrpc.details_format"), + state: this._utils.getStoreValue("general.discordrpc.state_format"), + largeImageKey: attributes?.artwork?.url?.replace('{w}', '1024').replace('{h}', '1024'), + largeImageText: attributes.albumName, + instance: false // Whether the activity is in a game session + } - // Clean up, allow creating a new connection - this._client = null; + // Filter the activity + activity = this.filterActivity(activity, attributes) + + if (!this.ready) { + this._activityCache = activity + return + } + + // Set the activity + if (!attributes.status && this._utils.getStoreValue("general.discordrpc.clear_on_pause")) { + this._client.clearActivity() + } else if (activity && this._activityCache !== activity) { + this._client.setActivity(activity) + } + this._activityCache = activity; } /** * Filter the Discord activity object */ - private static filterActivity(activity: any, attributes: any): Object { + private filterActivity(activity: any, attributes: any): Object { + + // Add the buttons if people want them + if (!this._utils.getStoreValue("general.discordrpc.hide_buttons")) { + activity.buttons = [ + {label: 'Listen on Cider', url: attributes.url.cider}, + {label: 'View on Apple Music', url: attributes.url.appleMusic} + ] //To change attributes.url => preload/cider-preload.js + } + + // Add the timestamp if its playing + if (attributes.status) { + activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime) + activity.endTimestamp = attributes.endTime + } + + // If the user wants to keep the activity when paused + if (!this._utils.getStoreValue("general.discordrpc.clear_on_pause")) { + activity.smallImageKey = attributes.status ? 'play' : 'pause'; + activity.smallImageText = attributes.status ? 'Playing' : 'Paused'; + } /** * Works with: @@ -173,140 +257,4 @@ export default class DiscordRPC { } return activity } - - /** - * Sets the activity - * @param {activity} activity - */ - private setActivity(activity: any) { - if (!this._connection || !this._client || !activity) { - return - } - - // Filter the activity - activity = DiscordRPC.filterActivity(activity, this._attributes) - - // Set the activity - if (!this._attributes.status && this._utils.getStoreValue("general.discordrpc.clear_on_pause")) { - this._client.clearActivity() - } else if (this._activity && this._activityCache !== this._activity && this._activity.details) { - this._client.setActivity(activity) - this._activityCache = this._activity; - } - } - - /** - * Sets the activity of the client - * @param {object} attributes - */ - private updateActivity(attributes: any) { - if (!this._utils.getStoreValue("general.discordrpc.enabled") || this._utils.getStoreValue("general.privateEnabled")) { - return - } else if (!this._client || !this._connection) { - this.connect() - } - - // Check if show buttons is (true) or (false) - this._activity = { - details: this._utils.getStoreValue("general.discordrpc.details_format"), - state: this._utils.getStoreValue("general.discordrpc.state_format"), - largeImageKey: attributes?.artwork?.url?.replace('{w}', '1024').replace('{h}', '1024'), - largeImageText: attributes.albumName, - instance: false // Whether the activity is in a game session - } - - // Add the buttons if people want them - if (!this._utils.getStoreValue("general.discordrpc.hide_buttons")) { - this._activity.buttons = [ - {label: 'Listen on Cider', url: attributes.url.cider}, - {label: 'View on Apple Music', url: attributes.url.appleMusic} - ] //To change attributes.url => preload/cider-preload.js - } - - // Add the timestamp if its playing and people want them - if (!this._utils.getStoreValue("general.discordrpc.hide_timestamp")) { - if (attributes.status) { - this._activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime) - this._activity.endTimestamp = attributes.endTime - } - } - - // If the user wants to keep the activity when paused - if (!this._utils.getStoreValue("general.discordrpc.clear_on_pause")) { - this._activity.smallImageKey = attributes.status ? 'play' : 'pause'; - this._activity.smallImageText = attributes.status ? 'Playing' : 'Paused'; - } - - this.setActivity(this._activity) - } - - /******************************************************************************************* - * Public Methods - * ****************************************************************************************/ - - /** - * Runs on plugin load (Currently run on application start) - */ - constructor(utils: { getStore: () => any; getApp: () => any; }) { - this._utils = utils; - console.debug(`[Plugin][${this.name}] Loading Complete.`); - this._app = utils.getApp(); - } - - /** - * Runs on app ready - */ - onReady(_win: any): void { - let self = this - this.connect(); - console.debug(`[Plugin][${this.name}] Ready.`); - ipcMain.on('updateRPCImage', (_event, imageurl) => { - if (!this._utils.getStoreValue("general.privateEnabled")) { - fetch('https://api.cider.sh/v1/images', { - - method: 'POST', - body: JSON.stringify({url: imageurl}), - headers: { - 'Content-Type': 'application/json', - 'User-Agent': _win.webContents.getUserAgent() - }, - }) - .then(res => res.json()) - .then(function (json) { - self._attributes["artwork"]["url"] = json.url - self.updateActivity(self._attributes) - }) - } - }) - } - - /** - * Runs on app stop - */ - onBeforeQuit(): void { - if (this._client) { - this.disconnect() - } - console.debug(`[Plugin][${this.name}] Stopped.`); - } - - /** - * Runs on playback State Change - * @param attributes Music Attributes (attributes.status = current state) - */ - onPlaybackStateDidChange(attributes: object): void { - this._attributes = attributes - this.updateActivity(attributes) - - } - - /** - * Runs on song change - * @param attributes Music Attributes - */ - onNowPlayingItemDidChange(attributes: object): void { - this._attributes = attributes - this.updateActivity(attributes) - - } } From ab9d209eba14a4a3d3039d0f73df9a153218060d Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Sat, 7 May 2022 20:45:03 +0200 Subject: [PATCH 07/18] Add check to discordrpc.ts --- src/main/plugins/discordrpc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index c943eb68..fe933903 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -183,8 +183,8 @@ export default class DiscordRPC { ] //To change attributes.url => preload/cider-preload.js } - // Add the timestamp if its playing - if (attributes.status) { + // Add the timestamp if its playing and people want them + if (!this._utils.getStoreValue("general.discordrpc.hide_timestamp") && attributes.status) { activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime) activity.endTimestamp = attributes.endTime } From 050cd3e0b649bf1a9ad76f0d052d6d4973f5b9eb Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Sat, 7 May 2022 20:51:48 +0200 Subject: [PATCH 08/18] Add new setting --- src/renderer/views/pages/settings.ejs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs index 8e9bc841..71ea0a58 100644 --- a/src/renderer/views/pages/settings.ejs +++ b/src/renderer/views/pages/settings.ejs @@ -1067,6 +1067,17 @@ +
+
+ {{$root.getLz('settings.option.connectivity.discordRPC.hideTimestamp')}} +
+
+ +
+
+
{{$root.getLz('settings.option.connectivity.discordRPC.detailsFormat')}}
@@ -1639,4 +1650,4 @@ }, } }) - \ No newline at end of file + From aa26b9e6e9a40b46a5211fe51f5e0a039ecfbb28 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Sun, 8 May 2022 20:22:18 +0700 Subject: [PATCH 09/18] test --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44c7279f..b29ba993 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,6 +42,7 @@ jobs: root: . # Must be relative path from root paths: + - src - node_modules - build - resources From bd0412b19b8b8387df63082b3b08729eae0c5a2f Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Mon, 9 May 2022 08:49:05 +0100 Subject: [PATCH 10/18] Auto Triage --- .github/workflows/auto-project.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/auto-project.yml diff --git a/.github/workflows/auto-project.yml b/.github/workflows/auto-project.yml new file mode 100644 index 00000000..92cfb8b8 --- /dev/null +++ b/.github/workflows/auto-project.yml @@ -0,0 +1,18 @@ +name: Add bugs to bugs project + +on: + issues: + types: + - opened + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@main + with: + project-url: https://github.com/orgs//projects/ + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} + labeled: bug, needs-triage + label-operator: OR \ No newline at end of file From 52c7b052738278680a41ffd6a649f27e28f42a95 Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Mon, 9 May 2022 08:52:31 +0100 Subject: [PATCH 11/18] Update bug_report.yaml --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index c5d6402b..d18e0e23 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,7 +1,7 @@ name: Bug Report description: If you encounter an issue whilst using our app, please use this template to help improve the app. title: "[Bug]: " -labels: ["bug", "triage"] +labels: ["bug", "needs-triage"] assignees: [] body: - type: markdown From 14ff743dff42fb8f4ed5c9b45301b9d2b39eb2ac Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Mon, 9 May 2022 08:53:53 +0100 Subject: [PATCH 12/18] Update auto-project.yml --- .github/workflows/auto-project.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-project.yml b/.github/workflows/auto-project.yml index 92cfb8b8..742d82e1 100644 --- a/.github/workflows/auto-project.yml +++ b/.github/workflows/auto-project.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/add-to-project@main with: - project-url: https://github.com/orgs//projects/ + project-url: https://github.com/orgs/ciderapp/projects/5 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} labeled: bug, needs-triage - label-operator: OR \ No newline at end of file + label-operator: OR From d6db99208a514a2d7f6a773232836c5ea8899037 Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Mon, 9 May 2022 09:06:58 +0100 Subject: [PATCH 13/18] Stale issues --- .github/workflows/stale-issues.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/stale-issues.yml diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml new file mode 100644 index 00000000..b566f1d6 --- /dev/null +++ b/.github/workflows/stale-issues.yml @@ -0,0 +1,18 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v4 + with: + stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + days-before-stale: 30 + days-before-close: 7 \ No newline at end of file From 7bacd819a02ba101a13a2d5a9935ef263c75c644 Mon Sep 17 00:00:00 2001 From: Quacksire <19170969+quacksire@users.noreply.github.com> Date: Mon, 9 May 2022 10:07:06 -0700 Subject: [PATCH 14/18] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b8fface..430a36f2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ GitHub Forks
- Buy Me A Coffee + Buy Me A Coffee Open Collective GitHub Sponsor
From 30bf34aa22a0793bc86cafc878a0c97927309f74 Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Mon, 9 May 2022 20:14:06 +0200 Subject: [PATCH 15/18] update settings.ejs --- src/renderer/views/pages/settings.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs index 71ea0a58..963cd6f0 100644 --- a/src/renderer/views/pages/settings.ejs +++ b/src/renderer/views/pages/settings.ejs @@ -1650,4 +1650,4 @@ }, } }) - + \ No newline at end of file From 6cca7c4e1d455cd7981a626911c4bd72ebbd26d5 Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Mon, 9 May 2022 18:49:33 +0000 Subject: [PATCH 16/18] Revert "Add option to hide timestamp in RPC" --- src/i18n/en_US.json | 1 - src/i18n/hu_HU.json | 1 - src/i18n/source/en_US.json | 1 - src/main/base/store.ts | 1 - src/main/plugins/discordrpc.ts | 4 ++-- src/renderer/views/pages/settings.ejs | 11 ----------- 6 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 10aa9e00..2b1e581b 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -472,7 +472,6 @@ "settings.option.connectivity.discordRPC.clientName": "Client Name", "settings.option.connectivity.discordRPC.clearOnPause": "Clear Discord Rich Presence on Pause", "settings.option.connectivity.discordRPC.hideButtons": "Hide buttons on Discord Rich Presence", - "settings.option.connectivity.discordRPC.hideTimestamp": "Hide timestamp on Discord Rich Presence", "settings.option.connectivity.discordRPC.detailsFormat": "Details Format", "settings.option.connectivity.discordRPC.stateFormat": "State Format", "settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling", diff --git a/src/i18n/hu_HU.json b/src/i18n/hu_HU.json index ca93b58e..8108143d 100644 --- a/src/i18n/hu_HU.json +++ b/src/i18n/hu_HU.json @@ -416,7 +416,6 @@ "settings.option.connectivity.discordRPC.clientName": "Kliensnév", "settings.option.connectivity.discordRPC.clearOnPause": "Rich Presence törlése megállításnál", "settings.option.connectivity.discordRPC.hideButtons": "Rich Presence gombok elrejtése", - "settings.option.connectivity.discordRPC.hideTimestamp": "Rich Presence visszaszámláló elrejtése", "settings.option.connectivity.discordRPC.detailsFormat": "Részletek formátuma", "settings.option.connectivity.discordRPC.stateFormat": "Állapot formátuma", "settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling", diff --git a/src/i18n/source/en_US.json b/src/i18n/source/en_US.json index 10aa9e00..2b1e581b 100644 --- a/src/i18n/source/en_US.json +++ b/src/i18n/source/en_US.json @@ -472,7 +472,6 @@ "settings.option.connectivity.discordRPC.clientName": "Client Name", "settings.option.connectivity.discordRPC.clearOnPause": "Clear Discord Rich Presence on Pause", "settings.option.connectivity.discordRPC.hideButtons": "Hide buttons on Discord Rich Presence", - "settings.option.connectivity.discordRPC.hideTimestamp": "Hide timestamp on Discord Rich Presence", "settings.option.connectivity.discordRPC.detailsFormat": "Details Format", "settings.option.connectivity.discordRPC.stateFormat": "State Format", "settings.option.connectivity.lastfmScrobble": "Last.fm Scrobbling", diff --git a/src/main/base/store.ts b/src/main/base/store.ts index c3bc6373..de8590a5 100644 --- a/src/main/base/store.ts +++ b/src/main/base/store.ts @@ -17,7 +17,6 @@ export class Store { "client": "Cider", "clear_on_pause": true, "hide_buttons": false, - "hide_timestamp": false, "state_format": "by {artist}", "details_format": "{title}", }, diff --git a/src/main/plugins/discordrpc.ts b/src/main/plugins/discordrpc.ts index fe933903..c943eb68 100644 --- a/src/main/plugins/discordrpc.ts +++ b/src/main/plugins/discordrpc.ts @@ -183,8 +183,8 @@ export default class DiscordRPC { ] //To change attributes.url => preload/cider-preload.js } - // Add the timestamp if its playing and people want them - if (!this._utils.getStoreValue("general.discordrpc.hide_timestamp") && attributes.status) { + // Add the timestamp if its playing + if (attributes.status) { activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime) activity.endTimestamp = attributes.endTime } diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs index 963cd6f0..8e9bc841 100644 --- a/src/renderer/views/pages/settings.ejs +++ b/src/renderer/views/pages/settings.ejs @@ -1067,17 +1067,6 @@
-
-
- {{$root.getLz('settings.option.connectivity.discordRPC.hideTimestamp')}} -
-
- -
-
-
{{$root.getLz('settings.option.connectivity.discordRPC.detailsFormat')}}
From 938eb6c222b2e8a8802558156b92f9c999c4c80e Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Wed, 11 May 2022 16:05:08 +0800 Subject: [PATCH 17/18] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 430a36f2..f6cfbb0b 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ [![Get it from the Microsoft Store](https://img.shields.io/badge/Get_It_From_The_Microsoft_Store-100000?style=for-the-badge&logo=microsoft)](https://www.microsoft.com/store/apps/9P21XJ9D9G66) -[![Get it from Windows Package Manager](https://custom-icon-badges.herokuapp.com/badge/Get_It_via_Winget_(Nightly)_-100000?style=for-the-badge&logo=winstall)](https://winstall.app/apps/CiderCollective.Cider.Nightly) +[![Get it from Windows Package Manager](https://custom-icon-badges.herokuapp.com/badge/Get_It_via_Winget_(Nightly)_-100000?style=for-the-badge&logo=winstall)](https://winstall.app/apps/CiderCollective.Cider)