Miscellaneous improvements and removals (#502)

This commit is contained in:
triphora
2022-12-23 15:19:15 -05:00
committed by GitHub
parent 16d5a70c08
commit 983e2df065
17 changed files with 1164 additions and 1792 deletions

View File

@@ -274,7 +274,7 @@ impl Project {
let result = sqlx::query!(
"
SELECT project_type, title, description, downloads, follows,
icon_url, body, body_url, published,
icon_url, body, published,
updated, approved, status, requested_status,
issues_url, source_url, wiki_url, discord_url, license_url,
team_id, client_side, server_side, license, slug,
@@ -296,7 +296,7 @@ impl Project {
title: row.title,
description: row.description,
downloads: row.downloads,
body_url: row.body_url,
body_url: None,
icon_url: row.icon_url,
published: row.published,
updated: row.updated,
@@ -341,7 +341,7 @@ impl Project {
let projects = sqlx::query!(
"
SELECT id, project_type, title, description, downloads, follows,
icon_url, body, body_url, published,
icon_url, body, published,
updated, approved, status, requested_status,
issues_url, source_url, wiki_url, discord_url, license_url,
team_id, client_side, server_side, license, slug,
@@ -361,7 +361,7 @@ impl Project {
title: m.title,
description: m.description,
downloads: m.downloads,
body_url: m.body_url,
body_url: None,
icon_url: m.icon_url,
published: m.published,
updated: m.updated,
@@ -662,7 +662,7 @@ impl Project {
let result = sqlx::query!(
"
SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,
m.icon_url icon_url, m.body body, m.body_url body_url, m.published published,
m.icon_url icon_url, m.body body, m.published published,
m.updated updated, m.approved approved, m.status status, m.requested_status requested_status,
m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url,
m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body,
@@ -700,7 +700,7 @@ impl Project {
title: m.title.clone(),
description: m.description.clone(),
downloads: m.downloads,
body_url: m.body_url.clone(),
body_url: None,
icon_url: m.icon_url.clone(),
published: m.published,
updated: m.updated,
@@ -790,7 +790,7 @@ impl Project {
sqlx::query!(
"
SELECT m.id id, m.project_type project_type, m.title title, m.description description, m.downloads downloads, m.follows follows,
m.icon_url icon_url, m.body body, m.body_url body_url, m.published published,
m.icon_url icon_url, m.body body, m.published published,
m.updated updated, m.approved approved, m.status status, m.requested_status requested_status,
m.issues_url issues_url, m.source_url source_url, m.wiki_url wiki_url, m.discord_url discord_url, m.license_url license_url,
m.team_id team_id, m.client_side client_side, m.server_side server_side, m.license license, m.slug slug, m.moderation_message moderation_message, m.moderation_message_body moderation_message_body,
@@ -829,7 +829,7 @@ impl Project {
title: m.title.clone(),
description: m.description.clone(),
downloads: m.downloads,
body_url: m.body_url.clone(),
body_url: None,
icon_url: m.icon_url.clone(),
published: m.published,
updated: m.updated,

View File

@@ -268,14 +268,13 @@ impl Version {
"
INSERT INTO versions (
id, mod_id, author_id, name, version_number,
changelog, changelog_url, date_published,
downloads, version_type, featured, status
changelog, date_published, downloads,
version_type, featured, status
)
VALUES (
$1, $2, $3, $4, $5,
$6, $7,
$8, $9,
$10, $11, $12
$6, $7, $8,
$9, $10, $11
)
",
self.id as VersionId,
@@ -284,7 +283,6 @@ impl Version {
&self.name,
&self.version_number,
self.changelog,
self.changelog_url.as_ref(),
self.date_published,
self.downloads,
&self.version_type,
@@ -508,7 +506,7 @@ impl Version {
let result = sqlx::query!(
"
SELECT v.mod_id, v.author_id, v.name, v.version_number,
v.changelog, v.changelog_url, v.date_published, v.downloads,
v.changelog, v.date_published, v.downloads,
v.version_type, v.featured, v.status, v.requested_status
FROM versions v
WHERE v.id = $1
@@ -526,7 +524,7 @@ impl Version {
name: row.name,
version_number: row.version_number,
changelog: row.changelog,
changelog_url: row.changelog_url,
changelog_url: None,
date_published: row.date_published,
downloads: row.downloads,
version_type: row.version_type,
@@ -555,7 +553,7 @@ impl Version {
let versions = sqlx::query!(
"
SELECT v.id, v.mod_id, v.author_id, v.name, v.version_number,
v.changelog, v.changelog_url, v.date_published, v.downloads,
v.changelog, v.date_published, v.downloads,
v.version_type, v.featured, v.status, v.requested_status
FROM versions v
WHERE v.id = ANY($1)
@@ -572,7 +570,7 @@ impl Version {
name: v.name,
version_number: v.version_number,
changelog: v.changelog,
changelog_url: v.changelog_url,
changelog_url: None,
date_published: v.date_published,
downloads: v.downloads,
featured: v.featured,
@@ -599,7 +597,7 @@ impl Version {
let result = sqlx::query!(
"
SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number,
v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads,
v.changelog changelog, v.date_published date_published, v.downloads downloads,
v.version_type version_type, v.featured featured, v.status status, v.requested_status requested_status,
JSONB_AGG(DISTINCT jsonb_build_object('version', gv.version, 'created', gv.created)) filter (where gv.version is not null) game_versions,
ARRAY_AGG(DISTINCT l.loader) filter (where l.loader is not null) loaders,
@@ -631,7 +629,7 @@ impl Version {
name: v.version_name,
version_number: v.version_number,
changelog: v.changelog,
changelog_url: v.changelog_url,
changelog_url: None,
date_published: v.date_published,
downloads: v.downloads,
version_type: v.version_type,
@@ -749,7 +747,7 @@ impl Version {
sqlx::query!(
"
SELECT v.id id, v.mod_id mod_id, v.author_id author_id, v.name version_name, v.version_number version_number,
v.changelog changelog, v.changelog_url changelog_url, v.date_published date_published, v.downloads downloads,
v.changelog changelog, v.date_published date_published, v.downloads downloads,
v.version_type version_type, v.featured featured, v.status status, v.requested_status requested_status,
JSONB_AGG(DISTINCT jsonb_build_object('version', gv.version, 'created', gv.created)) filter (where gv.version is not null) game_versions,
ARRAY_AGG(DISTINCT l.loader) filter (where l.loader is not null) loaders,
@@ -781,7 +779,7 @@ impl Version {
name: v.version_name,
version_number: v.version_number,
changelog: v.changelog,
changelog_url: v.changelog_url,
changelog_url: None,
date_published: v.date_published,
downloads: v.downloads,
version_type: v.version_type,