aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/ItemRefreshController.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-06-25 16:05:15 -0600
committercrobibero <cody@robibe.ro>2020-06-25 16:05:15 -0600
commit0740ec611211cb121a2ea4f97ab43b92d6411d4d (patch)
treebcc5fee8f82e30ebe087966115320dbf66d1fd5c /Jellyfin.Api/Controllers/ItemRefreshController.cs
parentccd7b3f52435de880158bc41dec9268dc9acbdd5 (diff)
parent7bd91727791d5723e779e63b913e8650380048ce (diff)
Merge remote-tracking branch 'upstream/api-migration' into api-image-service
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemRefreshController.cs')
-rw-r--r--Jellyfin.Api/Controllers/ItemRefreshController.cs25
1 files changed, 12 insertions, 13 deletions
diff --git a/Jellyfin.Api/Controllers/ItemRefreshController.cs b/Jellyfin.Api/Controllers/ItemRefreshController.cs
index 6a16a89c5..3801ce5b7 100644
--- a/Jellyfin.Api/Controllers/ItemRefreshController.cs
+++ b/Jellyfin.Api/Controllers/ItemRefreshController.cs
@@ -1,5 +1,7 @@
+using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
+using Jellyfin.Api.Constants;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
@@ -14,7 +16,7 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// [Authenticated]
[Route("/Items")]
- [Authorize]
+ [Authorize(Policy = Policies.DefaultAuthorization)]
public class ItemRefreshController : BaseJellyfinApiController
{
private readonly ILibraryManager _libraryManager;
@@ -40,29 +42,26 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Refreshes metadata for an item.
/// </summary>
- /// <param name="id">Item id.</param>
+ /// <param name="itemId">Item id.</param>
/// <param name="metadataRefreshMode">(Optional) Specifies the metadata refresh mode.</param>
/// <param name="imageRefreshMode">(Optional) Specifies the image refresh mode.</param>
/// <param name="replaceAllMetadata">(Optional) Determines if metadata should be replaced. Only applicable if mode is FullRefresh.</param>
/// <param name="replaceAllImages">(Optional) Determines if images should be replaced. Only applicable if mode is FullRefresh.</param>
- /// <param name="recursive">(Unused) Indicates if the refresh should occur recursively.</param>
- /// <response code="200">Item metadata refresh queued.</response>
+ /// <response code="204">Item metadata refresh queued.</response>
/// <response code="404">Item to refresh not found.</response>
- /// <returns>An <see cref="OkResult"/> on success, or a <see cref="NotFoundResult"/> if the item could not be found.</returns>
- [HttpPost("{Id}/Refresh")]
+ /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the item could not be found.</returns>
+ [HttpPost("{itemId}/Refresh")]
[Description("Refreshes metadata for an item.")]
- [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
- [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "recursive", Justification = "Imported from ServiceStack")]
public ActionResult Post(
- [FromRoute] string id,
+ [FromRoute] Guid itemId,
[FromQuery] MetadataRefreshMode metadataRefreshMode = MetadataRefreshMode.None,
[FromQuery] MetadataRefreshMode imageRefreshMode = MetadataRefreshMode.None,
[FromQuery] bool replaceAllMetadata = false,
- [FromQuery] bool replaceAllImages = false,
- [FromQuery] bool recursive = false)
+ [FromQuery] bool replaceAllImages = false)
{
- var item = _libraryManager.GetItemById(id);
+ var item = _libraryManager.GetItemById(itemId);
if (item == null)
{
return NotFound();
@@ -82,7 +81,7 @@ namespace Jellyfin.Api.Controllers
};
_providerManager.QueueRefresh(item.Id, refreshOptions, RefreshPriority.High);
- return Ok();
+ return NoContent();
}
}
}