mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 15:17:05 -08:00
* Implementing video upload features * setup image resize processor * Add video thumbnail with duration and icon * Fixed issue with video upload timeout and upper case file type on ios * Added video player page * Added video player page * Fixing video player not play on ios * Added partial file streaming for ios/android video request * Added nginx as proxy server for better file serving * update nginx and docker-compose file * Video player working correctly * Video player working correctly * Split duration to the second
40 lines
890 B
TypeScript
40 lines
890 B
TypeScript
import { InjectQueue } from '@nestjs/bull';
|
|
import { Injectable } from '@nestjs/common';
|
|
import { Queue } from 'bull';
|
|
import { randomUUID } from 'crypto';
|
|
import { AssetEntity } from '../../api-v1/asset/entities/asset.entity';
|
|
|
|
@Injectable()
|
|
export class AssetOptimizeService {
|
|
constructor(@InjectQueue('optimize') private optimizeQueue: Queue) {}
|
|
|
|
public async resizeImage(savedAsset: AssetEntity) {
|
|
const job = await this.optimizeQueue.add(
|
|
'resize-image',
|
|
{
|
|
savedAsset,
|
|
},
|
|
{ jobId: randomUUID() },
|
|
);
|
|
|
|
return {
|
|
jobId: job.id,
|
|
};
|
|
}
|
|
|
|
public async getVideoThumbnail(savedAsset: AssetEntity, filename: String) {
|
|
const job = await this.optimizeQueue.add(
|
|
'get-video-thumbnail',
|
|
{
|
|
savedAsset,
|
|
filename,
|
|
},
|
|
{ jobId: randomUUID() },
|
|
);
|
|
|
|
return {
|
|
jobId: job.id,
|
|
};
|
|
}
|
|
}
|