MCPcopy Create free account
hub / github.com/LabyStudio/java-spotify-api / isSpotifyAvailable

Function isSpotifyAvailable

rust/src/lib.rs:15–30  ·  view source on GitHub ↗
(_env: JNIEnv, _class: JClass)

Source from the content-addressed store, hash-verified

13
14#[no_mangle]
15pub extern "system" fn isSpotifyAvailable(_env: JNIEnv, _class: JClass) -> jint {
16 let result = std::panic::catch_unwind(|| {
17 block_on(async {
18 match get_spotify_session() {
19 Ok(Some(_session)) => Ok(1),
20 Ok(None) => Ok(0),
21 Err(_) => Err(()),
22 }
23 })
24 });
25
26 match result {
27 Ok(Ok(val)) => val,
28 _ => 0,
29 }
30}
31
32#[no_mangle]
33pub extern "system" fn getPlaybackPosition(_env: JNIEnv, _class: JClass) -> jlong {

Callers

nothing calls this directly

Calls 1

get_spotify_sessionFunction · 0.85

Tested by

no test coverage detected