2023-06-01 19:39:35 +00:00
|
|
|
/// Version string of the form "librespot-\<sha\>"
|
2023-04-12 20:29:25 +00:00
|
|
|
pub const VERSION_STRING: &str = concat!("librespot-", env!("VERGEN_GIT_SHA"));
|
2019-07-09 16:32:04 +00:00
|
|
|
|
2021-02-12 19:21:07 +00:00
|
|
|
/// Generate a timestamp string representing the build date (UTC).
|
2021-02-09 18:42:56 +00:00
|
|
|
pub const BUILD_DATE: &str = env!("VERGEN_BUILD_DATE");
|
2019-07-09 16:32:04 +00:00
|
|
|
|
2021-02-09 18:42:56 +00:00
|
|
|
/// Short sha of the latest git commit.
|
2023-04-12 20:29:25 +00:00
|
|
|
pub const SHA_SHORT: &str = env!("VERGEN_GIT_SHA");
|
2019-07-09 16:32:04 +00:00
|
|
|
|
2021-02-09 18:42:56 +00:00
|
|
|
/// Date of the latest git commit.
|
2022-01-09 00:03:47 +00:00
|
|
|
pub const COMMIT_DATE: &str = env!("VERGEN_GIT_COMMIT_DATE");
|
2019-07-09 16:32:04 +00:00
|
|
|
|
2021-02-13 17:43:24 +00:00
|
|
|
/// Librespot crate version.
|
|
|
|
pub const SEMVER: &str = env!("CARGO_PKG_VERSION");
|
|
|
|
|
2021-02-09 18:42:56 +00:00
|
|
|
/// A random build id.
|
2021-02-13 17:43:24 +00:00
|
|
|
pub const BUILD_ID: &str = env!("LIBRESPOT_BUILD_ID");
|
2021-12-11 15:43:34 +00:00
|
|
|
|
|
|
|
/// The protocol version of the Spotify desktop client.
|
|
|
|
pub const SPOTIFY_VERSION: u64 = 117300517;
|
|
|
|
|
|
|
|
/// The protocol version of the Spotify mobile app.
|
|
|
|
pub const SPOTIFY_MOBILE_VERSION: &str = "8.6.84";
|
2021-12-18 22:44:13 +00:00
|
|
|
|
|
|
|
/// The user agent to fall back to, if one could not be determined dynamically.
|
|
|
|
pub const FALLBACK_USER_AGENT: &str = "Spotify/117300517 Linux/0 (librespot)";
|
2022-08-25 23:51:00 +00:00
|
|
|
|
|
|
|
pub fn spotify_version() -> String {
|
|
|
|
match std::env::consts::OS {
|
|
|
|
"android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
|
|
|
|
_ => SPOTIFY_VERSION.to_string(),
|
|
|
|
}
|
|
|
|
}
|