centralize page size value

pull/702/head
Luke Pulverenti 12 years ago
parent 43d9cea6c4
commit fe645c5cad

@ -836,17 +836,13 @@ namespace MediaBrowser.Controller.Library
BaseItem item = null; BaseItem item = null;
if (userId.HasValue) if (!isIndexFolder)
{
item = libraryManager.GetItemById(new Guid(id));
}
else if (!isIndexFolder)
{ {
item = libraryManager.GetItemById(new Guid(id)); item = libraryManager.GetItemById(new Guid(id));
} }
// If we still don't find it, look within individual user views // If we still don't find it, look within individual user views
if (item == null && !userId.HasValue) if (item == null && !userId.HasValue && isIndexFolder)
{ {
foreach (var user in userManager.Users) foreach (var user in userManager.Users)
{ {

@ -72,7 +72,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <value>The name of the server.</value> /// <value>The name of the server.</value>
private string ServerName { get; set; } private string ServerName { get; set; }
private ContainerAdapter _containerAdapter; private readonly ContainerAdapter _containerAdapter;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="HttpServer" /> class. /// Initializes a new instance of the <see cref="HttpServer" /> class.
@ -149,7 +149,10 @@ namespace MediaBrowser.Server.Implementations.HttpServer
if (!string.IsNullOrEmpty(exception.Message)) if (!string.IsNullOrEmpty(exception.Message))
{ {
res.AddHeader("X-Application-Error-Code", exception.Message.Replace(Environment.NewLine, " ")); var error = exception.Message.Replace(Environment.NewLine, " ");
error = RemoveControlCharacters(error);
res.AddHeader("X-Application-Error-Code", error);
} }
} }
@ -188,6 +191,27 @@ namespace MediaBrowser.Server.Implementations.HttpServer
}); });
} }
/// <summary>
/// Removes the control characters.
/// </summary>
/// <param name="inString">The in string.</param>
/// <returns>System.String.</returns>
private static string RemoveControlCharacters(string inString)
{
if (inString == null) return null;
var newString = new StringBuilder();
foreach (var ch in inString)
{
if (!char.IsControl(ch))
{
newString.Append(ch);
}
}
return newString.ToString();
}
/// <summary> /// <summary>
/// Starts the Web Service /// Starts the Web Service
/// </summary> /// </summary>

Loading…
Cancel
Save