HdHomerunChannelCommands.cs 1022 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
  5. {
  6. public class HdHomerunChannelCommands : IHdHomerunChannelCommands
  7. {
  8. private string? _channel;
  9. private string? _profile;
  10. public HdHomerunChannelCommands(string? channel, string? profile)
  11. {
  12. _channel = channel;
  13. _profile = profile;
  14. }
  15. public IEnumerable<(string CommandName, string CommandValue)> GetCommands()
  16. {
  17. if (!string.IsNullOrEmpty(_channel))
  18. {
  19. if (!string.IsNullOrEmpty(_profile)
  20. && !string.Equals(_profile, "native", StringComparison.OrdinalIgnoreCase))
  21. {
  22. yield return ("vchannel", $"{_channel} transcode={_profile}");
  23. }
  24. else
  25. {
  26. yield return ("vchannel", _channel);
  27. }
  28. }
  29. }
  30. }
  31. }