Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More customizable Discord-Presence #332

Merged
merged 6 commits into from
Feb 11, 2024
Merged

Conversation

TheRockYT
Copy link
Contributor

This PR adds two features to enhance the user's control over the discord integration:

  • The ability to hide the current song from the discord activity and display a custom text instead
  • The ability to customize the text that is shown when no song is playing

Detailed description

To implement these features, this PR introduces three new settings in the discord section of the configuration:

  • showSong (boolean): This setting determines whether the current song is shown in the discord activity or not. If set to true, the current song will be displayed as usual. If set to false, the custom text specified by the listeningText setting will be shown instead.
  • idleText (string): This setting specifies the text that is shown in the discord activity when no song is playing. The default value is Browsing Tidal.
  • listeningText (string): This setting specifies the text that is shown in the discord activity when a song is playing and the showSong setting is set to false. The default value is Listening Tidal.

To handle the different scenarios, this PR also introduces a new function in src/scripts/discord.ts:

  • getActivity: This function returns the appropriate Presence object based on the current song and the settings. It is used by the other functions in the same file to update the discord activity.

This PR does not include a migration for the storage, as it is uncertain when or if this code will be merged.

I would like to thank the owners and contributors of this project for creating and maintaining this awesome project. I hope this PR will be useful and welcome.

showSong (boolean): If enabled, the client will show the current song on discord.

idleText (string): This text is shown if no song is playing.

listeningText (string): This text is shown if a song is playing, but showSong is set to false.
The settings now appear directly below the show song switch
@Mastermindzh
Copy link
Owner

Sorry for the long wait, will review and test this weekend.

  - 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 Mastermindzh#342, Mastermindzh#306
- Added 5.9.0 logs/versions/migrations
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@Mastermindzh Mastermindzh changed the base branch from master to 5.9.0 February 11, 2024 21:44
@Mastermindzh Mastermindzh merged commit 4da6d9f into Mastermindzh:5.9.0 Feb 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants