diff options
| author | Niels van Velzen <nielsvanvelzen@users.noreply.github.com> | 2026-04-13 11:57:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-13 11:57:33 +0200 |
| commit | ec9c94bd7a993a7cfba1cb81730a78b06f5cf37f (patch) | |
| tree | 7f1bce3e1561d43c54b86b0251705bff292bd71c /Jellyfin.Server.Implementations | |
| parent | 6fc406f2c58e9dafc10f28d9c0e4eeb68283e26c (diff) | |
| parent | bb265cd4030e966aec1afbd31eafc0973531c232 (diff) | |
Merge pull request #16619 from dkanada/person-filter
add NameStartsWith and NameLessThan filters to Person search
Diffstat (limited to 'Jellyfin.Server.Implementations')
| -rw-r--r-- | Jellyfin.Server.Implementations/Item/PeopleRepository.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs index ad9953d1b6..7147fbfe7d 100644 --- a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs +++ b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs @@ -235,6 +235,21 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I query = query.Where(e => e.Name.ToUpper().Contains(nameContainsUpper)); } + if (!string.IsNullOrWhiteSpace(filter.NameStartsWith)) + { + query = query.Where(e => e.Name.StartsWith(filter.NameStartsWith.ToLowerInvariant())); + } + + if (!string.IsNullOrWhiteSpace(filter.NameLessThan)) + { + query = query.Where(e => e.Name.CompareTo(filter.NameLessThan.ToLowerInvariant()) < 0); + } + + if (!string.IsNullOrWhiteSpace(filter.NameStartsWithOrGreater)) + { + query = query.Where(e => e.Name.CompareTo(filter.NameStartsWithOrGreater.ToLowerInvariant()) >= 0); + } + return query; } |
