File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ use sqlx::PgConnection;
33pub async fn start ( pool : & mut PgConnection ) -> Result < ( ) , String > {
44 // update mod_versions counts
55 if let Err ( e) = sqlx:: query!(
6- "UPDATE mod_versions mv SET download_count = mv.download_count + (
6+ "UPDATE mod_versions mv SET download_count = (
77 SELECT COUNT(DISTINCT md.ip) FROM mod_downloads md
8- WHERE md.mod_version_id = mv.id AND md.time_downloaded > mv.last_download_cache_refresh
8+ WHERE md.mod_version_id = mv.id
99 ), last_download_cache_refresh = now()
1010 FROM mod_version_statuses mvs
1111 WHERE mv.status_id = mvs.id AND mvs.status = 'accepted'"
Original file line number Diff line number Diff line change @@ -698,9 +698,9 @@ impl ModVersion {
698698 ) -> Result < ( ) , ApiError > {
699699 if let Err ( e) = sqlx:: query!(
700700 "UPDATE mod_versions mv
701- SET download_count = mv.download_count + (
701+ SET download_count = (
702702 SELECT COUNT(DISTINCT md.ip) FROM mod_downloads md
703- WHERE md.mod_version_id = mv.id AND md.time_downloaded > mv.last_download_cache_refresh
703+ WHERE md.mod_version_id = mv.id
704704 ), last_download_cache_refresh = now()
705705 FROM mod_version_statuses mvs
706706 WHERE mv.id = $1 AND mvs.mod_version_id = mv.id AND mvs.status = 'accepted'" ,
You can’t perform that action at this time.
0 commit comments