SubtitleProfile.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Xml.Serialization;
  2. using MediaBrowser.Model.Extensions;
  3. namespace MediaBrowser.Model.Dlna
  4. {
  5. public class SubtitleProfile
  6. {
  7. [XmlAttribute("format")]
  8. public string Format { get; set; }
  9. [XmlAttribute("method")]
  10. public SubtitleDeliveryMethod Method { get; set; }
  11. [XmlAttribute("didlMode")]
  12. public string DidlMode { get; set; }
  13. [XmlAttribute("language")]
  14. public string Language { get; set; }
  15. [XmlAttribute("container")]
  16. public string Container { get; set; }
  17. public string[] GetLanguages()
  18. {
  19. return ContainerProfile.SplitValue(Language);
  20. }
  21. public bool SupportsLanguage(string subLanguage)
  22. {
  23. if (string.IsNullOrEmpty(Language))
  24. {
  25. return true;
  26. }
  27. if (string.IsNullOrEmpty(subLanguage))
  28. {
  29. subLanguage = "und";
  30. }
  31. var languages = GetLanguages();
  32. return languages.Length == 0 || ListHelper.ContainsIgnoreCase(languages, subLanguage);
  33. }
  34. }
  35. }