Merge pull request #2196 from MediaBrowser/dev

Dev
pull/702/head
Luke 8 years ago committed by GitHub
commit d246b9cdf2

@ -73,6 +73,7 @@ namespace MediaBrowser.Model.Configuration
/// </summary>
/// <value>The metadata path.</value>
public string MetadataPath { get; set; }
public string MetadataNetworkPath { get; set; }
public string LastVersion { get; set; }

@ -35,7 +35,7 @@ namespace MediaBrowser.Server.Implementations.Channels
public string Category
{
get { return "Channels"; }
get { return "Internet Channels"; }
}
public async Task Execute(System.Threading.CancellationToken cancellationToken, IProgress<double> progress)

@ -2550,9 +2550,25 @@ namespace MediaBrowser.Server.Implementations.Library
}
}
var metadataPath = ConfigurationManager.Configuration.MetadataPath;
var metadataNetworkPath = ConfigurationManager.Configuration.MetadataNetworkPath;
if (!string.IsNullOrWhiteSpace(metadataPath) && !string.IsNullOrWhiteSpace(metadataNetworkPath))
{
var metadataSubstitutionResult = SubstitutePathInternal(path, metadataPath, metadataNetworkPath);
if (metadataSubstitutionResult.Item2)
{
return metadataSubstitutionResult.Item1;
}
}
foreach (var map in ConfigurationManager.Configuration.PathSubstitutions)
{
path = SubstitutePath(path, map.From, map.To);
var substitutionResult = SubstitutePathInternal(path, map.From, map.To);
if (substitutionResult.Item2)
{
return substitutionResult.Item1;
}
}
return path;
@ -2866,12 +2882,12 @@ namespace MediaBrowser.Server.Implementations.Library
{
var libraryOptions = CollectionFolder.GetLibraryOptions(virtualFolderPath);
SyncLibraryOptionsToLocations(virtualFolderPath, libraryOptions);
var list = libraryOptions.PathInfos.ToList();
list.Add(pathInfo);
libraryOptions.PathInfos = list.ToArray();
SyncLibraryOptionsToLocations(virtualFolderPath, libraryOptions);
CollectionFolder.SaveLibraryOptions(virtualFolderPath, libraryOptions);
}
}

@ -908,6 +908,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
try
{
await stream.Close().ConfigureAwait(false);
_logger.Info("Live stream {0} closed successfully", id);
}
catch (Exception ex)
{

@ -22,6 +22,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
private readonly IServerApplicationHost _appHost;
private readonly CancellationTokenSource _liveStreamCancellationTokenSource = new CancellationTokenSource();
private readonly TaskCompletionSource<bool> _liveStreamTaskCompletionSource = new TaskCompletionSource<bool>();
public HdHomerunLiveStream(MediaSourceInfo mediaSource, IFileSystem fileSystem, IHttpClient httpClient, ILogger logger, IServerApplicationPaths appPaths, IServerApplicationHost appHost)
: base(mediaSource)
@ -62,7 +63,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
{
_liveStreamCancellationTokenSource.Cancel();
return base.Close();
return _liveStreamTaskCompletionSource.Task;
}
private async Task StartStreamingToTempFile(Stream outputStream, string tempFilePath, string url, TaskCompletionSource<bool> openTaskCompletionSource, CancellationToken cancellationToken)
@ -120,7 +121,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
}
}
await Task.Delay(5000).ConfigureAwait(false);
_liveStreamTaskCompletionSource.TrySetResult(true);
DeleteTempFile(tempFilePath);

Loading…
Cancel
Save