0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-04-15 03:11:28 -05:00

feat(server): read Android and Sony video camera make/model ()

* feat(server): read Android and Sony video camera exif data

* Remove a logger line
This commit is contained in:
Snowknight26 2025-03-09 22:20:11 -05:00 committed by GitHub
parent 9870ad9687
commit 2f8e89c7ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 2 deletions

View file

@ -63,6 +63,14 @@ export interface ImmichTags extends Omit<Tags, TagsWithWrongTypes> {
Name?: string;
}[];
};
Device?: {
Manufacturer?: string;
ModelName?: string;
};
AndroidMake?: string;
AndroidModel?: string;
}
@Injectable()

View file

@ -1081,6 +1081,7 @@ describe(MetadataService.name, () => {
}),
);
});
it('should handle valid negative rating value', async () => {
mocks.asset.getByIds.mockResolvedValue([assetStub.image]);
mockReadTags({ Rating: -1 });
@ -1193,6 +1194,23 @@ describe(MetadataService.name, () => {
type: 'VIDEO',
});
});
it.each([
{ Make: '1', Model: '2', Device: { Manufacturer: '3', ModelName: '4' }, AndroidMake: '4', AndroidModel: '5' },
{ Device: { Manufacturer: '1', ModelName: '2' }, AndroidMake: '3', AndroidModel: '4' },
{ AndroidMake: '1', AndroidModel: '2' },
])('should read camera make and model correct place %s', async (metaData) => {
mocks.asset.getByIds.mockResolvedValue([assetStub.image]);
mockReadTags(metaData);
await sut.handleMetadataExtraction({ id: assetStub.image.id });
expect(mocks.asset.upsertExif).toHaveBeenCalledWith(
expect.objectContaining({
make: '1',
model: '2',
}),
);
});
});
describe('handleQueueSidecar', () => {

View file

@ -221,8 +221,8 @@ export class MetadataService extends BaseService {
colorspace: exifTags.ColorSpace ?? null,
// camera
make: exifTags.Make ?? null,
model: exifTags.Model ?? null,
make: exifTags.Make ?? exifTags?.Device?.Manufacturer ?? exifTags.AndroidMake ?? null,
model: exifTags.Model ?? exifTags?.Device?.ModelName ?? exifTags.AndroidModel ?? null,
fps: validate(Number.parseFloat(exifTags.VideoFrameRate!)),
iso: validate(exifTags.ISO) as number,
exposureTime: exifTags.ExposureTime ?? null,