diff --git a/src/bot/mod.rs b/src/bot/mod.rs index 7c7bbbb..c5a1c47 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -199,9 +199,11 @@ async fn handle_series( { let read = data.read().await; if read.post_history.check_for_post(series.slug.as_str(), post_part_info.as_string().as_str(), post_lemmy_info.title.as_str()) { - drop(read); - let mut write = data.write().await; - write.messages.push(Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title))); + if !read.messages.contains(&Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title))) { + drop(read); + let mut write = data.write().await; + write.messages.push(Message::Info(format!("Skipping '{}' since already posted", post_lemmy_info.title))); + }; post_list.remove(index); continue } diff --git a/src/main.rs b/src/main.rs index 552bc0f..3bdb4d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,7 +62,7 @@ impl SharedData { } } -#[derive(Clone, Debug, Display)] +#[derive(Clone, Debug, Display, PartialEq)] pub(crate) enum Message { Info(String), Warning(String),