mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Remove thumbnail generation on mobile app (#292)
* Remove thumbnail generation on mobile * Remove tconditions for missing thumbnail on the backend * Remove console.log * Refactor queue systems * Convert queue and processor name to constant * Added corresponding interface to job queue
This commit is contained in:
23
server/libs/job/src/constants/job-name.constant.ts
Normal file
23
server/libs/job/src/constants/job-name.constant.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Asset Uploaded Queue Jobs
|
||||
*/
|
||||
export const assetUploadedProcessorName = 'asset-uploaded';
|
||||
|
||||
/**
|
||||
* Video Conversion Queue Jobs
|
||||
**/
|
||||
export const mp4ConversionProcessorName = 'mp4-conversion';
|
||||
|
||||
/**
|
||||
* Thumbnail Generator Queue Jobs
|
||||
*/
|
||||
export const generateJPEGThumbnailProcessorName = 'generate-jpeg-thumbnail';
|
||||
export const generateWEBPThumbnailProcessorName = 'generate-webp-thumbnail';
|
||||
|
||||
/**
|
||||
* Metadata Extraction Queue Jobs
|
||||
*/
|
||||
export const exifExtractionProcessorName = 'exif-extraction';
|
||||
export const videoLengthExtractionProcessorName = 'extract-video-length';
|
||||
export const objectDetectionProcessorName = 'detect-object';
|
||||
export const imageTaggingProcessorName = 'tag-image';
|
||||
4
server/libs/job/src/constants/queue-name.constant.ts
Normal file
4
server/libs/job/src/constants/queue-name.constant.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const thumbnailGeneratorQueueName = 'thumbnail-generator-queue';
|
||||
export const assetUploadedQueueName = 'asset-uploaded-queue';
|
||||
export const metadataExtractionQueueName = 'metadata-extraction-queue';
|
||||
export const videoConversionQueueName = 'video-conversion-queue';
|
||||
7
server/libs/job/src/index.ts
Normal file
7
server/libs/job/src/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './interfaces/asset-uploaded.interface';
|
||||
export * from './interfaces/metadata-extraction.interface';
|
||||
export * from './interfaces/video-transcode.interface';
|
||||
export * from './interfaces/thumbnail-generation.interface';
|
||||
|
||||
export * from './constants/job-name.constant';
|
||||
export * from './constants/queue-name.constant';
|
||||
18
server/libs/job/src/interfaces/asset-uploaded.interface.ts
Normal file
18
server/libs/job/src/interfaces/asset-uploaded.interface.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { AssetEntity } from '@app/database/entities/asset.entity';
|
||||
|
||||
export interface IAssetUploadedJob {
|
||||
/**
|
||||
* The Asset entity that was saved in the database
|
||||
*/
|
||||
asset: AssetEntity;
|
||||
|
||||
/**
|
||||
* Original file name
|
||||
*/
|
||||
fileName: string;
|
||||
|
||||
/**
|
||||
* File size in byte
|
||||
*/
|
||||
fileSize: number;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { AssetEntity } from '@app/database/entities/asset.entity';
|
||||
|
||||
export interface IExifExtractionProcessor {
|
||||
/**
|
||||
* The Asset entity that was saved in the database
|
||||
*/
|
||||
asset: AssetEntity;
|
||||
|
||||
/**
|
||||
* Original file name
|
||||
*/
|
||||
fileName: string;
|
||||
|
||||
/**
|
||||
* File size in byte
|
||||
*/
|
||||
fileSize: number;
|
||||
}
|
||||
|
||||
export interface IVideoLengthExtractionProcessor {
|
||||
/**
|
||||
* The Asset entity that was saved in the database
|
||||
*/
|
||||
asset: AssetEntity;
|
||||
}
|
||||
|
||||
export type IMetadataExtractionJob = IExifExtractionProcessor | IVideoLengthExtractionProcessor;
|
||||
@@ -0,0 +1,17 @@
|
||||
import { AssetEntity } from '@app/database/entities/asset.entity';
|
||||
|
||||
export interface JpegGeneratorProcessor {
|
||||
/**
|
||||
* The Asset entity that was saved in the database
|
||||
*/
|
||||
asset: AssetEntity;
|
||||
}
|
||||
|
||||
export interface WebpGeneratorProcessor {
|
||||
/**
|
||||
* The Asset entity that was saved in the database
|
||||
*/
|
||||
asset: AssetEntity;
|
||||
}
|
||||
|
||||
export type IThumbnailGenerationJob = JpegGeneratorProcessor | WebpGeneratorProcessor;
|
||||
10
server/libs/job/src/interfaces/video-transcode.interface.ts
Normal file
10
server/libs/job/src/interfaces/video-transcode.interface.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { AssetEntity } from '@app/database/entities/asset.entity';
|
||||
|
||||
export interface IMp4ConversionProcessor {
|
||||
/**
|
||||
* The Asset entity that was saved in the database
|
||||
*/
|
||||
asset: AssetEntity;
|
||||
}
|
||||
|
||||
export type IVideoTranscodeJob = IMp4ConversionProcessor;
|
||||
9
server/libs/job/tsconfig.lib.json
Normal file
9
server/libs/job/tsconfig.lib.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "../../dist/libs/job"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user