MCPcopy Index your code
hub / github.com/LabyStudio/java-spotify-api / is_spotify

Function is_spotify

rust/src/session.rs:18–26  ·  view source on GitHub ↗
(session: &GlobalSystemMediaTransportControlsSession)

Source from the content-addressed store, hash-verified

16const CACHE_TTL: Duration = Duration::from_secs(3);
17
18pub fn is_spotify(session: &GlobalSystemMediaTransportControlsSession) -> Result<bool> {
19 let app_id = session.SourceAppUserModelId()?;
20 let app_id = app_id.to_string();
21
22 Ok(
23 app_id == "Spotify.exe"
24 || (app_id.starts_with("SpotifyAB") && app_id.ends_with("!Spotify")),
25 )
26}
27
28pub fn get_spotify_session() -> Result<Option<GlobalSystemMediaTransportControlsSession>> {
29 let mut cache = SPOTIFY_SESSION_CACHE.lock().unwrap();

Callers 1

get_spotify_sessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected