Add dlna headers to static responses
This commit is contained in:
parent
1de89cf272
commit
4205dcac9d
|
@ -797,7 +797,7 @@ namespace MediaBrowser.Api.Images
|
|||
// Handle image/png; charset=utf-8
|
||||
mimeType = mimeType.Split(';').FirstOrDefault();
|
||||
|
||||
await _providerManager.SaveImage(entity, memoryStream, mimeType, imageType, null, null, CancellationToken.None).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage(entity, memoryStream, mimeType, imageType, null, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
await entity.RefreshMetadata(new MetadataRefreshOptions
|
||||
{
|
||||
|
|
|
@ -193,6 +193,8 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||
|
||||
if (request.Static && state.IsRemote)
|
||||
{
|
||||
AddDlnaHeaders(state, responseHeaders, true);
|
||||
|
||||
return GetStaticRemoteStreamResult(state.MediaPath, responseHeaders, isHeadRequest).Result;
|
||||
}
|
||||
|
||||
|
@ -257,7 +259,6 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||
var result = new StaticRemoteStreamWriter(response, httpClient);
|
||||
|
||||
result.Options["Content-Type"] = contentType;
|
||||
AddDlnaHeaders(state, responseHeaders, isStatic);
|
||||
|
||||
// Add the response headers to the result object
|
||||
foreach (var header in responseHeaders)
|
||||
|
|
|
@ -48,12 +48,13 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||
}
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool? recursive = null, bool forceRefreshMetadata = false)
|
||||
{
|
||||
if (IsAccessedByName)
|
||||
{
|
||||
// Should never get in here anyway
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
return base.ValidateChildrenInternal(progress, cancellationToken, recursive, forceRefreshMetadata);
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
<Compile Include="Persistence\MediaStreamQuery.cs" />
|
||||
<Compile Include="Providers\ICustomMetadataProvider.cs" />
|
||||
<Compile Include="Providers\IDynamicInfoProvider.cs" />
|
||||
<Compile Include="Providers\IHasChangeMonitor.cs" />
|
||||
<Compile Include="Providers\IHasMetadata.cs" />
|
||||
<Compile Include="Providers\IImageProvider.cs" />
|
||||
<Compile Include="Providers\ILocalMetadataProvider.cs" />
|
||||
|
|
15
MediaBrowser.Controller/Providers/IHasChangeMonitor.cs
Normal file
15
MediaBrowser.Controller/Providers/IHasChangeMonitor.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
public interface IHasChangeMonitor
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines whether the specified item has changed.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="date">The date.</param>
|
||||
/// <returns><c>true</c> if the specified item has changed; otherwise, <c>false</c>.</returns>
|
||||
bool HasChanged(IHasMetadata item, DateTime date);
|
||||
}
|
||||
}
|
|
@ -19,17 +19,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
{
|
||||
}
|
||||
|
||||
public interface IHasChangeMonitor
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines whether the specified item has changed.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="date">The date.</param>
|
||||
/// <returns><c>true</c> if the specified item has changed; otherwise, <c>false</c>.</returns>
|
||||
bool HasChanged(IHasMetadata item, DateTime date);
|
||||
}
|
||||
|
||||
public interface IHasOrder
|
||||
{
|
||||
int Order { get; }
|
||||
|
|
|
@ -53,10 +53,9 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <param name="mimeType">Type of the MIME.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="sourceUrl">The source URL.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, string sourceUrl, CancellationToken cancellationToken);
|
||||
Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the metadata providers.
|
||||
|
|
|
@ -168,7 +168,8 @@ namespace MediaBrowser.Providers.BoxSets
|
|||
}
|
||||
return mainResult;
|
||||
}
|
||||
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
internal Task EnsureInfo(string tmdbId, string preferredMetadataLanguage, CancellationToken cancellationToken)
|
||||
{
|
||||
var path = GetDataFilePath(_config.ApplicationPaths, tmdbId, preferredMetadataLanguage);
|
||||
|
@ -180,7 +181,7 @@ namespace MediaBrowser.Providers.BoxSets
|
|||
// If it's recent or automatic updates are enabled, don't re-download
|
||||
if ((DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 7)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,13 +15,14 @@ namespace MediaBrowser.Providers.Games
|
|||
{
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
public Task FetchAsync(GameSystem item, string metadataFile, CancellationToken cancellationToken)
|
||||
{
|
||||
Fetch(item, metadataFile, cancellationToken);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -21,13 +21,14 @@ namespace MediaBrowser.Providers.Games
|
|||
{
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
public Task FetchAsync(Game item, string metadataFile, CancellationToken cancellationToken)
|
||||
{
|
||||
Fetch(item, metadataFile, cancellationToken);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -62,11 +62,10 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="mimeType">Type of the MIME.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="sourceUrl">The source URL.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">mimeType</exception>
|
||||
public async Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, string sourceUrl, CancellationToken cancellationToken)
|
||||
public async Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(mimeType))
|
||||
{
|
||||
|
@ -155,7 +154,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
}
|
||||
|
||||
// Set the path into the item
|
||||
SetImagePath(item, type, imageIndex, paths[0], sourceUrl);
|
||||
SetImagePath(item, type, imageIndex, paths[0]);
|
||||
|
||||
// Delete the current path
|
||||
if (!string.IsNullOrEmpty(currentPath) && !paths.Contains(currentPath, StringComparer.OrdinalIgnoreCase))
|
||||
|
@ -271,11 +270,10 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="sourceUrl">The source URL.</param>
|
||||
/// <exception cref="System.ArgumentNullException">imageIndex
|
||||
/// or
|
||||
/// imageIndex</exception>
|
||||
private void SetImagePath(BaseItem item, ImageType type, int? imageIndex, string path, string sourceUrl)
|
||||
private void SetImagePath(BaseItem item, ImageType type, int? imageIndex, string path)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
|
|
@ -114,13 +114,13 @@ namespace MediaBrowser.Providers.Manager
|
|||
var stream = _fileSystem.GetFileStream(response.Path, FileMode.Open, FileAccess.Read,
|
||||
FileShare.Read, true);
|
||||
|
||||
await _providerManager.SaveImage((BaseItem)item, stream, mimeType, imageType, null, Guid.NewGuid().ToString(), cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage((BaseItem)item, stream, mimeType, imageType, null, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
var mimeType = "image/" + response.Format.ToString().ToLower();
|
||||
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Stream, mimeType, imageType, null, Guid.NewGuid().ToString(), cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Stream, mimeType, imageType, null, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
result.UpdateType = result.UpdateType | ItemUpdateType.ImageUpdate;
|
||||
|
@ -337,7 +337,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
var response = await provider.GetImageResponse(url, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Content, response.ContentType, type, null, url, cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Content, response.ContentType, type, null, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
result.UpdateType = result.UpdateType | ItemUpdateType.ImageUpdate;
|
||||
break;
|
||||
|
@ -371,7 +371,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
var response = await provider.GetImageResponse(url, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Content, response.ContentType, imageType, null, url, cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Content, response.ContentType, imageType, null, cancellationToken).ConfigureAwait(false);
|
||||
result.UpdateType = result.UpdateType | ItemUpdateType.ImageUpdate;
|
||||
break;
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
var response = await provider.GetImageResponse(url, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Content, response.ContentType, imageType, null, url, cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage((BaseItem)item, response.Content, response.ContentType, imageType, null, cancellationToken).ConfigureAwait(false);
|
||||
result.UpdateType = result.UpdateType | ItemUpdateType.ImageUpdate;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -56,12 +56,10 @@ namespace MediaBrowser.Providers.Manager
|
|||
public async Task RefreshMetadata(IHasMetadata item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
|
||||
{
|
||||
var itemOfType = (TItemType)item;
|
||||
|
||||
var config = GetMetadataOptions(itemOfType);
|
||||
|
||||
var updateType = ItemUpdateType.Unspecified;
|
||||
var lastResult = GetLastResult(item.Id);
|
||||
var refreshResult = lastResult;
|
||||
var refreshResult = GetLastResult(item.Id);
|
||||
refreshResult.LastErrorMessage = string.Empty;
|
||||
refreshResult.LastStatus = ProviderRefreshStatus.Success;
|
||||
|
||||
|
@ -90,8 +88,8 @@ namespace MediaBrowser.Providers.Manager
|
|||
if (refreshOptions.MetadataRefreshMode != MetadataRefreshMode.None)
|
||||
{
|
||||
updateType = updateType | BeforeMetadataRefresh(itemOfType);
|
||||
|
||||
var providers = GetProviders(item, lastResult.DateLastMetadataRefresh.HasValue, refreshOptions).ToList();
|
||||
|
||||
var providers = GetProviders(item, refreshResult.DateLastMetadataRefresh.HasValue, refreshOptions).ToList();
|
||||
|
||||
if (providers.Count > 0)
|
||||
{
|
||||
|
@ -109,7 +107,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
// Next run remote image providers, but only if local image providers didn't throw an exception
|
||||
if (!localImagesFailed && refreshOptions.ImageRefreshMode != ImageRefreshMode.ValidationOnly)
|
||||
{
|
||||
var providers = GetNonLocalImageProviders(item, allImageProviders, lastResult.DateLastImagesRefresh.HasValue, refreshOptions).ToList();
|
||||
var providers = GetNonLocalImageProviders(item, allImageProviders, refreshResult.DateLastImagesRefresh, refreshOptions).ToList();
|
||||
|
||||
if (providers.Count > 0)
|
||||
{
|
||||
|
@ -205,13 +203,13 @@ namespace MediaBrowser.Providers.Manager
|
|||
return providers;
|
||||
}
|
||||
|
||||
protected virtual IEnumerable<IImageProvider> GetNonLocalImageProviders(IHasMetadata item, IEnumerable<IImageProvider> allImageProviders, bool hasRefreshedImages, ImageRefreshOptions options)
|
||||
protected virtual IEnumerable<IImageProvider> GetNonLocalImageProviders(IHasMetadata item, IEnumerable<IImageProvider> allImageProviders, DateTime? dateLastImageRefresh, ImageRefreshOptions options)
|
||||
{
|
||||
// Get providers to refresh
|
||||
var providers = allImageProviders.Where(i => !(i is ILocalImageProvider)).ToList();
|
||||
|
||||
// Run all if either of these flags are true
|
||||
var runAllProviders = options.ImageRefreshMode == ImageRefreshMode.FullRefresh || !hasRefreshedImages;
|
||||
var runAllProviders = options.ImageRefreshMode == ImageRefreshMode.FullRefresh || !dateLastImageRefresh.HasValue;
|
||||
|
||||
if (!runAllProviders)
|
||||
{
|
||||
|
@ -219,7 +217,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
var currentItem = item;
|
||||
|
||||
providers = providers.OfType<IHasChangeMonitor>()
|
||||
.Where(i => i.HasChanged(currentItem, currentItem.DateLastSaved))
|
||||
.Where(i => i.HasChanged(currentItem, dateLastImageRefresh.Value))
|
||||
.Cast<IImageProvider>()
|
||||
.ToList();
|
||||
}
|
||||
|
|
|
@ -364,7 +364,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
await SaveImage(item, response.Content, response.ContentType, type, imageIndex, url, cancellationToken)
|
||||
await SaveImage(item, response.Content, response.ContentType, type, imageIndex, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
@ -376,12 +376,11 @@ namespace MediaBrowser.Providers.Manager
|
|||
/// <param name="mimeType">Type of the MIME.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="sourceUrl">The source URL.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
public Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, string sourceUrl, CancellationToken cancellationToken)
|
||||
public Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
||||
{
|
||||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger).SaveImage(item, source, mimeType, type, imageIndex, sourceUrl, cancellationToken);
|
||||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger).SaveImage(item, source, mimeType, type, imageIndex, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -251,6 +251,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
}
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
internal Task EnsureMovieXml(string tmdbId, CancellationToken cancellationToken)
|
||||
{
|
||||
var path = GetFanartXmlPath(tmdbId);
|
||||
|
@ -261,7 +262,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
{
|
||||
if (ConfigurationManager.Configuration.EnableFanArtUpdates || (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 7)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
await _providerManager.SaveImage(item, img, MimeTypes.GetMimeType(url), ImageType.Primary, null, url, cancellationToken)
|
||||
await _providerManager.SaveImage(item, img, MimeTypes.GetMimeType(url), ImageType.Primary, null, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
await _providerManager.SaveImage(item, img, MimeTypes.GetMimeType(url), ImageType.Backdrop, null, url, cancellationToken)
|
||||
await _providerManager.SaveImage(item, img, MimeTypes.GetMimeType(url), ImageType.Backdrop, null, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (item.BackdropImagePaths.Count >= backdropLimit)
|
||||
|
|
|
@ -366,6 +366,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
JsonSerializer.SerializeToFile(mainResult, dataFilePath);
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
internal Task EnsureMovieInfo(BaseItem item, CancellationToken cancellationToken)
|
||||
{
|
||||
var path = GetDataFilePath(item);
|
||||
|
@ -377,7 +378,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
// If it's recent or automatic updates are enabled, don't re-download
|
||||
if ((ConfigurationManager.Configuration.EnableTmdbUpdates) || (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 7)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -385,7 +386,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
return DownloadMovieInfo(id, item.GetPreferredMetadataLanguage(), cancellationToken);
|
||||
|
|
|
@ -391,6 +391,7 @@ namespace MediaBrowser.Providers.Music
|
|||
return false;
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
internal Task EnsureMovieXml(string musicBrainzId, CancellationToken cancellationToken)
|
||||
{
|
||||
var xmlPath = GetArtistXmlPath(_config.ApplicationPaths, musicBrainzId);
|
||||
|
@ -401,7 +402,7 @@ namespace MediaBrowser.Providers.Music
|
|||
{
|
||||
if (_config.Configuration.EnableFanArtUpdates || (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 7)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,12 @@ namespace MediaBrowser.Providers.Music
|
|||
_libraryManager = libraryManager;
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
RunInternal(progress, cancellationToken);
|
||||
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
private void RunInternal(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
|
|
|
@ -278,6 +278,7 @@ namespace MediaBrowser.Providers.TV
|
|||
}
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
internal Task EnsureSeriesXml(string tvdbId, CancellationToken cancellationToken)
|
||||
{
|
||||
var xmlPath = GetSeriesDataPath(ConfigurationManager.ApplicationPaths, tvdbId);
|
||||
|
@ -288,7 +289,7 @@ namespace MediaBrowser.Providers.TV
|
|||
{
|
||||
if (ConfigurationManager.Configuration.EnableFanArtUpdates || (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(fileInfo)).TotalDays <= 7)
|
||||
{
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -329,7 +329,7 @@ namespace MediaBrowser.Providers.TV
|
|||
/// <returns>Task.</returns>
|
||||
private Task UpdateSeries(string id, string seriesDataPath, long? lastTvDbUpdateTime, string preferredMetadataLanguage, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Info("Updating movie from tmdb " + id + ", language " + preferredMetadataLanguage);
|
||||
_logger.Info("Updating series from tvdb " + id + ", language " + preferredMetadataLanguage);
|
||||
|
||||
seriesDataPath = Path.Combine(seriesDataPath, id);
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
// Dummy up the original url
|
||||
var url = item.ServiceName + recordingInfo.Id;
|
||||
|
||||
await _providerManager.SaveImage((BaseItem)item, imageStream, contentType, ImageType.Primary, null, url, cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage((BaseItem)item, imageStream, contentType, ImageType.Primary, null, cancellationToken).ConfigureAwait(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -320,6 +320,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
}
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
/// <summary>
|
||||
/// Saves the critic reviews.
|
||||
/// </summary>
|
||||
|
@ -334,7 +335,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
|
||||
_jsonSerializer.SerializeToFile(criticReviews.ToList(), path);
|
||||
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -91,10 +91,11 @@ namespace MediaBrowser.Server.Implementations.Roku
|
|||
}, cancellationToken);
|
||||
}
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
public Task SendLibraryUpdateInfo(LibraryUpdateInfo info, CancellationToken cancellationToken)
|
||||
{
|
||||
// Roku probably won't care about this
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
public Task SendRestartRequiredNotification(CancellationToken cancellationToken)
|
||||
|
@ -110,7 +111,7 @@ namespace MediaBrowser.Server.Implementations.Roku
|
|||
public Task SendUserDataChangeInfo(UserDataChangeInfo info, CancellationToken cancellationToken)
|
||||
{
|
||||
// Roku probably won't care about this
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
public Task SendServerShutdownNotification(CancellationToken cancellationToken)
|
||||
|
|
|
@ -81,7 +81,8 @@ namespace MediaBrowser.Server.Implementations.WebSocket
|
|||
OnReceive(json);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private readonly Task _cachedTask = Task.FromResult(true);
|
||||
/// <summary>
|
||||
/// Sends the async.
|
||||
/// </summary>
|
||||
|
@ -94,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.WebSocket
|
|||
{
|
||||
UserContext.Send(bytes);
|
||||
|
||||
return Task.FromResult(true);
|
||||
return _cachedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue
Block a user