瀏覽代碼

fix 331 (#335)

* fix #331 - Video with no date information in EXIF upload via web caused mobile client not able to render other assets
Alex 3 年之前
父節點
當前提交
c60e852226

+ 0 - 1
server/apps/immich/src/api-v1/asset/asset.controller.ts

@@ -72,7 +72,6 @@ export class AssetController {
   ): Promise<AssetFileUploadResponseDto> {
     try {
       const savedAsset = await this.assetService.createUserAsset(authUser, assetInfo, file.path, file.mimetype);
-
       if (!savedAsset) {
         throw new BadRequestException('Asset not created');
       }

+ 5 - 1
server/apps/microservices/src/processors/metadata-extraction.processor.ts

@@ -181,9 +181,13 @@ export class MetadataExtractionProcessor {
         if (videoTags) {
           if (videoTags['com.apple.quicktime.creationdate']) {
             createdAt = String(videoTags['com.apple.quicktime.creationdate']);
-          } else {
+          } else if (videoTags['creation_time']) {
             createdAt = String(videoTags['creation_time']);
+          } else {
+            createdAt = asset.createdAt;
           }
+        } else {
+          createdAt = asset.createdAt;
         }
 
         await this.assetRepository.update({ id: asset.id }, { duration: durationString, createdAt: createdAt });