@@ -650,8 +650,9 @@ func (a *Asset) containsTag(tagValue string) bool {
650650// - bool: true if asset meets all criteria, false otherwise
651651func (a * Asset ) isValidAsset (requestID , deviceID string , allowedTypes []AssetType , wantedRatio ImageOrientation ) bool {
652652 return a .hasValidBasicProperties (allowedTypes , wantedRatio ) &&
653- a .hasValidDateFilter () &&
653+ a .hasValidFilterDate () &&
654654 a .hasValidPartners () &&
655+ a .hasValidFilterExcludeFaces (requestID , deviceID ) &&
655656 a .hasValidAlbums (requestID , deviceID ) &&
656657 a .hasValidPeople (requestID , deviceID ) &&
657658 a .hasValidTags (requestID , deviceID )
@@ -707,12 +708,12 @@ func (a *Asset) isAnimatedGif() bool {
707708 return totalSeconds > 0
708709}
709710
710- // hasValidDateFilter validates if the asset's date matches the configured date filter criteria.
711+ // hasValidFilterDate validates if the asset's date matches the configured date filter criteria.
711712// Assets from DateRange buckets bypass the date filter check.
712713//
713714// Returns:
714715// - bool: true if date is valid or no filter set, false if outside filter range
715- func (a * Asset ) hasValidDateFilter () bool {
716+ func (a * Asset ) hasValidFilterDate () bool {
716717 if a .requestConfig .FilterDate == "" || a .Bucket == kiosk .SourceDateRange {
717718 return true
718719 }
@@ -726,6 +727,22 @@ func (a *Asset) hasValidDateFilter() bool {
726727 return utils .IsTimeBetween (a .LocalDateTime .Local (), dateStart , dateEnd )
727728}
728729
730+ // hasValidFilterExcludeFaces validates if the asset has no faces assigned.
731+ //
732+ // Returns:
733+ // - bool: true if no faces are assigned or no filter set, false otherwise
734+ func (a * Asset ) hasValidFilterExcludeFaces (requestID , deviceID string ) bool {
735+ if ! a .requestConfig .FilterExcludeFaces {
736+ return true
737+ }
738+
739+ if len (a .People ) == 0 {
740+ a .CheckForFaces (requestID , deviceID )
741+ }
742+
743+ return len (a .People ) == 0 && len (a .UnassignedFaces ) == 0
744+ }
745+
729746// hasValidAlbums checks if the asset belongs to any excluded albums.
730747// If album data is missing, it fetches it first.
731748//
0 commit comments