Filter.cs 862 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma warning disable CS1591
  2. using System;
  3. using MediaBrowser.Model.Extensions;
  4. namespace Emby.Dlna.Didl
  5. {
  6. public class Filter
  7. {
  8. private readonly string[] _fields;
  9. private readonly bool _all;
  10. public Filter()
  11. : this("*")
  12. {
  13. }
  14. public Filter(string filter)
  15. {
  16. _all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase);
  17. _fields = (filter ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  18. }
  19. public bool Contains(string field)
  20. {
  21. // Don't bother with this. Some clients (media monkey) use the filter and then don't display very well when very little data comes back.
  22. return true;
  23. //return _all || ListHelper.ContainsIgnoreCase(_fields, field);
  24. }
  25. }
  26. }