Skip to content

Commit

Permalink
Uploaders checks added
Browse files Browse the repository at this point in the history
  • Loading branch information
mrglaster committed Jun 30, 2023
1 parent fae096c commit 0728564
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ private static String generateLatestPluginGetQuery(String game, String name){


private static boolean isBundleNameAvailable(BundleUploadRequest request){
String query = "SELECT COUNT(*) FROM bundles WHERE name='" + request.getName() + "';";
String query = "SELECT COUNT(*) FROM bundles WHERE name='" + request.getName() + "' AND content_type=" + request.contentTypeToId() + ';';;
return ServerApplication.jdbcTemplate.queryForObject(query, Integer.class) == 0;
}


private static String processMapBundle(BundleUploadRequest request){
String bundleCheckQuery = "SELECT COUNT(*) FROM bundles WHERE name='" + request.getName() + "' AND content_type=" + request.contentTypeToId() + ';';
if (ServerApplication.jdbcTemplate.queryForObject(bundleCheckQuery, Integer.class) != 0){
return StatusResponses.generateBadResourceNameError();
}

String query = generateMapsGettingQuery(request);
List<Integer> ids = ServerApplication.jdbcTemplate.queryForList(query, Integer.class);
JsonObject response = new JsonObject();
Expand Down

0 comments on commit 0728564

Please sign in to comment.