Browse Source

actually use env variable for instance ID

pull/2828/head
Lex Rivera 6 months ago
parent
commit
a2b3cf52b8
No known key found for this signature in database
GPG Key ID: E7ED7B6B453AF56C
  1. 4
      ErsatzTV.Core/Iptv/ChannelIdentifier.cs

4
ErsatzTV.Core/Iptv/ChannelIdentifier.cs

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
using System.Globalization;
using System.Runtime.InteropServices;
namespace ErsatzTV.Core.Iptv;
@ -8,6 +9,7 @@ public static class ChannelIdentifier @@ -8,6 +9,7 @@ public static class ChannelIdentifier
public static string FromNumber(string channelNumber)
{
string instanceID = SystemEnvironment.InstanceID;
// get rid of any decimal (only two are allowed)
var number = (int)(decimal.Parse(channelNumber, CultureInfo.InvariantCulture) * 100);
var id = 0;
@ -17,6 +19,6 @@ public static class ChannelIdentifier @@ -17,6 +19,6 @@ public static class ChannelIdentifier
number /= 10;
}
return $"C{channelNumber}.{id}.{SystemEnvironment.InstanceID}";
return $"C{channelNumber}.{id}.{instanceID}";
}
}

Loading…
Cancel
Save