mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-17 08:15:44 +00:00
Fix bug in avatar upload
This commit is contained in:
@@ -53,7 +53,7 @@ class ImageEndpoint(
|
|||||||
fun uploadAvatar(@RequestParam("file") file: MultipartFile) {
|
fun uploadAvatar(@RequestParam("file") file: MultipartFile) {
|
||||||
val auth: Authentication = SecurityContextHolder.getContext().authentication
|
val auth: Authentication = SecurityContextHolder.getContext().authentication
|
||||||
|
|
||||||
val image: Image = if (userService.hasAvatar(auth.name)) {
|
val image: Image = if (!userService.hasAvatar(auth.name)) {
|
||||||
imageService.createFile(ImageType.AVATAR, file.inputStream, file.contentType!!)
|
imageService.createFile(ImageType.AVATAR, file.inputStream, file.contentType!!)
|
||||||
} else {
|
} else {
|
||||||
val existingAvatar = userService.getAvatar(auth.name)!!
|
val existingAvatar = userService.getAvatar(auth.name)!!
|
||||||
|
|||||||
Reference in New Issue
Block a user