mirror of
https://github.com/immich-app/immich.git
synced 2025-11-14 23:12:51 +09:00
refactor(server): imports and repository tokens (#1220)
* refactor: entity imports * refactor: rename user repository token * chore: merge imports * refactor: rename album repository token * refactor: rename asset repository token * refactor: rename tag repository token
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AssetEntity } from '@app/database/entities/asset.entity';
|
||||
import { SmartInfoEntity } from '@app/database/entities/smart-info.entity';
|
||||
import { AssetEntity } from '@app/database';
|
||||
import { SmartInfoEntity } from '@app/database';
|
||||
import { MachineLearningJobNameEnum, QueueNameEnum } from '@app/job';
|
||||
import { IMachineLearningJob } from '@app/job/interfaces/machine-learning.interface';
|
||||
import { Process, Processor } from '@nestjs/bull';
|
||||
@@ -22,12 +22,9 @@ export class MachineLearningProcessor {
|
||||
async tagImage(job: Job<IMachineLearningJob>) {
|
||||
const { asset } = job.data;
|
||||
|
||||
const res = await axios.post(
|
||||
immich_machine_learning_url + '/image-classifier/tag-image',
|
||||
{
|
||||
thumbnailPath: asset.resizePath,
|
||||
},
|
||||
);
|
||||
const res = await axios.post(immich_machine_learning_url + '/image-classifier/tag-image', {
|
||||
thumbnailPath: asset.resizePath,
|
||||
});
|
||||
|
||||
if (res.status == 201 && res.data.length > 0) {
|
||||
const smartInfo = new SmartInfoEntity();
|
||||
@@ -45,12 +42,9 @@ export class MachineLearningProcessor {
|
||||
try {
|
||||
const { asset }: { asset: AssetEntity } = job.data;
|
||||
|
||||
const res = await axios.post(
|
||||
immich_machine_learning_url + '/object-detection/detect-object',
|
||||
{
|
||||
thumbnailPath: asset.resizePath,
|
||||
},
|
||||
);
|
||||
const res = await axios.post(immich_machine_learning_url + '/object-detection/detect-object', {
|
||||
thumbnailPath: asset.resizePath,
|
||||
});
|
||||
|
||||
if (res.status == 201 && res.data.length > 0) {
|
||||
const smartInfo = new SmartInfoEntity();
|
||||
|
||||
Reference in New Issue
Block a user