aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/ServicePath.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Services/ServicePath.cs')
-rw-r--r--Emby.Server.Implementations/Services/ServicePath.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs
index 278379a92..3b7ffaf2c 100644
--- a/Emby.Server.Implementations/Services/ServicePath.cs
+++ b/Emby.Server.Implementations/Services/ServicePath.cs
@@ -62,7 +62,9 @@ namespace Emby.Server.Implementations.Services
public string Path => this.restPath;
public string Summary { get; private set; }
+
public string Description { get; private set; }
+
public bool IsHidden { get; private set; }
public static string[] GetPathPartsForMatching(string pathInfo)
@@ -118,7 +120,7 @@ namespace Emby.Server.Implementations.Services
var componentsList = new List<string>();
- //We only split on '.' if the restPath has them. Allows for /{action}.{type}
+ // We only split on '.' if the restPath has them. Allows for /{action}.{type}
var hasSeparators = new List<bool>();
foreach (var component in this.restPath.Split(PathSeperatorChar))
{
@@ -159,6 +161,7 @@ namespace Emby.Server.Implementations.Services
this.isWildcard[i] = true;
variableName = variableName.Substring(0, variableName.Length - 1);
}
+
this.variablesNames[i] = variableName;
this.VariableArgsCount++;
}
@@ -298,12 +301,12 @@ namespace Emby.Server.Implementations.Services
return -1;
}
- //Routes with least wildcard matches get the highest score
+ // Routes with least wildcard matches get the highest score
var score = Math.Max((100 - wildcardMatchCount), 1) * 1000
- //Routes with less variable (and more literal) matches
+ // Routes with less variable (and more literal) matches
+ Math.Max((10 - VariableArgsCount), 1) * 100;
- //Exact verb match is better than ANY
+ // Exact verb match is better than ANY
if (Verbs.Length == 1 && string.Equals(httpMethod, Verbs[0], StringComparison.OrdinalIgnoreCase))
{
score += 10;
@@ -470,7 +473,7 @@ namespace Emby.Server.Implementations.Services
+ variableName + " on " + RequestType.GetMethodName());
}
- var value = requestComponents.Length > pathIx ? requestComponents[pathIx] : null; //wildcard has arg mismatch
+ var value = requestComponents.Length > pathIx ? requestComponents[pathIx] : null; // wildcard has arg mismatch
if (value != null && this.isWildcard[i])
{
if (i == this.TotalComponentsCount - 1)
@@ -519,8 +522,8 @@ namespace Emby.Server.Implementations.Services
if (queryStringAndFormData != null)
{
- //Query String and form data can override variable path matches
- //path variables < query string < form data
+ // Query String and form data can override variable path matches
+ // path variables < query string < form data
foreach (var name in queryStringAndFormData)
{
requestKeyValuesMap[name.Key] = name.Value;