|
|
|
|
@ -1,5 +1,4 @@
@@ -1,5 +1,4 @@
|
|
|
|
|
using System.Globalization; |
|
|
|
|
using System.Runtime.InteropServices; |
|
|
|
|
|
|
|
|
|
namespace ErsatzTV.Core.Iptv; |
|
|
|
|
|
|
|
|
|
@ -9,7 +8,6 @@ public static class ChannelIdentifier
@@ -9,7 +8,6 @@ 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; |
|
|
|
|
@ -19,6 +17,9 @@ public static class ChannelIdentifier
@@ -19,6 +17,9 @@ public static class ChannelIdentifier
|
|
|
|
|
number /= 10; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $"C{channelNumber}.{id}.{instanceID}"; |
|
|
|
|
string instanceId = SystemEnvironment.InstanceId; |
|
|
|
|
return !string.IsNullOrWhiteSpace(instanceId) |
|
|
|
|
? $"C{channelNumber}.{id}.{instanceId}.ersatztv.org" |
|
|
|
|
: $"C{channelNumber}.{id}.ersatztv.org"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|