diff --git a/MediaBrowser.Api/HttpHandlers/GenreHandler.cs b/MediaBrowser.Api/HttpHandlers/GenreHandler.cs
index c2b70e1066..eeadf1e453 100644
--- a/MediaBrowser.Api/HttpHandlers/GenreHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/GenreHandler.cs
@@ -12,7 +12,7 @@ namespace MediaBrowser.Api.HttpHandlers
///
/// Gets a single genre
///
- public class GenreHandler : BaseJsonHandler
+ public class GenreHandler : BaseSerializationHandler
{
protected override Task GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/GenresHandler.cs b/MediaBrowser.Api/HttpHandlers/GenresHandler.cs
index 3280c3e32d..8452bae3d6 100644
--- a/MediaBrowser.Api/HttpHandlers/GenresHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/GenresHandler.cs
@@ -9,7 +9,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
- public class GenresHandler : BaseJsonHandler>
+ public class GenresHandler : BaseSerializationHandler>
{
protected override Task> GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/ItemHandler.cs b/MediaBrowser.Api/HttpHandlers/ItemHandler.cs
index 4f2a9c68e5..35310f042b 100644
--- a/MediaBrowser.Api/HttpHandlers/ItemHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/ItemHandler.cs
@@ -8,7 +8,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
- public class ItemHandler : BaseJsonHandler
+ public class ItemHandler : BaseSerializationHandler
{
protected override Task GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/ItemListHandler.cs b/MediaBrowser.Api/HttpHandlers/ItemListHandler.cs
index 9d5e3eb580..09814b191d 100644
--- a/MediaBrowser.Api/HttpHandlers/ItemListHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/ItemListHandler.cs
@@ -9,7 +9,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
- public class ItemListHandler : BaseJsonHandler
+ public class ItemListHandler : BaseSerializationHandler
{
protected override Task GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/PersonHandler.cs b/MediaBrowser.Api/HttpHandlers/PersonHandler.cs
index 3c34efae50..0d496c2406 100644
--- a/MediaBrowser.Api/HttpHandlers/PersonHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/PersonHandler.cs
@@ -12,7 +12,7 @@ namespace MediaBrowser.Api.HttpHandlers
///
/// Gets a single Person
///
- public class PersonHandler : BaseJsonHandler
+ public class PersonHandler : BaseSerializationHandler
{
protected override Task GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/PluginConfigurationHandler.cs b/MediaBrowser.Api/HttpHandlers/PluginConfigurationHandler.cs
index fbc16109d8..6abfb9b2d8 100644
--- a/MediaBrowser.Api/HttpHandlers/PluginConfigurationHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/PluginConfigurationHandler.cs
@@ -7,7 +7,7 @@ using MediaBrowser.Model.Plugins;
namespace MediaBrowser.Api.HttpHandlers
{
- public class PluginConfigurationHandler : BaseJsonHandler
+ public class PluginConfigurationHandler : BaseSerializationHandler
{
protected override Task GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs
index 1cb4e95f76..67246cbc6a 100644
--- a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs
@@ -10,7 +10,7 @@ namespace MediaBrowser.Api.HttpHandlers
///
/// Provides information about installed plugins
///
- public class PluginsHandler : BaseJsonHandler>
+ public class PluginsHandler : BaseSerializationHandler>
{
protected override Task> GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/StudioHandler.cs b/MediaBrowser.Api/HttpHandlers/StudioHandler.cs
index af7e7fed0b..458dd9da13 100644
--- a/MediaBrowser.Api/HttpHandlers/StudioHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/StudioHandler.cs
@@ -12,7 +12,7 @@ namespace MediaBrowser.Api.HttpHandlers
///
/// Gets a single studio
///
- public class StudioHandler : BaseJsonHandler
+ public class StudioHandler : BaseSerializationHandler
{
protected override Task GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/StudiosHandler.cs b/MediaBrowser.Api/HttpHandlers/StudiosHandler.cs
index 64348ac896..0f1e087fe3 100644
--- a/MediaBrowser.Api/HttpHandlers/StudiosHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/StudiosHandler.cs
@@ -9,7 +9,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
- public class StudiosHandler : BaseJsonHandler>
+ public class StudiosHandler : BaseSerializationHandler>
{
protected override Task> GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/UsersHandler.cs b/MediaBrowser.Api/HttpHandlers/UsersHandler.cs
index ad9ffec980..1c7ea6b275 100644
--- a/MediaBrowser.Api/HttpHandlers/UsersHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/UsersHandler.cs
@@ -6,7 +6,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
- class UsersHandler : BaseJsonHandler>
+ class UsersHandler : BaseSerializationHandler>
{
protected override Task> GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/YearHandler.cs b/MediaBrowser.Api/HttpHandlers/YearHandler.cs
index 0eb674e272..1b0c7f6704 100644
--- a/MediaBrowser.Api/HttpHandlers/YearHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/YearHandler.cs
@@ -12,7 +12,7 @@ namespace MediaBrowser.Api.HttpHandlers
///
/// Gets a single year
///
- public class YearHandler : BaseJsonHandler
+ public class YearHandler : BaseSerializationHandler
{
protected override Task GetObjectToSerialize()
{
diff --git a/MediaBrowser.Api/HttpHandlers/YearsHandler.cs b/MediaBrowser.Api/HttpHandlers/YearsHandler.cs
index ee07ac8b0b..449be7c5eb 100644
--- a/MediaBrowser.Api/HttpHandlers/YearsHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/YearsHandler.cs
@@ -9,7 +9,7 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
- public class YearsHandler : BaseJsonHandler>
+ public class YearsHandler : BaseSerializationHandler>
{
protected override Task> GetObjectToSerialize()
{
diff --git a/MediaBrowser.Common/Net/Handlers/BaseSerializationHandler.cs b/MediaBrowser.Common/Net/Handlers/BaseSerializationHandler.cs
index 4229dce613..a0696d4a61 100644
--- a/MediaBrowser.Common/Net/Handlers/BaseSerializationHandler.cs
+++ b/MediaBrowser.Common/Net/Handlers/BaseSerializationHandler.cs
@@ -1,11 +1,11 @@
-using System.IO;
+using System;
+using System.IO;
using System.Threading.Tasks;
using MediaBrowser.Common.Serialization;
-using System;
namespace MediaBrowser.Common.Net.Handlers
{
- public abstract class BaseJsonHandler : BaseHandler
+ public abstract class BaseSerializationHandler : BaseHandler
{
public SerializationFormat SerializationFormat
{
@@ -28,6 +28,8 @@ namespace MediaBrowser.Common.Net.Handlers
{
case Handlers.SerializationFormat.Jsv:
return Task.FromResult("text/plain");
+ case Handlers.SerializationFormat.Protobuf:
+ return Task.FromResult("application/x-protobuf");
default:
return Task.FromResult(MimeTypes.JsonMimeType);
}
@@ -67,6 +69,9 @@ namespace MediaBrowser.Common.Net.Handlers
case Handlers.SerializationFormat.Jsv:
JsvSerializer.SerializeToStream(_ObjectToSerialize, stream);
break;
+ case Handlers.SerializationFormat.Protobuf:
+ ProtobufSerializer.SerializeToStream(_ObjectToSerialize, stream);
+ break;
default:
JsonSerializer.SerializeToStream(_ObjectToSerialize, stream);
break;
@@ -77,7 +82,8 @@ namespace MediaBrowser.Common.Net.Handlers
public enum SerializationFormat
{
Json,
- Jsv
+ Jsv,
+ Protobuf
}
}