@@ -19,6 +19,7 @@ import {
19
19
import { ArgOf , ArgsOf } from 'src/repositories/event.repository' ;
20
20
import { BaseService } from 'src/services/base.service' ;
21
21
import { ConcurrentQueueName , JobItem } from 'src/types' ;
22
+ import { hexOrBufferToBase64 } from 'src/utils/bytes' ;
22
23
23
24
const asJobItem = ( dto : JobCreateDto ) : JobItem => {
24
25
switch ( dto . name ) {
@@ -304,6 +305,54 @@ export class JobService extends BaseService {
304
305
await this . jobRepository . queueAll ( jobs ) ;
305
306
if ( asset . visibility === AssetVisibility . TIMELINE || asset . visibility === AssetVisibility . ARCHIVE ) {
306
307
this . eventRepository . clientSend ( 'on_upload_success' , asset . ownerId , mapAsset ( asset ) ) ;
308
+ if ( asset . exifInfo ) {
309
+ const exif = asset . exifInfo ;
310
+ this . eventRepository . clientSend ( 'AssetUploadReadyV1' , asset . ownerId , {
311
+ // TODO remove `on_upload_success` and then modify the query to select only the required fields)
312
+ asset : {
313
+ id : asset . id ,
314
+ ownerId : asset . ownerId ,
315
+ originalFileName : asset . originalFileName ,
316
+ thumbhash : asset . thumbhash ? hexOrBufferToBase64 ( asset . thumbhash ) : null ,
317
+ checksum : hexOrBufferToBase64 ( asset . checksum ) ,
318
+ fileCreatedAt : asset . fileCreatedAt ,
319
+ fileModifiedAt : asset . fileModifiedAt ,
320
+ localDateTime : asset . localDateTime ,
321
+ duration : asset . duration ,
322
+ type : asset . type ,
323
+ deletedAt : asset . deletedAt ,
324
+ isFavorite : asset . isFavorite ,
325
+ visibility : asset . visibility ,
326
+ } ,
327
+ exif : {
328
+ assetId : exif . assetId ,
329
+ description : exif . description ,
330
+ exifImageWidth : exif . exifImageWidth ,
331
+ exifImageHeight : exif . exifImageHeight ,
332
+ fileSizeInByte : exif . fileSizeInByte ,
333
+ orientation : exif . orientation ,
334
+ dateTimeOriginal : exif . dateTimeOriginal ,
335
+ modifyDate : exif . modifyDate ,
336
+ timeZone : exif . timeZone ,
337
+ latitude : exif . latitude ,
338
+ longitude : exif . longitude ,
339
+ projectionType : exif . projectionType ,
340
+ city : exif . city ,
341
+ state : exif . state ,
342
+ country : exif . country ,
343
+ make : exif . make ,
344
+ model : exif . model ,
345
+ lensModel : exif . lensModel ,
346
+ fNumber : exif . fNumber ,
347
+ focalLength : exif . focalLength ,
348
+ iso : exif . iso ,
349
+ exposureTime : exif . exposureTime ,
350
+ profileDescription : exif . profileDescription ,
351
+ rating : exif . rating ,
352
+ fps : exif . fps ,
353
+ } ,
354
+ } ) ;
355
+ }
307
356
}
308
357
309
358
break ;
0 commit comments