mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
Fixed filename duplication when upload from web (#288)
* Fixed filename duplication when upload from web * Fixed cosmetic of detail panel view
This commit is contained in:
parent
c4ef523564
commit
663f12851e
3 changed files with 20 additions and 5 deletions
|
@ -279,7 +279,6 @@ export class AssetService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sending Partial Content With HTTP Code 206 */
|
/** Sending Partial Content With HTTP Code 206 */
|
||||||
console.log('Send Range', range);
|
|
||||||
res.status(206).set({
|
res.status(206).set({
|
||||||
'Content-Range': `bytes ${start}-${end}/${size}`,
|
'Content-Range': `bytes ${start}-${end}/${size}`,
|
||||||
'Accept-Ranges': 'bytes',
|
'Accept-Ranges': 'bytes',
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { Logger } from '@nestjs/common';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { SmartInfoEntity } from '@app/database/entities/smart-info.entity';
|
import { SmartInfoEntity } from '@app/database/entities/smart-info.entity';
|
||||||
import ffmpeg from 'fluent-ffmpeg';
|
import ffmpeg from 'fluent-ffmpeg';
|
||||||
// import moment from 'moment';
|
import path from 'path';
|
||||||
|
|
||||||
@Processor('metadata-extraction-queue')
|
@Processor('metadata-extraction-queue')
|
||||||
export class MetadataExtractionProcessor {
|
export class MetadataExtractionProcessor {
|
||||||
|
@ -48,7 +48,7 @@ export class MetadataExtractionProcessor {
|
||||||
newExif.assetId = asset.id;
|
newExif.assetId = asset.id;
|
||||||
newExif.make = exifData['Make'] || null;
|
newExif.make = exifData['Make'] || null;
|
||||||
newExif.model = exifData['Model'] || null;
|
newExif.model = exifData['Model'] || null;
|
||||||
newExif.imageName = fileName || null;
|
newExif.imageName = path.parse(fileName).name || null;
|
||||||
newExif.exifImageHeight = exifData['ExifImageHeight'] || null;
|
newExif.exifImageHeight = exifData['ExifImageHeight'] || null;
|
||||||
newExif.exifImageWidth = exifData['ExifImageWidth'] || null;
|
newExif.exifImageWidth = exifData['ExifImageWidth'] || null;
|
||||||
newExif.fileSizeInByte = fileSize || null;
|
newExif.fileSizeInByte = fileSize || null;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
import type { ImmichAsset } from '../../models/immich-asset';
|
import type { ImmichAsset } from '../../models/immich-asset';
|
||||||
import { createEventDispatcher, onMount } from 'svelte';
|
import { createEventDispatcher, onMount } from 'svelte';
|
||||||
import { browser } from '$app/env';
|
import { browser } from '$app/env';
|
||||||
|
import { round } from 'lodash';
|
||||||
|
|
||||||
// Map Property
|
// Map Property
|
||||||
let map: any;
|
let map: any;
|
||||||
|
@ -80,6 +81,16 @@
|
||||||
return `${sizeInByte}B`;
|
return `${sizeInByte}B`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getMegapixel = (width: number, height: number): number | undefined => {
|
||||||
|
const megapixel = Math.round((height * width) / 1_000_000);
|
||||||
|
|
||||||
|
if (megapixel) {
|
||||||
|
return megapixel;
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="p-2">
|
<section class="p-2">
|
||||||
|
@ -129,8 +140,13 @@
|
||||||
<div>
|
<div>
|
||||||
<p>{`${asset.exifInfo.imageName}.${asset.originalPath.split('.')[1]}` || ''}</p>
|
<p>{`${asset.exifInfo.imageName}.${asset.originalPath.split('.')[1]}` || ''}</p>
|
||||||
<div class="flex text-sm gap-2">
|
<div class="flex text-sm gap-2">
|
||||||
<p>{((asset.exifInfo.exifImageHeight * asset.exifInfo.exifImageWidth) / 1_000_000).toFixed(0)}MP</p>
|
{#if asset.exifInfo.exifImageHeight && asset.exifInfo.exifImageWidth}
|
||||||
|
{#if getMegapixel(asset.exifInfo.exifImageHeight, asset.exifInfo.exifImageWidth)}
|
||||||
|
<p>{getMegapixel(asset.exifInfo.exifImageHeight, asset.exifInfo.exifImageWidth)}MP</p>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<p>{asset.exifInfo.exifImageHeight} x {asset.exifInfo.exifImageWidth}</p>
|
<p>{asset.exifInfo.exifImageHeight} x {asset.exifInfo.exifImageWidth}</p>
|
||||||
|
{/if}
|
||||||
<p>{getHumanReadableString(asset.exifInfo.fileSizeInByte)}</p>
|
<p>{getHumanReadableString(asset.exifInfo.fileSizeInByte)}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue