Filter.cs 847 B

1234567891011121314151617181920212223242526272829303132
  1. using MediaBrowser.Model.Extensions;
  2. using System;
  3. using System.Collections.Generic;
  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 = StringHelper.EqualsIgnoreCase(filter, "*");
  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. }