mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	fix(server): empty tag responses should be considered valid (#2993)
* accept empty tag array * renamed test
This commit is contained in:
		@@ -91,13 +91,13 @@ describe(SmartInfoService.name, () => {
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    it('should no update the smart info if no tags were returned', async () => {
 | 
			
		||||
    it('should always overwrite old tags', async () => {
 | 
			
		||||
      machineMock.classifyImage.mockResolvedValue([]);
 | 
			
		||||
 | 
			
		||||
      await sut.handleClassifyImage({ id: asset.id });
 | 
			
		||||
 | 
			
		||||
      expect(machineMock.classifyImage).toHaveBeenCalled();
 | 
			
		||||
      expect(smartMock.upsert).not.toHaveBeenCalled();
 | 
			
		||||
      expect(smartMock.upsert).toHaveBeenCalled();
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -41,10 +41,6 @@ export class SmartInfoService {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const tags = await this.machineLearning.classifyImage({ imagePath: asset.resizePath });
 | 
			
		||||
    if (tags.length === 0) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await this.repository.upsert({ assetId: asset.id, tags });
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user