mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-21 09:31:19 +02:00
refactor: add info/debug
This commit is contained in:
@@ -31,6 +31,8 @@ pub async fn generate_media_ids(
|
||||
// size of media_ids vector, should be equal to the media vector
|
||||
media_ids.resize(m.media.len(), String::new());
|
||||
|
||||
info!("{} medias in tweet", m.media.len());
|
||||
|
||||
for (i, media) in m.media.iter().enumerate() {
|
||||
// attribute media url
|
||||
media_url = media.url.clone();
|
||||
@@ -41,10 +43,7 @@ pub async fn generate_media_ids(
|
||||
let mastodon = mastodon.clone();
|
||||
|
||||
let task = tokio::task::spawn(async move {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
info!("Start treating {}", media.media_url_https);
|
||||
>>>>>>> 32f9605 (tamerelol)
|
||||
// get the tweet embedded media
|
||||
let local_tweet_media_path = match get_tweet_media(&media, &cache_path).await {
|
||||
Ok(l) => l,
|
||||
@@ -65,7 +64,7 @@ pub async fn generate_media_ids(
|
||||
return Err(ScootalooError::new(&format!(
|
||||
"Attachment {} cannot be uploaded to Mastodon Instance: {}",
|
||||
&local_tweet_media_path, e
|
||||
)))
|
||||
)));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -88,6 +87,8 @@ pub async fn generate_media_ids(
|
||||
Err(e) => error!("Something went wrong when joining the main thread: {}", e),
|
||||
}
|
||||
}
|
||||
} else {
|
||||
info!("No media in tweet");
|
||||
}
|
||||
|
||||
// in case some media_ids slot remained empty due to errors, remove them
|
||||
|
Reference in New Issue
Block a user