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
fix empty googledrive parent dir value
tsiry-sandratraina.com
8 months ago
df763e3d
df036bcf
+7
-3
1 changed file
expand all
collapse all
unified
split
crates
googledrive
src
scan.rs
+7
-3
crates/googledrive/src/scan.rs
···
44
refresh_token.clone(),
45
token.did.clone(),
46
token.xata_id.clone(),
0
47
)
48
.await?;
49
}
···
68
refresh_token,
69
did.to_string(),
70
google_drive_id.clone(),
0
71
)
72
.await?;
73
}
···
81
refresh_token: String,
82
did: String,
83
google_drive_id: String,
0
84
) -> BoxFuture<'static, Result<(), Error>> {
85
Box::pin(async move {
86
let client = GoogleDriveClient::new(&refresh_token).await?;
···
100
if file.mime_type == "application/vnd.google-apps.folder" {
101
println!("Scanning folder: {}", file.name.bright_green());
102
103
-
create_google_drive_directory(&pool, &file, &google_drive_id, Some(&file_id)).await?;
104
105
// TODO: publish folder metadata to nats
106
···
137
}
138
}
139
140
-
for file in files {
141
scan_audio_files(
142
pool.clone(),
143
-
file.id,
144
refresh_token.clone(),
145
did.clone(),
146
google_drive_id.clone(),
0
147
)
148
.await?;
149
tokio::time::sleep(std::time::Duration::from_secs(3)).await;
···
44
refresh_token.clone(),
45
token.did.clone(),
46
token.xata_id.clone(),
47
+
None,
48
)
49
.await?;
50
}
···
69
refresh_token,
70
did.to_string(),
71
google_drive_id.clone(),
72
+
None,
73
)
74
.await?;
75
}
···
83
refresh_token: String,
84
did: String,
85
google_drive_id: String,
86
+
parent_drive_file_id: Option<String>,
87
) -> BoxFuture<'static, Result<(), Error>> {
88
Box::pin(async move {
89
let client = GoogleDriveClient::new(&refresh_token).await?;
···
103
if file.mime_type == "application/vnd.google-apps.folder" {
104
println!("Scanning folder: {}", file.name.bright_green());
105
106
+
create_google_drive_directory(&pool, &file, &google_drive_id, parent_drive_file_id.as_deref()).await?;
107
108
// TODO: publish folder metadata to nats
109
···
140
}
141
}
142
143
+
for child_file in files {
144
scan_audio_files(
145
pool.clone(),
146
+
child_file.id.clone(),
147
refresh_token.clone(),
148
did.clone(),
149
google_drive_id.clone(),
150
+
Some(file_id.clone()),
151
)
152
.await?;
153
tokio::time::sleep(std::time::Duration::from_secs(3)).await;