Bot Rewrite for jnovel labs

This commit is contained in:
Neshura 2023-09-18 23:01:22 +02:00
parent ba052a29b5
commit a0d414a091
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
2 changed files with 320 additions and 193 deletions
src/config

View file

@ -158,7 +158,6 @@ impl Config {
.await?;
let data: FeedSeriesData = serde_json::from_str(&res).unwrap();
println!("{:#?}", data);
}
return Ok(());
}
@ -210,10 +209,6 @@ impl Config {
// Get First Volume that has valid Release Data
if now >= published {
if Some(volume.slug.clone()) != history_data.last_volume_slug {
println!(
"Should Post for {} Volume {}",
feed.series_slug, volume.slug
);
if let Some(volume_community) = &feed.communities.volume {
let mut post_url = Url::parse(&(volume_url_base!() + &feed.series_slug))?;
post_url.set_fragment(Some(&("volume-".to_string() + &volume.number.to_string())));
@ -235,7 +230,6 @@ impl Config {
language_id: Some(LanguageId(37)), // TODO get this id once every few hours per API request, the ordering of IDs suggests that the EN Id might change in the future
auth: auth.clone(),
};
println!("{:?}", new_post.url);
post_queue.push((
new_post,
PostQueueMetadata {
@ -269,8 +263,6 @@ impl Config {
data.parts.reverse();
for part in data.parts {
if Some(part.slug.clone()) != history_data.last_part_slug {
println!("Should Post for {} Part {}", feed.series_slug, part.slug);
let new_post = CreatePost {
name: part.title.clone(),
community_id: community_ids.find(&chapter_community),