diff --git a/Cargo.lock b/Cargo.lock index 9279ad1..8ecf320 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1255,9 +1255,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "submissions-api" -version = "0.8.0-pre6" +version = "0.8.0" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "cc1a50db52b42ac2a5f680e6e258b2f45189325629994cf46329c2472192753c" +checksum = "3d4896b5e0cbabfc167898d90ac563664f13fb9103fc7942de674ba44f47b8e3" dependencies = [ "chrono", "reqwest", diff --git a/Cargo.toml b/Cargo.toml index 846bdaf..8b20461 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ clap = { version = "4.4.2", features = ["derive"] } futures = "0.3.31" rand = "0.9.1" siphasher = "1.0.1" -submissions-api = { version = "0.8.0-pre6", registry = "strafesnet" } +submissions-api = { version = "0.8.0", registry = "strafesnet" } tokio = { version = "1.42.0", features = ["fs", "macros", "rt-multi-thread"] } [profile.release] diff --git a/src/main.rs b/src/main.rs index 5326a3a..05eb900 100644 --- a/src/main.rs +++ b/src/main.rs @@ -714,17 +714,17 @@ async fn release(config:ReleaseConfig)->Result<(),ReleaseError>{ pending.shuffle(&mut rng); // schedule one per week - let release_infos=pending.iter().enumerate().map(|(i,submission)| + let schedule:&Vec<_>=&pending.iter().enumerate().map(|(i,submission)| submissions_api::types::ReleaseInfo{ Date:std::time::UNIX_EPOCH.checked_add(std::time::Duration::from_secs(( start_date+i as i64*ONE_WEEK ) as u64)).unwrap().into(), SubmissionID:submissions_api::types::SubmissionID(submission.ID), } - ); + ).collect(); // ask to confirm schedule - for map in release_infos.clone(){ + for map in schedule{ println!("Schedule {:?} at {}",map.SubmissionID,map.Date); } @@ -743,7 +743,7 @@ async fn release(config:ReleaseConfig)->Result<(),ReleaseError>{ // send it api.release_submissions(submissions_api::types::ReleaseRequest{ - release_infos + schedule, }).await.map_err(ReleaseError::Release)?; }