From fdfa3dd5152f922de6dc411b9f77fb15aa16b15c Mon Sep 17 00:00:00 2001 From: aes <> Date: Thu, 24 Oct 2024 14:53:57 -0300 Subject: [PATCH] Change activity type to 'listening to' instead of 'playing' --- Cargo.lock | 12 ++++++++++++ Cargo.toml | 2 +- src/main.rs | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 0e61be5..9815f9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,6 +188,7 @@ dependencies = [ "quork", "serde", "serde_json", + "serde_repr", "thiserror", "tracing", "uuid", @@ -1284,6 +1285,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "serde_spanned" version = "0.6.7" diff --git a/Cargo.toml b/Cargo.toml index deae7ca..06d838e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" keywords = ["mpd", "discord", "rpc", "music", "mopidy"] [dependencies] -discord-presence = "1.3.1" +discord-presence = {version = "1.3.1", features = ["activity_type"]} mpd_client = "1.4.1" dirs = "5.0.1" toml = "0.8.19" diff --git a/src/main.rs b/src/main.rs index 21734d6..b3ec7da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use std::time::Duration; +use discord_presence::models::ActivityType; use discord_presence::models::EventData; use discord_presence::{Client as DiscordClient, DiscordError}; use mpd_client::client::ConnectionEvent::SubsystemChange; @@ -186,6 +187,7 @@ impl<'a> Service<'a> { let res = self.drpc.set_activity(|act| { act.state(state) + ._type(ActivityType::Listening) .details(details) .assets(|mut assets| { match url {