You've already forked AstralRinth
forked from didirus/AstralRinth
fix updates route (#667)
This commit is contained in:
@@ -207,7 +207,7 @@ pub async fn process_payout(
|
||||
client: &clickhouse::Client,
|
||||
) -> Result<(), ApiError> {
|
||||
let start: DateTime<Utc> = DateTime::from_utc(
|
||||
Utc::now()
|
||||
(Utc::now() - Duration::days(1))
|
||||
.date_naive()
|
||||
.and_hms_nano_opt(0, 0, 0, 0)
|
||||
.unwrap_or_default(),
|
||||
|
||||
@@ -305,7 +305,7 @@ pub async fn get_update_from_hash(
|
||||
|
||||
bool
|
||||
})
|
||||
.sorted_by(|a, b| b.inner.date_published.cmp(&a.inner.date_published))
|
||||
.sorted_by(|a, b| a.inner.date_published.cmp(&b.inner.date_published))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if let Some(first) = versions.pop() {
|
||||
@@ -484,6 +484,7 @@ pub async fn update_files(
|
||||
for file in files.iter().filter(|x| x.project_id == project.inner.id) {
|
||||
let version = all_versions
|
||||
.iter()
|
||||
.filter(|x| x.inner.project_id == file.project_id)
|
||||
.filter(|x| {
|
||||
let mut bool = true;
|
||||
|
||||
@@ -589,6 +590,7 @@ pub async fn update_individual_files(
|
||||
if let Some(query_file) = update_data.hashes.iter().find(|x| &x.hash == hash) {
|
||||
let version = all_versions
|
||||
.iter()
|
||||
.filter(|x| x.inner.project_id == file.project_id)
|
||||
.filter(|x| {
|
||||
let mut bool = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user