aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common.Implementations')
-rw-r--r--MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs14
-rw-r--r--MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs6
-rw-r--r--MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs2
3 files changed, 16 insertions, 6 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs b/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs
index 65195c52b..1c64194a6 100644
--- a/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs
+++ b/MediaBrowser.Common.Implementations/HttpServer/BaseRestService.cs
@@ -11,7 +11,6 @@ using System;
using System.Globalization;
using System.IO;
using System.Linq;
-using System.Net;
using System.Threading.Tasks;
using MimeTypes = MediaBrowser.Common.Net.MimeTypes;
@@ -94,7 +93,8 @@ namespace MediaBrowser.Common.Implementations.HttpServer
if (result != null)
{
- return result;
+ // Return null so that service stack won't do anything
+ return null;
}
return ToOptimizedResult(factoryFn());
@@ -129,7 +129,8 @@ namespace MediaBrowser.Common.Implementations.HttpServer
if (result != null)
{
- return result;
+ // Return null so that service stack won't do anything
+ return null;
}
return factoryFn();
@@ -192,7 +193,8 @@ namespace MediaBrowser.Common.Implementations.HttpServer
if (result != null)
{
- return result;
+ // Return null so that service stack won't do anything
+ return null;
}
var compress = ShouldCompressResponse(contentType);
@@ -299,7 +301,9 @@ namespace MediaBrowser.Common.Implementations.HttpServer
Response.ContentType = contentType;
}
- return new HttpResult(new byte[] { }, HttpStatusCode.NotModified);
+ Response.StatusCode = 304;
+
+ return new byte[]{};
}
SetCachingHeaders(cacheKeyString, lastDateModified, cacheDuration);
diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
index e618b6f55..eada38556 100644
--- a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
+++ b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
@@ -367,6 +367,12 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
OnTaskCompleted(startTime, endTime, status);
}
+ /// <summary>
+ /// Executes the task.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <param name="progress">The progress.</param>
+ /// <returns>Task.</returns>
private Task ExecuteTask(CancellationToken cancellationToken, IProgress<double> progress)
{
return Task.Run(async () => await ScheduledTask.Execute(cancellationToken, progress).ConfigureAwait(false));
diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs
index 335820e1c..efd3478a1 100644
--- a/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs
+++ b/MediaBrowser.Common.Implementations/ScheduledTasks/TaskManager.cs
@@ -100,7 +100,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
QueueScheduledTask(scheduledTask);
}
-
+
/// <summary>
/// Queues the scheduled task.
/// </summary>