Filter.cs 893 B

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