openlibspot_core/
version.rs

1/// Version string of the form "librespot-\<sha\>"
2pub const VERSION_STRING: &str = concat!("librespot-", env!("VERGEN_GIT_SHA"));
3
4/// Generate a timestamp string representing the build date (UTC).
5pub const BUILD_DATE: &str = env!("VERGEN_BUILD_DATE");
6
7/// Short sha of the latest git commit.
8pub const SHA_SHORT: &str = env!("VERGEN_GIT_SHA");
9
10/// Date of the latest git commit.
11pub const COMMIT_DATE: &str = env!("VERGEN_GIT_COMMIT_DATE");
12
13/// Librespot crate version.
14pub const SEMVER: &str = env!("CARGO_PKG_VERSION");
15
16/// A random build id.
17pub const BUILD_ID: &str = env!("LIBRESPOT_BUILD_ID");
18
19/// The protocol version of the Spotify desktop client.
20pub const SPOTIFY_VERSION: u64 = 117300517;
21
22/// The protocol version of the Spotify mobile app.
23pub const SPOTIFY_MOBILE_VERSION: &str = "8.6.84";
24
25/// The user agent to fall back to, if one could not be determined dynamically.
26pub const FALLBACK_USER_AGENT: &str = "Spotify/117300517 Linux/0 (librespot)";
27
28pub fn spotify_version() -> String {
29    match std::env::consts::OS {
30        "android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
31        _ => SPOTIFY_VERSION.to_string(),
32    }
33}