mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-02 15:26:33 +00:00
feat(server): add originalFileName to asset table (#2231)
This commit is contained in:
@@ -2,6 +2,7 @@ import { AuthUserDto, IJobRepository, JobName } from '@app/domain';
|
||||
import { AssetEntity, UserEntity } from '@app/infra/entities';
|
||||
import { IAssetRepository } from './asset-repository';
|
||||
import { CreateAssetDto, UploadFile } from './dto/create-asset.dto';
|
||||
import { parse } from 'node:path';
|
||||
|
||||
export class AssetCore {
|
||||
constructor(private repository: IAssetRepository, private jobRepository: IJobRepository) {}
|
||||
@@ -35,6 +36,7 @@ export class AssetCore {
|
||||
encodedVideoPath: null,
|
||||
tags: [],
|
||||
sharedLinks: [],
|
||||
originalFileName: parse(file.originalName).name,
|
||||
});
|
||||
|
||||
await this.jobRepository.queue({ name: JobName.ASSET_UPLOADED, data: { asset, fileName: file.originalName } });
|
||||
|
||||
@@ -10,9 +10,6 @@ export class CreateExifDto {
|
||||
@IsOptional()
|
||||
model?: string;
|
||||
|
||||
@IsOptional()
|
||||
imageName?: string;
|
||||
|
||||
@IsOptional()
|
||||
exifImageWidth?: number;
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ export class DownloadService {
|
||||
let fileCount = 0;
|
||||
let complete = true;
|
||||
|
||||
for (const { id, originalPath, exifInfo } of assets) {
|
||||
const name = `${exifInfo?.imageName || id}${extname(originalPath)}`;
|
||||
for (const { originalPath, exifInfo, originalFileName } of assets) {
|
||||
const name = `${originalFileName}${extname(originalPath)}`;
|
||||
archive.file(originalPath, { name });
|
||||
totalSize += Number(exifInfo?.fileSizeInByte || 0);
|
||||
fileCount++;
|
||||
|
||||
Reference in New Issue
Block a user