consolidate slideout panels

This commit is contained in:
Luke Pulverenti
2015-05-29 19:51:33 -04:00
parent 81a90a49b3
commit 4e04d31c7d
34 changed files with 171 additions and 135 deletions

View File

@@ -40,7 +40,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
}
/// <summary>
@@ -84,9 +84,9 @@ namespace MediaBrowser.Api.UserLibrary
var dtoOptions = GetDtoOptions(request);
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
var user = UserManager.GetUserById(request.UserId.Value);
var user = UserManager.GetUserById(request.UserId);
return DtoService.GetBaseItemDto(item, dtoOptions, user);
}

View File

@@ -61,9 +61,9 @@ namespace MediaBrowser.Api.UserLibrary
BaseItem parentItem;
List<BaseItem> libraryItems = null;
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
user = UserManager.GetUserById(request.UserId.Value);
user = UserManager.GetUserById(request.UserId);
parentItem = string.IsNullOrEmpty(request.ParentId) ? user.RootFolder : LibraryManager.GetItemById(request.ParentId);
if (RequiresLibraryItems(request, dtoOptions))
@@ -92,7 +92,7 @@ namespace MediaBrowser.Api.UserLibrary
{
var folder = (Folder)parentItem;
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
items = request.Recursive ?
folder.GetRecursiveChildren(user, filter) :
@@ -388,7 +388,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
[ApiMember(Name = "NameStartsWithOrGreater", Description = "Optional filter by items whose name is sorted equally or greater than a given input string.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string NameStartsWithOrGreater { get; set; }

View File

@@ -37,7 +37,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
}
[Authenticated]
@@ -71,9 +71,9 @@ namespace MediaBrowser.Api.UserLibrary
var dtoOptions = GetDtoOptions(request);
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
var user = UserManager.GetUserById(request.UserId.Value);
var user = UserManager.GetUserById(request.UserId);
return DtoService.GetBaseItemDto(item, dtoOptions, user);
}

View File

@@ -39,7 +39,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
}
/// <summary>
@@ -76,9 +76,9 @@ namespace MediaBrowser.Api.UserLibrary
var dtoOptions = GetDtoOptions(request);
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
var user = UserManager.GetUserById(request.UserId.Value);
var user = UserManager.GetUserById(request.UserId);
return DtoService.GetBaseItemDto(item, dtoOptions, user);
}

View File

@@ -30,7 +30,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Limit results to items containing a specific person
@@ -325,7 +325,7 @@ namespace MediaBrowser.Api.UserLibrary
private async Task<ItemsResult> GetItems(GetItems request)
{
var parentItem = string.IsNullOrEmpty(request.ParentId) ? null : _libraryManager.GetItemById(request.ParentId);
var user = request.UserId.HasValue ? _userManager.GetUserById(request.UserId.Value) : null;
var user = !string.IsNullOrWhiteSpace(request.UserId) ? _userManager.GetUserById(request.UserId) : null;
var result = await GetItemsToSerialize(request, user, parentItem).ConfigureAwait(false);

View File

@@ -37,7 +37,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
}
[Authenticated]
@@ -71,9 +71,9 @@ namespace MediaBrowser.Api.UserLibrary
var dtoOptions = GetDtoOptions(request);
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
var user = UserManager.GetUserById(request.UserId.Value);
var user = UserManager.GetUserById(request.UserId);
return DtoService.GetBaseItemDto(item, dtoOptions, user);
}

View File

@@ -43,7 +43,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
}
/// <summary>
@@ -87,9 +87,9 @@ namespace MediaBrowser.Api.UserLibrary
var dtoOptions = GetDtoOptions(request);
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
var user = UserManager.GetUserById(request.UserId.Value);
var user = UserManager.GetUserById(request.UserId);
return DtoService.GetBaseItemDto(item, dtoOptions, user);
}

View File

@@ -23,7 +23,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public Guid UserId { get; set; }
public string UserId { get; set; }
[ApiMember(Name = "DatePlayed", Description = "The date the item was played (if any). Format = yyyyMMddHHmmss", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public string DatePlayed { get; set; }
@@ -47,7 +47,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -90,7 +90,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -143,7 +143,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -198,7 +198,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.

View File

@@ -38,7 +38,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
}
/// <summary>
@@ -75,9 +75,9 @@ namespace MediaBrowser.Api.UserLibrary
var dtoOptions = GetDtoOptions(request);
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
var user = UserManager.GetUserById(request.UserId.Value);
var user = UserManager.GetUserById(request.UserId);
return DtoService.GetBaseItemDto(item, dtoOptions, user);
}

View File

@@ -5,9 +5,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Library;
using MediaBrowser.Model.Querying;
using MoreLinq;
using ServiceStack;
using System;
using System.Collections.Generic;
@@ -28,7 +26,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -49,7 +47,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid UserId { get; set; }
public string UserId { get; set; }
}
/// <summary>
@@ -63,7 +61,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the item id.
@@ -84,7 +82,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -105,7 +103,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -126,7 +124,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -147,7 +145,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -175,7 +173,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -196,7 +194,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid UserId { get; set; }
public string UserId { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -515,7 +513,7 @@ namespace MediaBrowser.Api.UserLibrary
/// <param name="itemId">The item id.</param>
/// <param name="isFavorite">if set to <c>true</c> [is favorite].</param>
/// <returns>Task{UserItemDataDto}.</returns>
private async Task<UserItemDataDto> MarkFavorite(Guid userId, string itemId, bool isFavorite)
private async Task<UserItemDataDto> MarkFavorite(string userId, string itemId, bool isFavorite)
{
var user = _userManager.GetUserById(userId);
@@ -563,7 +561,7 @@ namespace MediaBrowser.Api.UserLibrary
/// <param name="itemId">The item id.</param>
/// <param name="likes">if set to <c>true</c> [likes].</param>
/// <returns>Task{UserItemDataDto}.</returns>
private async Task<UserItemDataDto> UpdateUserItemRating(Guid userId, string itemId, bool? likes)
private async Task<UserItemDataDto> UpdateUserItemRating(string userId, string itemId, bool? likes)
{
var user = _userManager.GetUserById(userId);

View File

@@ -38,7 +38,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "Optional. Filter by user id, and attach user data", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public Guid? UserId { get; set; }
public string UserId { get; set; }
}
/// <summary>
@@ -75,9 +75,9 @@ namespace MediaBrowser.Api.UserLibrary
var dtoOptions = GetDtoOptions(request);
if (request.UserId.HasValue)
if (!string.IsNullOrWhiteSpace(request.UserId))
{
var user = UserManager.GetUserById(request.UserId.Value);
var user = UserManager.GetUserById(request.UserId);
return DtoService.GetBaseItemDto(item, dtoOptions, user);
}