feat: add configuration option to select Activity Name based on currently playing track #11
Reference in New Issue
Block a user
Delete Branch "main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #8. The available options are
title,albumandartist.Summary of Changes
Hello @OpenSrcerer, I'm Gemini Code Assist1 ! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request enhances the Discord Rich Presence integration by providing users with the flexibility to choose what information is displayed as the 'Activity Name' when streaming music. This moves beyond a static application name to allow for more contextual and dynamic updates based on the currently playing track's metadata, significantly improving the user experience for Discord users.
Highlights
activityname, allowing users to customize the name displayed in Discord Rich Presence when playing music from Navidrome.manifest.json, providing a user-friendly radio button selection.activitynameconfiguration across all possible options.🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.
Changelog
activityNameKeyconstant for the new configuration.activityNameDefault,activityNameTitle,activityNameArtist, andactivityNameAlbumto represent display options.NowPlayingfunction to dynamically resolve the activity name based on theactivitynameconfiguration setting.fmtpackage.activityNameKeyconfiguration.DescribeTabletest suite to verify the correct resolution of the activity name based on differentactivitynameconfiguration values (default, title, artist, album).activitynameproperty to the plugin's configuration schema.activitynameas a string type withenumvalues ('default', 'title', 'artist', 'album') and a default of 'default'.activitynamewith a 'radio' format for easy selection in the plugin settings.Activity
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either
/gemini <command>or@gemini-code-assist <command>. Below is a summary of the supported commands on the current page./gemini review/gemini summary/gemini helpCustomization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a
.gemini/folder in the base of the repository. Detailed instructions can be found here.Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩︎
Code Review
This pull request introduces a new configuration option to customize the activity name displayed in Discord Rich Presence. The implementation is sound and is accompanied by good test coverage for the new functionality. I've added a couple of suggestions to improve code robustness and test maintainability. Overall, this is a great addition.
While the current implementation works as confirmed by the tests, ignoring the boolean
okreturn value frompdk.GetConfigis not a robust practice. It relies on the zero value of the string ("") not matching any of the cases. A better approach is to explicitly check if the configuration key exists before attempting to use its value. This makes the code more readable and less prone to subtle bugs if the constants or config behavior were to change in the future.There is a significant amount of duplicated test setup code between this
DescribeTableand theIt("successfully sends now playing update", ...)test case. This harms maintainability, as any change to the mocking logic will need to be updated in multiple places.To follow the DRY (Don't Repeat Yourself) principle, you could refactor this duplicated logic into a
BeforeEachblock within theDescribe("NowPlaying", ...)suite or into a shared helper function. This would make the tests cleaner and easier to maintain.For example, you could move the common mock setups to a
BeforeEachand only configure the mocks that differ in each test, like this:holy peak
Download the plugin for this PR: discord-rich-presence.zip
Built from
2be99c413aon 2026-02-08T17:44:58ZHey @OpenSrcerer, thanks for the PR. A couple of changes:
Thanks!