Merge pull request #2196 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-09-28 01:20:35 -04:00 committed by GitHub
commit d246b9cdf2
5 changed files with 25 additions and 6 deletions

View File

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

View File

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

View File

@ -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) 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; return path;
@ -2866,12 +2882,12 @@ namespace MediaBrowser.Server.Implementations.Library
{ {
var libraryOptions = CollectionFolder.GetLibraryOptions(virtualFolderPath); var libraryOptions = CollectionFolder.GetLibraryOptions(virtualFolderPath);
SyncLibraryOptionsToLocations(virtualFolderPath, libraryOptions);
var list = libraryOptions.PathInfos.ToList(); var list = libraryOptions.PathInfos.ToList();
list.Add(pathInfo); list.Add(pathInfo);
libraryOptions.PathInfos = list.ToArray(); libraryOptions.PathInfos = list.ToArray();
SyncLibraryOptionsToLocations(virtualFolderPath, libraryOptions);
CollectionFolder.SaveLibraryOptions(virtualFolderPath, libraryOptions); CollectionFolder.SaveLibraryOptions(virtualFolderPath, libraryOptions);
} }
} }

View File

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

View File

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