aboutsummaryrefslogtreecommitdiff
path: root/src/Jellyfin.LiveTv/Configuration
diff options
context:
space:
mode:
Diffstat (limited to 'src/Jellyfin.LiveTv/Configuration')
-rw-r--r--src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationExtensions.cs18
-rw-r--r--src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationFactory.cs24
2 files changed, 42 insertions, 0 deletions
diff --git a/src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationExtensions.cs b/src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationExtensions.cs
new file mode 100644
index 0000000000..67d0e5295b
--- /dev/null
+++ b/src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationExtensions.cs
@@ -0,0 +1,18 @@
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Model.LiveTv;
+
+namespace Jellyfin.LiveTv.Configuration;
+
+/// <summary>
+/// <see cref="IConfigurationManager"/> extensions for Live TV.
+/// </summary>
+public static class LiveTvConfigurationExtensions
+{
+ /// <summary>
+ /// Gets the <see cref="LiveTvOptions"/>.
+ /// </summary>
+ /// <param name="configurationManager">The <see cref="IConfigurationManager"/>.</param>
+ /// <returns>The <see cref="LiveTvOptions"/>.</returns>
+ public static LiveTvOptions GetLiveTvConfiguration(this IConfigurationManager configurationManager)
+ => configurationManager.GetConfiguration<LiveTvOptions>("livetv");
+}
diff --git a/src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationFactory.cs b/src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationFactory.cs
new file mode 100644
index 0000000000..258afbb056
--- /dev/null
+++ b/src/Jellyfin.LiveTv/Configuration/LiveTvConfigurationFactory.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Model.LiveTv;
+
+namespace Jellyfin.LiveTv.Configuration;
+
+/// <summary>
+/// <see cref="IConfigurationFactory" /> implementation for <see cref="LiveTvOptions" />.
+/// </summary>
+public class LiveTvConfigurationFactory : IConfigurationFactory
+{
+ /// <inheritdoc />
+ public IEnumerable<ConfigurationStore> GetConfigurations()
+ {
+ return new[]
+ {
+ new ConfigurationStore
+ {
+ ConfigurationType = typeof(LiveTvOptions),
+ Key = "livetv"
+ }
+ };
+ }
+}