librespot_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 = 124200290;
21
22/// The semantic version of the Spotify desktop client.
23pub const SPOTIFY_SEMANTIC_VERSION: &str = "1.2.52.442";
24
25/// `property_set_id` related to desktop version 1.2.52.442
26pub const SPOTIFY_PROPERTY_SET_ID: &str = "b4c7e4b5835079ed94391b2e65fca0fdba65eb50";
27
28/// The protocol version of the Spotify mobile app.
29pub const SPOTIFY_MOBILE_VERSION: &str = "8.9.82.620";
30
31/// `property_set_id` related to mobile version 8.9.82.620
32pub const SPOTIFY_MOBILE_PROPERTY_SET_ID: &str =
33    "5ec87c2cc32e7c509703582cfaaa3c7ad253129d5701127c1f5eab5c9531736c";
34
35/// The general spirc version
36pub const SPOTIFY_SPIRC_VERSION: &str = "3.2.6";
37
38/// The user agent to fall back to, if one could not be determined dynamically.
39pub const FALLBACK_USER_AGENT: &str = "Spotify/124200290 Linux/0 (librespot)";
40
41pub fn spotify_version() -> String {
42    match crate::config::OS {
43        "android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
44        _ => SPOTIFY_VERSION.to_string(),
45    }
46}
47
48pub fn spotify_semantic_version() -> String {
49    match crate::config::OS {
50        "android" | "ios" => SPOTIFY_MOBILE_VERSION.to_owned(),
51        _ => SPOTIFY_SEMANTIC_VERSION.to_string(),
52    }
53}