mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-17 07:36:37 +00:00
added the beginning of a service stack abstraction
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Net;
|
||||
@@ -451,5 +452,14 @@ namespace MediaBrowser.Common.Implementations.HttpServer
|
||||
Response.AddHeader("Age", Convert.ToInt64((DateTime.UtcNow - lastDateModified.Value).TotalSeconds).ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the routes.
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{RouteInfo}.</returns>
|
||||
public IEnumerable<RouteInfo> GetRoutes()
|
||||
{
|
||||
return new RouteInfo[] {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,6 +511,11 @@ namespace MediaBrowser.Common.Implementations.HttpServer
|
||||
EndpointHost.ConfigureHost(this, ServerName, CreateServiceManager());
|
||||
ContentTypeFilters.Register(ContentType.ProtoBuf, (reqCtx, res, stream) => ProtobufSerializer.SerializeToStream(res, stream), (type, stream) => ProtobufSerializer.DeserializeFromStream(stream, type));
|
||||
|
||||
foreach (var route in services.SelectMany(i => i.GetRoutes()))
|
||||
{
|
||||
Routes.Add(route.RequestType, route.Path, route.Verbs);
|
||||
}
|
||||
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user