aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-11-14 21:31:03 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-11-14 21:31:03 -0500
commita4b75934e5a4737ba7721c33ad9a009060a8a246 (patch)
treea738ce7e7a6b707107b438220457d73585d0e4dd /MediaBrowser.Api/Library
parent15a56fa069d85382fa2e053a9a60e763308c2d66 (diff)
revise endpoint attributes
Diffstat (limited to 'MediaBrowser.Api/Library')
-rw-r--r--MediaBrowser.Api/Library/FileOrganizationService.cs17
-rw-r--r--MediaBrowser.Api/Library/LibraryService.cs53
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs5
3 files changed, 34 insertions, 41 deletions
diff --git a/MediaBrowser.Api/Library/FileOrganizationService.cs b/MediaBrowser.Api/Library/FileOrganizationService.cs
index adf6a522b3..29a9826295 100644
--- a/MediaBrowser.Api/Library/FileOrganizationService.cs
+++ b/MediaBrowser.Api/Library/FileOrganizationService.cs
@@ -7,8 +7,7 @@ using System.Threading.Tasks;
namespace MediaBrowser.Api.Library
{
- [Route("/Library/FileOrganization", "GET")]
- [Api(Description = "Gets file organization results")]
+ [Route("/Library/FileOrganization", "GET", Summary = "Gets file organization results")]
public class GetFileOrganizationActivity : IReturn<QueryResult<FileOrganizationResult>>
{
/// <summary>
@@ -26,14 +25,12 @@ namespace MediaBrowser.Api.Library
public int? Limit { get; set; }
}
- [Route("/Library/FileOrganizations", "DELETE")]
- [Api(Description = "Clears the activity log")]
+ [Route("/Library/FileOrganizations", "DELETE", Summary = "Clears the activity log")]
public class ClearOrganizationLog : IReturnVoid
{
}
- [Route("/Library/FileOrganizations/{Id}/File", "DELETE")]
- [Api(Description = "Deletes the original file of a organizer result")]
+ [Route("/Library/FileOrganizations/{Id}/File", "DELETE", Summary = "Deletes the original file of a organizer result")]
public class DeleteOriginalFile : IReturnVoid
{
/// <summary>
@@ -44,8 +41,7 @@ namespace MediaBrowser.Api.Library
public string Id { get; set; }
}
- [Route("/Library/FileOrganizations/{Id}/Organize", "POST")]
- [Api(Description = "Performs an organization")]
+ [Route("/Library/FileOrganizations/{Id}/Organize", "POST", Summary = "Performs an organization")]
public class PerformOrganization : IReturn<QueryResult<FileOrganizationResult>>
{
/// <summary>
@@ -56,8 +52,7 @@ namespace MediaBrowser.Api.Library
public string Id { get; set; }
}
- [Route("/Library/FileOrganizations/{Id}/Episode/Organize", "POST")]
- [Api(Description = "Performs an organization")]
+ [Route("/Library/FileOrganizations/{Id}/Episode/Organize", "POST", Summary = "Performs an organization")]
public class OrganizeEpisode
{
[ApiMember(Name = "Id", Description = "Result Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
@@ -79,7 +74,7 @@ namespace MediaBrowser.Api.Library
public bool RememberCorrection { get; set; }
}
- [Authenticated]
+ [Authenticated(Roles = "Admin")]
public class FileOrganizationService : BaseApiService
{
private readonly IFileOrganizationService _iFileOrganizationService;
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs
index 231f5e9a6c..ec7b1f0b35 100644
--- a/MediaBrowser.Api/Library/LibraryService.cs
+++ b/MediaBrowser.Api/Library/LibraryService.cs
@@ -23,8 +23,8 @@ using System.Threading.Tasks;
namespace MediaBrowser.Api.Library
{
- [Route("/Items/{Id}/File", "GET")]
- [Api(Description = "Gets the original file of an item")]
+ [Route("/Items/{Id}/File", "GET", Summary = "Gets the original file of an item")]
+ [Authenticated]
public class GetFile
{
/// <summary>
@@ -38,8 +38,8 @@ namespace MediaBrowser.Api.Library
/// <summary>
/// Class GetCriticReviews
/// </summary>
- [Route("/Items/{Id}/CriticReviews", "GET")]
- [Api(Description = "Gets critic reviews for an item")]
+ [Route("/Items/{Id}/CriticReviews", "GET", Summary = "Gets critic reviews for an item")]
+ [Authenticated]
public class GetCriticReviews : IReturn<QueryResult<ItemReview>>
{
/// <summary>
@@ -67,8 +67,8 @@ namespace MediaBrowser.Api.Library
/// <summary>
/// Class GetThemeSongs
/// </summary>
- [Route("/Items/{Id}/ThemeSongs", "GET")]
- [Api(Description = "Gets theme songs for an item")]
+ [Route("/Items/{Id}/ThemeSongs", "GET", Summary = "Gets theme songs for an item")]
+ [Authenticated]
public class GetThemeSongs : IReturn<ThemeMediaResult>
{
/// <summary>
@@ -92,8 +92,8 @@ namespace MediaBrowser.Api.Library
/// <summary>
/// Class GetThemeVideos
/// </summary>
- [Route("/Items/{Id}/ThemeVideos", "GET")]
- [Api(Description = "Gets theme videos for an item")]
+ [Route("/Items/{Id}/ThemeVideos", "GET", Summary = "Gets theme videos for an item")]
+ [Authenticated]
public class GetThemeVideos : IReturn<ThemeMediaResult>
{
/// <summary>
@@ -117,8 +117,8 @@ namespace MediaBrowser.Api.Library
/// <summary>
/// Class GetThemeVideos
/// </summary>
- [Route("/Items/{Id}/ThemeMedia", "GET")]
- [Api(Description = "Gets theme videos and songs for an item")]
+ [Route("/Items/{Id}/ThemeMedia", "GET", Summary = "Gets theme videos and songs for an item")]
+ [Authenticated]
public class GetThemeMedia : IReturn<AllThemeMediaResult>
{
/// <summary>
@@ -139,14 +139,14 @@ namespace MediaBrowser.Api.Library
public bool InheritFromParent { get; set; }
}
- [Route("/Library/Refresh", "POST")]
- [Api(Description = "Starts a library scan")]
+ [Route("/Library/Refresh", "POST", Summary = "Starts a library scan")]
+ [Authenticated(Roles = "Admin")]
public class RefreshLibrary : IReturnVoid
{
}
- [Route("/Items/{Id}", "DELETE")]
- [Api(Description = "Deletes an item from the library and file system")]
+ [Route("/Items/{Id}", "DELETE", Summary = "Deletes an item from the library and file system")]
+ [Authenticated(Roles = "Delete")]
public class DeleteItem : IReturnVoid
{
[ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
@@ -154,7 +154,7 @@ namespace MediaBrowser.Api.Library
}
[Route("/Items/Counts", "GET")]
- [Api(Description = "Gets counts of various item types")]
+ [Authenticated]
public class GetItemCounts : IReturn<ItemCounts>
{
[ApiMember(Name = "UserId", Description = "Optional. Get counts from a specific user's library.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
@@ -164,8 +164,8 @@ namespace MediaBrowser.Api.Library
public bool? IsFavorite { get; set; }
}
- [Route("/Items/{Id}/Ancestors", "GET")]
- [Api(Description = "Gets all parents of an item")]
+ [Route("/Items/{Id}/Ancestors", "GET", Summary = "Gets all parents of an item")]
+ [Authenticated]
public class GetAncestors : IReturn<BaseItemDto[]>
{
/// <summary>
@@ -183,8 +183,8 @@ namespace MediaBrowser.Api.Library
public string Id { get; set; }
}
- [Route("/Items/YearIndex", "GET")]
- [Api(Description = "Gets a year index based on an item query.")]
+ [Route("/Items/YearIndex", "GET", Summary = "Gets a year index based on an item query.")]
+ [Authenticated]
public class GetYearIndex : IReturn<List<ItemIndex>>
{
/// <summary>
@@ -201,23 +201,23 @@ namespace MediaBrowser.Api.Library
/// <summary>
/// Class GetPhyscialPaths
/// </summary>
- [Route("/Library/PhysicalPaths", "GET")]
- [Api(Description = "Gets a list of physical paths from virtual folders")]
+ [Route("/Library/PhysicalPaths", "GET", Summary = "Gets a list of physical paths from virtual folders")]
+ [Authenticated(Roles = "Admin")]
public class GetPhyscialPaths : IReturn<List<string>>
{
}
- [Route("/Library/MediaFolders", "GET")]
- [Api(Description = "Gets all user media folders.")]
+ [Route("/Library/MediaFolders", "GET", Summary = "Gets all user media folders.")]
+ [Authenticated]
public class GetMediaFolders : IReturn<ItemsResult>
{
[ApiMember(Name = "IsHidden", Description = "Optional. Filter by folders that are marked hidden, or not.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
public bool? IsHidden { get; set; }
}
- [Route("/Library/Series/Added", "POST")]
- [Route("/Library/Series/Updated", "POST")]
- [Api(Description = "Reports that new episodes of a series have been added by an external source")]
+ [Route("/Library/Series/Added", "POST", Summary = "Reports that new episodes of a series have been added by an external source")]
+ [Route("/Library/Series/Updated", "POST", Summary = "Reports that new episodes of a series have been added by an external source")]
+ [Authenticated]
public class PostUpdatedSeries : IReturnVoid
{
[ApiMember(Name = "TvdbId", Description = "Tvdb Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET")]
@@ -227,7 +227,6 @@ namespace MediaBrowser.Api.Library
/// <summary>
/// Class LibraryService
/// </summary>
- [Authenticated]
public class LibraryService : BaseApiService
{
/// <summary>
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs
index f56daca1e7..ee80d4b734 100644
--- a/MediaBrowser.Api/Library/LibraryStructureService.cs
+++ b/MediaBrowser.Api/Library/LibraryStructureService.cs
@@ -131,11 +131,11 @@ namespace MediaBrowser.Api.Library
/// <value><c>true</c> if [refresh library]; otherwise, <c>false</c>.</value>
public bool RefreshLibrary { get; set; }
}
-
+
/// <summary>
/// Class LibraryStructureService
/// </summary>
- [Authenticated]
+ [Authenticated(Roles = "Admin", AllowBeforeStartupWizard = true)]
public class LibraryStructureService : BaseApiService
{
/// <summary>
@@ -164,7 +164,6 @@ namespace MediaBrowser.Api.Library
/// <param name="appPaths">The app paths.</param>
/// <param name="userManager">The user manager.</param>
/// <param name="libraryManager">The library manager.</param>
- /// <exception cref="System.ArgumentNullException">appPaths</exception>
public LibraryStructureService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, ILibraryMonitor libraryMonitor, IFileSystem fileSystem, ILogger logger)
{
if (appPaths == null)