mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-11 04:36:28 +00:00
fixes #859 - Support adaptive bitrate streaming
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
public static class ChannelConfigurationExtension
|
||||
{
|
||||
public static ChannelOptions GetChannelsConfiguration(this IConfigurationManager manager)
|
||||
{
|
||||
return manager.GetConfiguration<ChannelOptions>("channels");
|
||||
}
|
||||
}
|
||||
|
||||
public class ChannelConfigurationFactory : IConfigurationFactory
|
||||
{
|
||||
public IEnumerable<ConfigurationStore> GetConfigurations()
|
||||
{
|
||||
return new List<ConfigurationStore>
|
||||
{
|
||||
new ConfigurationStore
|
||||
{
|
||||
Key = "channels",
|
||||
ConfigurationType = typeof (ChannelOptions)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,9 +146,11 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
var numComplete = 0;
|
||||
|
||||
var options = _config.GetChannelsConfiguration();
|
||||
|
||||
foreach (var item in result.Items)
|
||||
{
|
||||
if (_config.Configuration.ChannelOptions.DownloadingChannels.Contains(item.ChannelId))
|
||||
if (options.DownloadingChannels.Contains(item.ChannelId))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -282,12 +284,14 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
|
||||
private void CleanChannelContent(CancellationToken cancellationToken)
|
||||
{
|
||||
if (!_config.Configuration.ChannelOptions.MaxDownloadAge.HasValue)
|
||||
var options = _config.GetChannelsConfiguration();
|
||||
|
||||
if (!options.MaxDownloadAge.HasValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var minDateModified = DateTime.UtcNow.AddDays(0 - _config.Configuration.ChannelOptions.MaxDownloadAge.Value);
|
||||
var minDateModified = DateTime.UtcNow.AddDays(0 - options.MaxDownloadAge.Value);
|
||||
|
||||
var path = _manager.ChannelDownloadPath;
|
||||
|
||||
|
||||
@@ -77,9 +77,11 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(_config.Configuration.ChannelOptions.DownloadPath))
|
||||
var options = _config.GetChannelsConfiguration();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(options.DownloadPath))
|
||||
{
|
||||
return _config.Configuration.ChannelOptions.DownloadPath;
|
||||
return options.DownloadPath;
|
||||
}
|
||||
|
||||
return Path.Combine(_config.ApplicationPaths.ProgramDataPath, "channels");
|
||||
@@ -374,7 +376,9 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
{
|
||||
var list = channelMediaSources.ToList();
|
||||
|
||||
var width = _config.Configuration.ChannelOptions.PreferredStreamingWidth;
|
||||
var options = _config.GetChannelsConfiguration();
|
||||
|
||||
var width = options.PreferredStreamingWidth;
|
||||
|
||||
if (width.HasValue)
|
||||
{
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
<Compile Include="..\SharedVersion.cs">
|
||||
<Link>Properties\SharedVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Channels\ChannelConfigurations.cs" />
|
||||
<Compile Include="Channels\ChannelDownloadScheduledTask.cs" />
|
||||
<Compile Include="Channels\ChannelImageProvider.cs" />
|
||||
<Compile Include="Channels\ChannelItemImageProvider.cs" />
|
||||
|
||||
Reference in New Issue
Block a user