aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-07-29 12:00:41 -0400
committerGitHub <noreply@github.com>2016-07-29 12:00:41 -0400
commit43000d269b1871e985a561b817410a5399d23b65 (patch)
tree098a1ea26c933261f6b4d0b68d06dc576ae61e77
parent100236f416e1917d57913f117b7f0c4ee9069d0b (diff)
parent9f12df23ab02e4b44467ef7a948fcc69df9e4d62 (diff)
Merge pull request #1996 from MediaBrowser/beta
Beta
-rw-r--r--MediaBrowser.Api/ApiEntryPoint.cs5
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs7
-rw-r--r--MediaBrowser.Api/Playback/StreamState.cs2
-rw-r--r--MediaBrowser.Providers/Manager/ImageSaver.cs7
-rw-r--r--MediaBrowser.Providers/TV/EpisodeMetadataService.cs14
-rw-r--r--MediaBrowser.Providers/TV/SeasonMetadataService.cs7
-rw-r--r--MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs25
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj43
8 files changed, 61 insertions, 49 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs
index dc811812a..87fa3d46c 100644
--- a/MediaBrowser.Api/ApiEntryPoint.cs
+++ b/MediaBrowser.Api/ApiEntryPoint.cs
@@ -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>
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
if (jobCount > 0)
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index d75b8947a..449100fc4 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -175,7 +175,9 @@ namespace MediaBrowser.Api.Playback.Progressive
ResponseHeaders = responseHeaders,
ContentType = contentType,
IsHeadRequest = isHeadRequest,
- Path = outputPath
+ Path = outputPath,
+ FileShare = FileShare.ReadWrite
+
}).ConfigureAwait(false);
}
finally
@@ -187,8 +189,7 @@ namespace MediaBrowser.Api.Playback.Progressive
// Need to start ffmpeg
try
{
- return await GetStreamResult(state, responseHeaders, isHeadRequest, cancellationTokenSource)
- .ConfigureAwait(false);
+ return await GetStreamResult(state, responseHeaders, isHeadRequest, cancellationTokenSource).ConfigureAwait(false);
}
catch
{
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs
index da6be97b6..d97169fa5 100644
--- a/MediaBrowser.Api/Playback/StreamState.cs
+++ b/MediaBrowser.Api/Playback/StreamState.cs
@@ -208,7 +208,7 @@ namespace MediaBrowser.Api.Playback
private async void DisposeLiveStream()
{
- if (MediaSource.RequiresClosing && string.IsNullOrWhiteSpace(Request.LiveStreamId))
+ if (MediaSource.RequiresClosing && string.IsNullOrWhiteSpace(Request.LiveStreamId) && !string.IsNullOrWhiteSpace(MediaSource.LiveStreamId))
{
try
{
diff --git a/MediaBrowser.Providers/Manager/ImageSaver.cs b/MediaBrowser.Providers/Manager/ImageSaver.cs
index 465677efb..3de330557 100644
--- a/MediaBrowser.Providers/Manager/ImageSaver.cs
+++ b/MediaBrowser.Providers/Manager/ImageSaver.cs
@@ -133,6 +133,9 @@ namespace MediaBrowser.Providers.Manager
source = memoryStream;
var currentImage = GetCurrentImage(item, type, index);
+ var currentImageIsLocalFile = currentImage != null && currentImage.IsLocalFile;
+ var currentImagePath = currentImage == null ? null : currentImage.Path;
+
var savedPaths = new List<string>();
using (source)
@@ -157,9 +160,9 @@ namespace MediaBrowser.Providers.Manager
SetImagePath(item, type, imageIndex, savedPaths[0]);
// 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);
diff --git a/MediaBrowser.Providers/TV/EpisodeMetadataService.cs b/MediaBrowser.Providers/TV/EpisodeMetadataService.cs
index b51b11380..90a185ce0 100644
--- a/MediaBrowser.Providers/TV/EpisodeMetadataService.cs
+++ b/MediaBrowser.Providers/TV/EpisodeMetadataService.cs
@@ -39,6 +39,20 @@ namespace MediaBrowser.Providers.TV
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;
}
diff --git a/MediaBrowser.Providers/TV/SeasonMetadataService.cs b/MediaBrowser.Providers/TV/SeasonMetadataService.cs
index f3e6f8e9c..addab3918 100644
--- a/MediaBrowser.Providers/TV/SeasonMetadataService.cs
+++ b/MediaBrowser.Providers/TV/SeasonMetadataService.cs
@@ -49,6 +49,13 @@ namespace MediaBrowser.Providers.TV
updateType |= ItemUpdateType.MetadataImport;
}
}
+ if (updateType <= ItemUpdateType.None)
+ {
+ if (item.SeriesId != item.FindSeriesId())
+ {
+ updateType |= ItemUpdateType.MetadataImport;
+ }
+ }
return updateType;
}
diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
index 4f3fe1bf3..696bd0f4d 100644
--- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
@@ -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)
{
+ if (string.IsNullOrWhiteSpace(id))
+ {
+ throw new ArgumentNullException("id");
+ }
+
await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try
@@ -459,7 +482,7 @@ namespace MediaBrowser.Server.Implementations.Library
{
var tuple = GetProvider(id);
- await tuple.Item1.CloseMediaSource(tuple.Item2, cancellationToken).ConfigureAwait(false);
+ await CloseLiveStreamWithProvider(tuple.Item1, tuple.Item2, cancellationToken).ConfigureAwait(false);
}
}
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 5c520afcf..46178dd9a 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -242,12 +242,6 @@
<Content Include="dashboard-ui\css\images\logo536.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</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">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -386,6 +380,9 @@
<Content Include="dashboard-ui\serversecurity.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\serviceworker.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\shared.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -785,9 +782,6 @@
<Content Include="dashboard-ui\css\images\fresh.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\css\images\items\searchhintsv2\tv.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
<Content Include="dashboard-ui\css\images\media\chapterflyout.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -1348,11 +1342,6 @@
</Content>
</ItemGroup>
<ItemGroup>
- <Content Include="dashboard-ui\css\images\checkmarkblack.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
<Content Include="dashboard-ui\log.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -1406,11 +1395,6 @@
</Content>
</ItemGroup>
<ItemGroup>
- <Content Include="dashboard-ui\css\images\notifications\download.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
<Content Include="dashboard-ui\css\images\supporter\supporterbadge.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -1426,24 +1410,6 @@
</Content>
</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>
<Content Include="dashboard-ui\itemdetails.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -1487,9 +1453,6 @@
<Content Include="dashboard-ui\about.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\css\images\stars.png">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
<Content Include="dashboard-ui\scripts\mediaplayer.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>