diff options
| author | Techywarrior <techywarrior@gmail.com> | 2013-04-13 11:11:19 -0700 |
|---|---|---|
| committer | Techywarrior <techywarrior@gmail.com> | 2013-04-13 11:11:19 -0700 |
| commit | 6b47336da308c77e441b82c6a985db88c6d3ade3 (patch) | |
| tree | 455a36e52c4ca35e3b38060f96904fa4be5ee854 /MediaBrowser.Api/UserLibrary/PersonsService.cs | |
| parent | dc8d9810b7a99bdcbc4959a77750b3cfee1e88b5 (diff) | |
| parent | 157a53a9f6d88c7f9db2346e42e010fe98734204 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/PersonsService.cs')
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/PersonsService.cs | 65 |
1 files changed, 3 insertions, 62 deletions
diff --git a/MediaBrowser.Api/UserLibrary/PersonsService.cs b/MediaBrowser.Api/UserLibrary/PersonsService.cs index 4253ddc80..974b8c002 100644 --- a/MediaBrowser.Api/UserLibrary/PersonsService.cs +++ b/MediaBrowser.Api/UserLibrary/PersonsService.cs @@ -1,5 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Persistence; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; @@ -22,52 +23,14 @@ namespace MediaBrowser.Api.UserLibrary /// <value>The person types.</value> public string PersonTypes { get; set; } } - - [Route("/Users/{UserId}/FavoritePersons/{Name}", "POST")] - [Api(Description = "Marks a person as a favorite")] - public class MarkFavoritePerson : IReturnVoid - { - /// <summary> - /// Gets or sets the user id. - /// </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; } - - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - [ApiMember(Name = "Name", Description = "Name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] - public string Name { get; set; } - } - - [Route("/Users/{UserId}/FavoritePersons/{Name}", "DELETE")] - [Api(Description = "Unmarks a person as a favorite")] - public class UnmarkFavoritePerson : IReturnVoid - { - /// <summary> - /// Gets or sets the user id. - /// </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; } - - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - [ApiMember(Name = "Name", Description = "Name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")] - public string Name { get; set; } - } /// <summary> /// Class PersonsService /// </summary> public class PersonsService : BaseItemsByNameService<Person> { - public PersonsService(IUserManager userManager, ILibraryManager libraryManager) - : base(userManager, libraryManager) + public PersonsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository) + : base(userManager, libraryManager, userDataRepository) { } @@ -84,28 +47,6 @@ namespace MediaBrowser.Api.UserLibrary } /// <summary> - /// Posts the specified request. - /// </summary> - /// <param name="request">The request.</param> - public void Post(MarkFavoritePerson request) - { - var task = MarkFavorite(() => LibraryManager.GetPerson(request.Name), request.UserId, true); - - Task.WaitAll(task); - } - - /// <summary> - /// Deletes the specified request. - /// </summary> - /// <param name="request">The request.</param> - public void Delete(UnmarkFavoritePerson request) - { - var task = MarkFavorite(() => LibraryManager.GetPerson(request.Name), request.UserId, false); - - Task.WaitAll(task); - } - - /// <summary> /// Gets all items. /// </summary> /// <param name="request">The request.</param> |
