Filter.cs 825 B

12345678910111213141516171819202122232425262728293031
  1. #pragma warning disable CS1591
  2. using System;
  3. namespace Emby.Dlna.Didl
  4. {
  5. public class Filter
  6. {
  7. private readonly string[] _fields;
  8. private readonly bool _all;
  9. public Filter()
  10. : this("*")
  11. {
  12. }
  13. public Filter(string filter)
  14. {
  15. _all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase);
  16. _fields = (filter ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
  17. }
  18. public bool Contains(string field)
  19. {
  20. // 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.
  21. return true;
  22. // return _all || ListHelper.ContainsIgnoreCase(_fields, field);
  23. }
  24. }
  25. }