Skip to content

Commit

Permalink
Increase max media size
Browse files Browse the repository at this point in the history
  • Loading branch information
Nonononoki committed Apr 1, 2024
1 parent c3448e7 commit a23c42a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/nonononoki/alovoa/html/ApiResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ public class ApiResource {

private static final long MAX_RESULTS = 50;

@Value("${app.media.max-size}")
@Value("${app.image.max-size}")
private int mediaMaxSize;

@Value("${app.interest.max}")
private int interestMaxSize;

@Value("${app.search.ignore-intention}")
private boolean ignoreIntention;

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/nonononoki/alovoa/rest/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public class UserController {

@Autowired
private UserService userService;

@Value("${app.media.max-size}")
@Value("${app.audio.max-size}")
private int audioMaxSize;
@Value("${app.image.max-size}")
private int mediaMaxSize;

// simple post to test session
Expand Down Expand Up @@ -116,7 +117,7 @@ public void deleteAudio() throws AlovoaException {
public void updateAudio(@RequestParam("file") MultipartFile file, @RequestParam("mime") String mimeType)
throws AlovoaException, UnsupportedAudioFileException, IOException {
byte[] bytes = file.getBytes();
if (bytes.length > mediaMaxSize) {
if (bytes.length > audioMaxSize) {
throw new AlovoaException(AlovoaException.MAX_MEDIA_SIZE_EXCEEDED);
}
userService.updateAudio(bytes, mimeType);
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ app.mail.plus-addressing=false
app.first-name.length-min=2
app.first-name.length-max=10
app.audio.max-time=10
app.media.max-size=2097152
app.audio.max-size=10000000
app.image.max-size=5000000
app.captcha.length=4
app.password-token.length=32
app.age.min=16
Expand Down

0 comments on commit a23c42a

Please sign in to comment.