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,
|
client: &clickhouse::Client,
|
||||||
) -> Result<(), ApiError> {
|
) -> Result<(), ApiError> {
|
||||||
let start: DateTime<Utc> = DateTime::from_utc(
|
let start: DateTime<Utc> = DateTime::from_utc(
|
||||||
Utc::now()
|
(Utc::now() - Duration::days(1))
|
||||||
.date_naive()
|
.date_naive()
|
||||||
.and_hms_nano_opt(0, 0, 0, 0)
|
.and_hms_nano_opt(0, 0, 0, 0)
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ pub async fn get_update_from_hash(
|
|||||||
|
|
||||||
bool
|
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<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
if let Some(first) = versions.pop() {
|
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) {
|
for file in files.iter().filter(|x| x.project_id == project.inner.id) {
|
||||||
let version = all_versions
|
let version = all_versions
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|x| x.inner.project_id == file.project_id)
|
||||||
.filter(|x| {
|
.filter(|x| {
|
||||||
let mut bool = true;
|
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) {
|
if let Some(query_file) = update_data.hashes.iter().find(|x| &x.hash == hash) {
|
||||||
let version = all_versions
|
let version = all_versions
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|x| x.inner.project_id == file.project_id)
|
||||||
.filter(|x| {
|
.filter(|x| {
|
||||||
let mut bool = true;
|
let mut bool = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user