mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Make the Persons cache distinct on the MediaEntry
This commit is contained in:
parent
d53af51be2
commit
939f17add2
@ -228,7 +228,8 @@ export class IndexingManager implements IIndexingManager {
|
||||
|
||||
const scannedFaces = (media[i].metadata as PhotoMetadata).faces || [];
|
||||
if ((media[i].metadata as PhotoMetadata).faces) { // if it has faces, cache them
|
||||
(media[i].metadata as PhotoMetadataEntity).persons = (media[i].metadata as PhotoMetadata).faces.map(f => f.name);
|
||||
// make the list distinct (some photos may contain the same person multiple times)
|
||||
(media[i].metadata as PhotoMetadataEntity).persons = [...new Set((media[i].metadata as PhotoMetadata).faces.map(f => f.name))];
|
||||
}
|
||||
delete (media[i].metadata as PhotoMetadata).faces; // this is a separated DB, lets save separately
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user