diff options
Diffstat (limited to 'MediaBrowser.Api/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/LibraryService.cs | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index a6e7598aa..d5d90cdb2 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -1,4 +1,6 @@ -using MediaBrowser.Controller.Persistence; +using System.Threading; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Querying; using ServiceStack.ServiceHost; using System; @@ -36,6 +38,12 @@ namespace MediaBrowser.Api public int? Limit { get; set; } } + [Route("/Library/Refresh", "POST")] + [Api(Description = "Starts a library scan")] + public class RefreshLibrary : IReturnVoid + { + } + /// <summary> /// Class LibraryService /// </summary> @@ -46,13 +54,17 @@ namespace MediaBrowser.Api /// </summary> private readonly IItemRepository _itemRepo; + private readonly ILibraryManager _libraryManager; + /// <summary> - /// Initializes a new instance of the <see cref="LibraryService"/> class. + /// Initializes a new instance of the <see cref="LibraryService" /> class. /// </summary> /// <param name="itemRepo">The item repo.</param> - public LibraryService(IItemRepository itemRepo) + /// <param name="libraryManager">The library manager.</param> + public LibraryService(IItemRepository itemRepo, ILibraryManager libraryManager) { _itemRepo = itemRepo; + _libraryManager = libraryManager; } /// <summary> @@ -68,6 +80,15 @@ namespace MediaBrowser.Api } /// <summary> + /// Posts the specified request. + /// </summary> + /// <param name="request">The request.</param> + public void Post(RefreshLibrary request) + { + _libraryManager.ValidateMediaLibrary(new Progress<double>(), CancellationToken.None); + } + + /// <summary> /// Gets the critic reviews async. /// </summary> /// <param name="request">The request.</param> |
