added api for external apps to report file system changes

This commit is contained in:
Luke Pulverenti
2014-01-28 16:51:47 -05:00
parent 7c5b222463
commit 40b8300e8e
2 changed files with 54 additions and 12 deletions

View File

@@ -167,6 +167,16 @@ namespace MediaBrowser.Api.Library
public bool RefreshLibrary { get; set; }
}
[Route("/Library/Changes/Path", "POST")]
public class ReportChangedPath : IReturnVoid
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Path { get; set; }
}
/// <summary>
/// Class LibraryStructureService
/// </summary>
@@ -214,6 +224,21 @@ namespace MediaBrowser.Api.Library
_logger = logger;
}
/// <summary>
/// Posts the specified request.
/// </summary>
/// <param name="request">The request.</param>
/// <exception cref="System.ArgumentException">Please supply a Path</exception>
public void Post(ReportChangedPath request)
{
if (string.IsNullOrEmpty(request.Path))
{
throw new ArgumentException("Please supply a Path");
}
_libraryMonitor.ReportFileSystemChanged(request.Path);
}
/// <summary>
/// Gets the specified request.
/// </summary>