Browse Source

Add instance id support (#2828)

* Add instance id support

* actually use env variable for instance ID

* Default to ersatztv.org for instance id

* simplify

* fix ordering

* update changelog

---------

Co-authored-by: Jason Dove <1695733+jasongdove@users.noreply.github.com>
pull/2835/head
Lex Rivera 5 months ago committed by GitHub
parent
commit
a91de68a5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 5
      ErsatzTV.Core/Iptv/ChannelIdentifier.cs
  3. 3
      ErsatzTV.Core/SystemEnvironment.cs

2
CHANGELOG.md

@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- This controls how many (optional) seconds of black video and silent audio to insert between *every* playout item - This controls how many (optional) seconds of black video and silent audio to insert between *every* playout item
- This will drift playback from the wall clock as slugs are not scheduled in the playout, but are inserted dynamically during playback - This will drift playback from the wall clock as slugs are not scheduled in the playout, but are inserted dynamically during playback
- If this feature turns out to be popular, methods to correct the drift may be investigated - If this feature turns out to be popular, methods to correct the drift may be investigated
- Add `ETV_INSTANCE_ID` environment variable to disambiguate EPG data from multiple ErsatzTV instances
- When set, the value will be used in channel identifiers before the final `.ersatztv.org`
### Changed ### Changed
- Move dark/light mode toggle to **Settings** > **UI** - Move dark/light mode toggle to **Settings** > **UI**

5
ErsatzTV.Core/Iptv/ChannelIdentifier.cs

@ -17,6 +17,9 @@ public static class ChannelIdentifier
number /= 10; number /= 10;
} }
return $"C{channelNumber}.{id}.ersatztv.org"; string instanceId = SystemEnvironment.InstanceId;
return !string.IsNullOrWhiteSpace(instanceId)
? $"C{channelNumber}.{id}.{instanceId}.ersatztv.org"
: $"C{channelNumber}.{id}.ersatztv.org";
} }
} }

3
ErsatzTV.Core/SystemEnvironment.cs

@ -10,6 +10,8 @@ public class SystemEnvironment
TranscodeFolder = Environment.GetEnvironmentVariable("ETV_TRANSCODE_FOLDER"); TranscodeFolder = Environment.GetEnvironmentVariable("ETV_TRANSCODE_FOLDER");
InstanceId = Environment.GetEnvironmentVariable("ETV_INSTANCE_ID");
string uiPortVariable = Environment.GetEnvironmentVariable("ETV_UI_PORT"); string uiPortVariable = Environment.GetEnvironmentVariable("ETV_UI_PORT");
if (!int.TryParse(uiPortVariable, out int uiPort)) if (!int.TryParse(uiPortVariable, out int uiPort))
{ {
@ -63,6 +65,7 @@ public class SystemEnvironment
public static string BaseUrl { get; } public static string BaseUrl { get; }
public static string ConfigFolder { get; } public static string ConfigFolder { get; }
public static string TranscodeFolder { get; } public static string TranscodeFolder { get; }
public static string InstanceId { get; }
public static int UiPort { get; } public static int UiPort { get; }
public static int StreamingPort { get; } public static int StreamingPort { get; }
public static bool AllowSharedPlexServers { get; } public static bool AllowSharedPlexServers { get; }

Loading…
Cancel
Save