diff --git a/src/main/java/io/papermc/bibliothek/controller/v2/DownloadController.java b/src/main/java/io/papermc/bibliothek/controller/v2/DownloadController.java index 7ef1d93..4d93cd4 100644 --- a/src/main/java/io/papermc/bibliothek/controller/v2/DownloadController.java +++ b/src/main/java/io/papermc/bibliothek/controller/v2/DownloadController.java @@ -168,7 +168,7 @@ public ResponseEntity downloadSpecific( final Version version = this.versions.findCorrectVersion(project._id(), versionName).orElseThrow(VersionNotFound::new); final Build build = this.builds.findByProjectAndVersionAndNumber(project._id(), version._id(), buildNumber).orElseThrow(BuildNotFound::new); - Build.Download download = build.downloads().get(downloadName); + final Build.Download download = build.downloads().get(downloadName); if (download == null) { throw new DownloadNotFound(); } diff --git a/src/main/java/io/papermc/bibliothek/database/repository/BuildCollection.java b/src/main/java/io/papermc/bibliothek/database/repository/BuildCollection.java index ad071a1..39d6d64 100644 --- a/src/main/java/io/papermc/bibliothek/database/repository/BuildCollection.java +++ b/src/main/java/io/papermc/bibliothek/database/repository/BuildCollection.java @@ -30,7 +30,6 @@ import org.bson.types.ObjectId; import org.springframework.data.mongodb.repository.Aggregation; import org.springframework.data.mongodb.repository.MongoRepository; -import org.springframework.data.mongodb.repository.Query; import org.springframework.stereotype.Repository; @Repository diff --git a/src/main/java/io/papermc/bibliothek/database/repository/VersionCollection.java b/src/main/java/io/papermc/bibliothek/database/repository/VersionCollection.java index 20b9fb9..80c6348 100644 --- a/src/main/java/io/papermc/bibliothek/database/repository/VersionCollection.java +++ b/src/main/java/io/papermc/bibliothek/database/repository/VersionCollection.java @@ -29,7 +29,6 @@ import org.bson.types.ObjectId; import org.springframework.data.mongodb.repository.Aggregation; import org.springframework.data.mongodb.repository.MongoRepository; -import org.springframework.data.mongodb.repository.Query; import org.springframework.stereotype.Repository; @Repository @@ -46,8 +45,8 @@ public interface VersionCollection extends MongoRepository { default Optional findCorrectVersion(final ObjectId project, final String name) { if ("latest".equals(name)) { // when project exists, it has to have at least one version - return Optional.of(findLatestVersion(project)); + return Optional.of(this.findLatestVersion(project)); } - return findByProjectAndName(project, name); + return this.findByProjectAndName(project, name); } }