feat: add configuration option to select Activity Name based on currently playing track #11
@@ -14,6 +14,7 @@ Based on the [Navicord](https://github.com/logixism/navicord) project.
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Shows currently playing track with title, artist, and album art
|
- Shows currently playing track with title, artist, and album art
|
||||||
|
- Customizable activity name: "Navidrome" is default, but can be configured to display track title, artist, or album
|
||||||
- Displays playback progress with start/end timestamps
|
- Displays playback progress with start/end timestamps
|
||||||
- Automatic presence clearing when track finishes
|
- Automatic presence clearing when track finishes
|
||||||
- Multi-user support with individual Discord tokens
|
- Multi-user support with individual Discord tokens
|
||||||
@@ -163,6 +164,16 @@ Access the plugin configuration in Navidrome: **Settings > Plugins > Discord Ric
|
|||||||
3. Copy the "Application ID" from the General Information page
|
3. Copy the "Application ID" from the General Information page
|
||||||
- **Example**: `1234567890123456789`
|
- **Example**: `1234567890123456789`
|
||||||
|
|
||||||
|
#### Activity Name Display
|
||||||
|
- **What it is**: Choose what information to display as the activity name in Discord Rich Presence
|
||||||
|
- **Options**:
|
||||||
|
- **Default**: Shows "Navidrome" (static app name)
|
||||||
|
- **Track**: Shows the currently playing track title
|
||||||
|
- **Album**: Shows the currently playing track's album name
|
||||||
|
- **Artist**: Shows the currently playing track's artist name
|
||||||
|
- **Default**: "Default"
|
||||||
|
- **Use case**: Choose "Track" or "Artist" for more dynamic, music-focused presence that changes with each song
|
||||||
|
|
||||||
#### Upload to uguu.se
|
#### Upload to uguu.se
|
||||||
- **When to enable**: Your Navidrome instance is NOT publicly accessible from the internet
|
- **When to enable**: Your Navidrome instance is NOT publicly accessible from the internet
|
||||||
- **What it does**: Automatically uploads album artwork to uguu.se (temporary hosting) so Discord can display it
|
- **What it does**: Automatically uploads album artwork to uguu.se (temporary hosting) so Discord can display it
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ const (
|
|||||||
|
|
||||||
// Activity name display options
|
// Activity name display options
|
||||||
const (
|
const (
|
||||||
activityNameDefault = "default"
|
activityNameDefault = "Default"
|
||||||
activityNameTitle = "title"
|
activityNameTrack = "Track"
|
||||||
activityNameArtist = "artist"
|
activityNameArtist = "Artist"
|
||||||
activityNameAlbum = "album"
|
activityNameAlbum = "Album"
|
||||||
)
|
)
|
||||||
|
|
||||||
// userToken represents a user-token mapping from the config
|
// userToken represents a user-token mapping from the config
|
||||||
@@ -149,12 +149,12 @@ func (p *discordPlugin) NowPlaying(input scrobbler.NowPlayingRequest) error {
|
|||||||
activityName := "Navidrome"
|
activityName := "Navidrome"
|
||||||
activityNameOption, _ := pdk.GetConfig(activityNameKey)
|
activityNameOption, _ := pdk.GetConfig(activityNameKey)
|
||||||
switch activityNameOption {
|
switch activityNameOption {
|
||||||
case activityNameTitle:
|
case activityNameTrack:
|
||||||
activityName = input.Track.Title
|
activityName = input.Track.Title
|
||||||
case activityNameArtist:
|
|
||||||
activityName = input.Track.Artist
|
|
||||||
case activityNameAlbum:
|
case activityNameAlbum:
|
||||||
activityName = input.Track.Album
|
activityName = input.Track.Album
|
||||||
|
case activityNameArtist:
|
||||||
|
activityName = input.Track.Artist
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send activity update
|
// Send activity update
|
||||||
|
|||||||
+4
-4
@@ -225,10 +225,10 @@ var _ = Describe("discordPlugin", func() {
|
|||||||
Expect(sentPayload).To(ContainSubstring(fmt.Sprintf(`"name":"%s"`, expectedName)))
|
Expect(sentPayload).To(ContainSubstring(fmt.Sprintf(`"name":"%s"`, expectedName)))
|
||||||
},
|
},
|
||||||
Entry("defaults to Navidrome when not configured", "", false, "Navidrome"),
|
Entry("defaults to Navidrome when not configured", "", false, "Navidrome"),
|
||||||
Entry("defaults to Navidrome with explicit default value", "default", true, "Navidrome"),
|
Entry("defaults to Navidrome with explicit default value", "Default", true, "Navidrome"),
|
||||||
Entry("uses track title when configured", "title", true, "Test Song"),
|
Entry("uses track title when configured", "Track", true, "Test Song"),
|
||||||
Entry("uses track artist when configured", "artist", true, "Test Artist"),
|
Entry("uses track album when configured", "Album", true, "Test Album"),
|
||||||
Entry("uses track album when configured", "album", true, "Test Album"),
|
Entry("uses track artist when configured", "Artist", true, "Test Artist"),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -51,8 +51,8 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "Activity Name Display",
|
"title": "Activity Name Display",
|
||||||
"description": "Choose what to display as the activity name in Discord Rich Presence",
|
"description": "Choose what to display as the activity name in Discord Rich Presence",
|
||||||
"enum": ["default", "title", "artist", "album"],
|
"enum": ["Default", "Track", "Album", "Artist"],
|
||||||
"default": "default"
|
"default": "Default"
|
||||||
},
|
},
|
||||||
"uguuenabled": {
|
"uguuenabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|||||||
Reference in New Issue
Block a user