fix(server): don't associate assets with Null Island (#5623)

* Don't associate assets with Null Island

* Fix lint
This commit is contained in:
Sushain Cherivirala
2023-12-11 07:00:23 -08:00
committed by GitHub
parent 960b68b02f
commit e3e4fb40fd
3 changed files with 59 additions and 28 deletions
@@ -304,6 +304,18 @@ describe(MetadataService.name, () => {
});
});
it('should discard latitude and longitude on null island', async () => {
assetMock.getByIds.mockResolvedValue([assetStub.withLocation]);
metadataMock.readTags.mockResolvedValue({
GPSLatitude: 0,
GPSLongitude: 0,
});
await sut.handleMetadataExtraction({ id: assetStub.image.id });
expect(assetMock.getByIds).toHaveBeenCalledWith([assetStub.image.id]);
expect(assetMock.upsertExif).toHaveBeenCalledWith(expect.objectContaining({ latitude: null, longitude: null }));
});
it('should not apply motion photos if asset is video', async () => {
assetMock.getByIds.mockResolvedValue([{ ...assetStub.livePhotoMotionAsset, isVisible: true }]);
mediaMock.probe.mockResolvedValue(probeStub.matroskaContainer);