Merge pull request #1996 from MediaBrowser/beta

Beta
This commit is contained in:
Luke 2016-07-29 12:00:41 -04:00 committed by GitHub
commit 43000d269b
8 changed files with 61 additions and 49 deletions

View File

@ -126,9 +126,10 @@ namespace MediaBrowser.Api
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool dispose) protected virtual void Dispose(bool dispose)
{ {
var jobCount = _activeTranscodingJobs.Count; var list = _activeTranscodingJobs.ToList();
var jobCount = list.Count;
Parallel.ForEach(_activeTranscodingJobs.ToList(), j => KillTranscodingJob(j, false, path => true)); Parallel.ForEach(list, j => KillTranscodingJob(j, false, path => true));
// Try to allow for some time to kill the ffmpeg processes and delete the partial stream files // Try to allow for some time to kill the ffmpeg processes and delete the partial stream files
if (jobCount > 0) if (jobCount > 0)

View File

@ -175,7 +175,9 @@ namespace MediaBrowser.Api.Playback.Progressive
ResponseHeaders = responseHeaders, ResponseHeaders = responseHeaders,
ContentType = contentType, ContentType = contentType,
IsHeadRequest = isHeadRequest, IsHeadRequest = isHeadRequest,
Path = outputPath Path = outputPath,
FileShare = FileShare.ReadWrite
}).ConfigureAwait(false); }).ConfigureAwait(false);
} }
finally finally
@ -187,8 +189,7 @@ namespace MediaBrowser.Api.Playback.Progressive
// Need to start ffmpeg // Need to start ffmpeg
try try
{ {
return await GetStreamResult(state, responseHeaders, isHeadRequest, cancellationTokenSource) return await GetStreamResult(state, responseHeaders, isHeadRequest, cancellationTokenSource).ConfigureAwait(false);
.ConfigureAwait(false);
} }
catch catch
{ {

View File

@ -208,7 +208,7 @@ namespace MediaBrowser.Api.Playback
private async void DisposeLiveStream() private async void DisposeLiveStream()
{ {
if (MediaSource.RequiresClosing && string.IsNullOrWhiteSpace(Request.LiveStreamId)) if (MediaSource.RequiresClosing && string.IsNullOrWhiteSpace(Request.LiveStreamId) && !string.IsNullOrWhiteSpace(MediaSource.LiveStreamId))
{ {
try try
{ {

View File

@ -133,6 +133,9 @@ namespace MediaBrowser.Providers.Manager
source = memoryStream; source = memoryStream;
var currentImage = GetCurrentImage(item, type, index); var currentImage = GetCurrentImage(item, type, index);
var currentImageIsLocalFile = currentImage != null && currentImage.IsLocalFile;
var currentImagePath = currentImage == null ? null : currentImage.Path;
var savedPaths = new List<string>(); var savedPaths = new List<string>();
using (source) using (source)
@ -157,9 +160,9 @@ namespace MediaBrowser.Providers.Manager
SetImagePath(item, type, imageIndex, savedPaths[0]); SetImagePath(item, type, imageIndex, savedPaths[0]);
// Delete the current path // Delete the current path
if (currentImage != null && currentImage.IsLocalFile && !savedPaths.Contains(currentImage.Path, StringComparer.OrdinalIgnoreCase)) if (currentImageIsLocalFile && !savedPaths.Contains(currentImagePath, StringComparer.OrdinalIgnoreCase))
{ {
var currentPath = currentImage.Path; var currentPath = currentImagePath;
_logger.Debug("Deleting previous image {0}", currentPath); _logger.Debug("Deleting previous image {0}", currentPath);

View File

@ -39,6 +39,20 @@ namespace MediaBrowser.Providers.TV
updateType |= ItemUpdateType.MetadataImport; updateType |= ItemUpdateType.MetadataImport;
} }
} }
if (updateType <= ItemUpdateType.None)
{
if (item.SeriesId != item.FindSeriesId())
{
updateType |= ItemUpdateType.MetadataImport;
}
}
if (updateType <= ItemUpdateType.None)
{
if (item.SeasonId != item.FindSeasonId())
{
updateType |= ItemUpdateType.MetadataImport;
}
}
return updateType; return updateType;
} }

View File

@ -49,6 +49,13 @@ namespace MediaBrowser.Providers.TV
updateType |= ItemUpdateType.MetadataImport; updateType |= ItemUpdateType.MetadataImport;
} }
} }
if (updateType <= ItemUpdateType.None)
{
if (item.SeriesId != item.FindSeriesId())
{
updateType |= ItemUpdateType.MetadataImport;
}
}
return updateType; return updateType;
} }

View File

@ -446,8 +446,31 @@ namespace MediaBrowser.Server.Implementations.Library
} }
} }
private async Task CloseLiveStreamWithProvider(IMediaSourceProvider provider, string streamId, CancellationToken cancellationToken)
{
_logger.Info("Closing live stream {0} with provider {1}", streamId, provider.GetType().Name);
try
{
await provider.CloseMediaSource(streamId, cancellationToken).ConfigureAwait(false);
}
catch (NotImplementedException)
{
}
catch (Exception ex)
{
_logger.ErrorException("Error closing live stream {0}", ex, streamId);
}
}
public async Task CloseLiveStream(string id, CancellationToken cancellationToken) public async Task CloseLiveStream(string id, CancellationToken cancellationToken)
{ {
if (string.IsNullOrWhiteSpace(id))
{
throw new ArgumentNullException("id");
}
await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try try
@ -459,7 +482,7 @@ namespace MediaBrowser.Server.Implementations.Library
{ {
var tuple = GetProvider(id); var tuple = GetProvider(id);
await tuple.Item1.CloseMediaSource(tuple.Item2, cancellationToken).ConfigureAwait(false); await CloseLiveStreamWithProvider(tuple.Item1, tuple.Item2, cancellationToken).ConfigureAwait(false);
} }
} }

View File

@ -242,12 +242,6 @@
<Content Include="dashboard-ui\css\images\logo536.png"> <Content Include="dashboard-ui\css\images\logo536.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\css\images\splash.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\splash720.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\touchicon144.png"> <Content Include="dashboard-ui\css\images\touchicon144.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -386,6 +380,9 @@
<Content Include="dashboard-ui\serversecurity.html"> <Content Include="dashboard-ui\serversecurity.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\serviceworker.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\shared.html"> <Content Include="dashboard-ui\shared.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -785,9 +782,6 @@
<Content Include="dashboard-ui\css\images\fresh.png"> <Content Include="dashboard-ui\css\images\fresh.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\css\images\items\searchhintsv2\tv.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\media\chapterflyout.png"> <Content Include="dashboard-ui\css\images\media\chapterflyout.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -1347,11 +1341,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="dashboard-ui\css\images\checkmarkblack.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="dashboard-ui\log.html"> <Content Include="dashboard-ui\log.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -1405,11 +1394,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="dashboard-ui\css\images\notifications\download.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="dashboard-ui\css\images\supporter\supporterbadge.png"> <Content Include="dashboard-ui\css\images\supporter\supporterbadge.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -1425,24 +1409,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="dashboard-ui\css\images\notifications\done.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\notifications\error.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="dashboard-ui\css\images\notifications\cancelled.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="dashboard-ui\css\images\notifications\info.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="dashboard-ui\itemdetails.html"> <Content Include="dashboard-ui\itemdetails.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@ -1487,9 +1453,6 @@
<Content Include="dashboard-ui\about.html"> <Content Include="dashboard-ui\about.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\css\images\stars.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\mediaplayer.js"> <Content Include="dashboard-ui\scripts\mediaplayer.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>