Skip to content

Commit

Permalink
oops v2
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Sep 2, 2024
1 parent f13cc0e commit f2dc77b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/endpoints/mod_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ pub async fn download_version(
// only accepted mods can have their download counts incremented
// we'll just fix this once they're updated anyways

if mod_version.status == ModVersionStatusEnum::Accepted {
if (downloaded_version || downloaded_mod) && mod_version.status == ModVersionStatusEnum::Accepted {
tokio::spawn(async move {
if downloaded_version {
// we must nest more
if let Err(e) = ModVersion::increment_downloads(mod_version.id, &mut pool).await
{
log::error!(
"Failed increment downloads for mod version {}. Error: {}",
"Failed to increment downloads for mod version {}. Error: {}",
version,
e
);
Expand All @@ -221,7 +221,7 @@ pub async fn download_version(
if downloaded_mod {
if let Err(e) = Mod::increment_downloads(&mod_version.mod_id, &mut pool).await {
log::error!(
"Failed increment downloads for mod {}. Error: {}",
"Failed to increment downloads for mod {}. Error: {}",
name,
e
);
Expand Down

0 comments on commit f2dc77b

Please sign in to comment.