@@ -728,42 +728,29 @@ class Files @Inject()(
728728 " content-type" -> file.contentType,
729729 " date-created" -> file.uploadDate.toString(),
730730 " size" -> file.length.toString,
731+ " thumbnail" -> file.thumbnail_id.orNull,
731732 " authorId" -> file.author.id.stringify,
732733 " status" -> file.status)
733734
734735 // Only include filepath if using DiskByte storage and user is serverAdmin
735736 val jsonMap = file.loader match {
736737 case " services.filesystem.DiskByteStorageService" => {
737738 if (serverAdmin)
738- Map (
739- " id" -> file.id.toString,
740- " filename" -> file.filename,
741- " filepath" -> file.loader_id,
742- " filedescription" -> file.description,
743- " content-type" -> file.contentType,
744- " date-created" -> file.uploadDate.toString(),
745- " size" -> file.length.toString,
746- " authorId" -> file.author.id.stringify,
747- " status" -> file.status)
739+ defaultMap ++ Map (
740+ " filepath" -> file.loader_id
741+ )
748742 else
749743 defaultMap
750744 }
751745 case " services.s3.S3ByteStorageService" => {
752746 if (serverAdmin) {
753747 val bucketName = configuration.getString(S3ByteStorageService .BucketName ).getOrElse(" " )
754748 val serviceEndpoint = configuration.getString(S3ByteStorageService .ServiceEndpoint ).getOrElse(" " )
755- Map (
756- " id" -> file.id.toString,
757- " filename" -> file.filename,
749+ defaultMap ++ Map (
758750 " service-endpoint" -> serviceEndpoint,
759751 " bucket-name" -> bucketName,
760- " object-key" -> file.loader_id,
761- " filedescription" -> file.description,
762- " content-type" -> file.contentType,
763- " date-created" -> file.uploadDate.toString(),
764- " size" -> file.length.toString,
765- " authorId" -> file.author.id.stringify,
766- " status" -> file.status)
752+ " object-key" -> file.loader_id
753+ )
767754 } else
768755 defaultMap
769756 }
0 commit comments