tangled
alpha
login
or
join now
rocksky.app
/
rocksky
96
fork
atom
A decentralized music tracking and discovery platform built on AT Protocol 🎵
rocksky.app
spotify
atproto
lastfm
musicbrainz
scrobbling
listenbrainz
96
fork
atom
overview
issues
7
pulls
pipelines
run cargo fmt
tsiry-sandratraina.com
5 months ago
1e90d1ec
5fa0fcb2
+11
-5
1 changed file
expand all
collapse all
unified
split
crates
scrobbler
src
listenbrainz
core
submit.rs
+11
-5
crates/scrobbler/src/listenbrainz/core/submit.rs
···
27
27
28
28
const RETRIES: usize = 5;
29
29
for attempt in 1..=RETRIES {
30
30
-
match scrobble_listenbrainz(pool, cache, &payload, token).await.with_context(
31
31
-
|| format!("Attempt {}/{}: Error submitting listens", attempt, RETRIES),
32
32
-
) {
30
30
+
match scrobble_listenbrainz(pool, cache, &payload, token)
31
31
+
.await
32
32
+
.with_context(|| format!("Attempt {}/{}: Error submitting listens", attempt, RETRIES))
33
33
+
{
33
34
Ok(_) => {
34
35
return Ok(HttpResponse::Ok().json(json!({
35
36
"status": "ok",
···
48
49
"message": format!("Failed to parse listens: {}", e)
49
50
})));
50
51
}
51
51
-
println!("Retryable error on attempt {}/{}: {}", attempt, RETRIES, e.to_string().yellow());
52
52
+
println!(
53
53
+
"Retryable error on attempt {}/{}: {}",
54
54
+
attempt,
55
55
+
RETRIES,
56
56
+
e.to_string().yellow()
57
57
+
);
52
58
println!("{:#?}", payload);
53
59
54
60
if attempt == RETRIES {
···
65
71
66
72
unreachable!();
67
73
68
68
-
/* match scrobble_listenbrainz(pool, cache, payload, token).await {
74
74
+
/* match scrobble_listenbrainz(pool, cache, payload, token).await {
69
75
Ok(_) => Ok(HttpResponse::Ok().json(json!({
70
76
"status": "ok",
71
77
"payload": {