From 0edc3e44377adc3081362c50a0eac6d858bba5fe Mon Sep 17 00:00:00 2001 From: GP Garcia Date: Fri, 29 Mar 2024 01:21:14 -0500 Subject: [PATCH] Added featured tag to support levels --- API.md | 6 +++--- src/constants.php | 1 + src/routes/asset.php | 2 +- templates/asset.phtml | 1 + templates/assets.phtml | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/API.md b/API.md index 9bdb3c2..4d5558b 100644 --- a/API.md +++ b/API.md @@ -130,7 +130,7 @@ Get a list of categories (needed for filtering assets) and potentially a login U ```http ?type=(any|addon|project) &category=(category id) -&support=(official|community|testing) +&support=(official|featured|community|testing) &filter=(search text) &user=(submitter username) &cost=(license) @@ -173,7 +173,7 @@ Get a list of assets. Some notes: * Leading and trailing whitespace in `filter` is trimmed on the server side. * For legacy purposes, not supplying godot version would list only 2.1 assets, while not supplying type would list only addons. -* To specify multiple support levels, join them with `+`, e.g. `support=official+community`. +* To specify multiple support levels, join them with `+`, e.g. `support=featured+community`. * Godot version can be specified as you see fit, for example, `godot_version=3.1` or `godot_version=3.1.5`. Currently, the patch version is disregarded, but may be honored in the future.
@@ -267,7 +267,7 @@ Revert a deletion of an asset. Useable by moderators and the owner of the asset. ### `POST /asset/{id}/support_level` ```json { - "support_level": "official|community|testing", + "support_level": "official|featured|community|testing", "token": "…" } ``` diff --git a/src/constants.php b/src/constants.php index fb55caf..4a42fad 100644 --- a/src/constants.php +++ b/src/constants.php @@ -30,6 +30,7 @@ return $constants = [ 'testing' => 0, 'community' => 1, 'official' => 2, + 'featured' => 2, ]), 'user_type' => double_map([ 'normal' => 0, diff --git a/src/routes/asset.php b/src/routes/asset.php index 4f87c21..9fc127e 100644 --- a/src/routes/asset.php +++ b/src/routes/asset.php @@ -99,7 +99,7 @@ $app->get('/asset', function ($request, $response, $args) { } if (count($support_levels) === 0) { - $support_levels = [0, 1, 2]; // Testing + Community + Official + $support_levels = [0, 1, 2]; // Testing + Community + Official / Featured } $support_levels = implode('|', $support_levels); diff --git a/templates/asset.phtml b/templates/asset.phtml index 55f62c0..db6f86c 100644 --- a/templates/asset.phtml +++ b/templates/asset.phtml @@ -18,6 +18,7 @@ diff --git a/templates/assets.phtml b/templates/assets.phtml index 830f3aa..cdce089 100644 --- a/templates/assets.phtml +++ b/templates/assets.phtml @@ -114,6 +114,7 @@