diff --git a/src/application.rs b/src/application.rs index da1d5ac..ffed76a 100644 --- a/src/application.rs +++ b/src/application.rs @@ -42,7 +42,7 @@ glib::wrapper! { impl Default for Application { fn default() -> Self { glib::Object::builder::() - .property("application-id", "eu.callcc.audrey") + .property("application-id", crate::APP_ID) .property("flags", gio::ApplicationFlags::default()) .build() } diff --git a/src/main.rs b/src/main.rs index 4ccdf9b..0b46160 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,7 @@ +pub const VERSION: &'static str = "0.1.0"; // AUDREY_VERSION +pub const USER_AGENT: &'static str = "audrey/linux"; +pub const APP_ID: &'static str = "eu.callcc.audrey"; + mod application; pub use application::Application; @@ -50,7 +54,7 @@ fn main() -> glib::ExitCode { // smol test for the subsonic client runtime().spawn(async { let keyring = oo7::Keyring::new().await.unwrap(); - let attributes = vec![("xdg:schema", "eu.callcc.audrey")]; + let attributes = vec![("xdg:schema", APP_ID)]; let items = keyring.search_items(&attributes).await.unwrap(); if !items.is_empty() { let item = &items[0]; diff --git a/src/subsonic.rs b/src/subsonic.rs index 15715d2..ce0e17b 100644 --- a/src/subsonic.rs +++ b/src/subsonic.rs @@ -71,7 +71,7 @@ impl Client { ("t", token), ("s", salt), ("v", "1.16.1"), - ("c", "eu.callcc.audrey"), + ("c", crate::APP_ID), ("f", "json"), ], ) @@ -83,7 +83,7 @@ impl Client { Ok(Client { client: reqwest::Client::builder() - .user_agent("audrey/linux") // Audrey.Const.user_agent + .user_agent(crate::USER_AGENT) .build()?, base_url, })