aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/ServiceController.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-19 15:43:35 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-19 15:43:35 -0400
commit1ad990ad720931309afadd9f7912d66595dcc04e (patch)
tree7769cfe0e14092046bb772607f31c1fbc908be1d /Emby.Server.Implementations/Services/ServiceController.cs
parentbd31c0175d87ec00a675b92ae9a92af569228775 (diff)
update live tv data transfer
Diffstat (limited to 'Emby.Server.Implementations/Services/ServiceController.cs')
-rw-r--r--Emby.Server.Implementations/Services/ServiceController.cs40
1 files changed, 7 insertions, 33 deletions
diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.cs
index 4ad56411a..c3970b22f 100644
--- a/Emby.Server.Implementations/Services/ServiceController.cs
+++ b/Emby.Server.Implementations/Services/ServiceController.cs
@@ -29,13 +29,6 @@ namespace Emby.Server.Implementations.Services
}
}
- private Type[] GetGenericArguments(Type type)
- {
- return type.GetTypeInfo().IsGenericTypeDefinition
- ? type.GetTypeInfo().GenericTypeParameters
- : type.GetTypeInfo().GenericTypeArguments;
- }
-
public void RegisterService(HttpListenerHost appHost, Type serviceType)
{
var processedReqs = new HashSet<Type>();
@@ -50,38 +43,19 @@ namespace Emby.Server.Implementations.Services
ServiceExecGeneral.CreateServiceRunnersFor(requestType, actions);
- var returnMarker = GetTypeWithGenericTypeDefinitionOf(requestType, typeof(IReturn<>));
- var responseType = returnMarker != null ?
- GetGenericArguments(returnMarker)[0]
- : mi.ReturnType != typeof(object) && mi.ReturnType != typeof(void) ?
- mi.ReturnType
- : Type.GetType(requestType.FullName + "Response");
+ //var returnMarker = GetTypeWithGenericTypeDefinitionOf(requestType, typeof(IReturn<>));
+ //var responseType = returnMarker != null ?
+ // GetGenericArguments(returnMarker)[0]
+ // : mi.ReturnType != typeof(object) && mi.ReturnType != typeof(void) ?
+ // mi.ReturnType
+ // : Type.GetType(requestType.FullName + "Response");
RegisterRestPaths(appHost, requestType);
- appHost.AddServiceInfo(serviceType, requestType, responseType);
+ appHost.AddServiceInfo(serviceType, requestType);
}
}
- private static Type GetTypeWithGenericTypeDefinitionOf(Type type, Type genericTypeDefinition)
- {
- foreach (var t in type.GetTypeInfo().ImplementedInterfaces)
- {
- if (t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == genericTypeDefinition)
- {
- return t;
- }
- }
-
- var genericType = FirstGenericType(type);
- if (genericType != null && genericType.GetGenericTypeDefinition() == genericTypeDefinition)
- {
- return genericType;
- }
-
- return null;
- }
-
public static Type FirstGenericType(Type type)
{
while (type != null)