Merge pull request #3434 from crobibero/api-unused

remove unused query parameters
This commit is contained in:
Patrick Barron 2020-06-25 21:45:44 +00:00 committed by GitHub
commit 7bd9172779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 85 deletions

View File

@ -35,17 +35,14 @@ namespace Jellyfin.Api.Controllers
/// <param name="startIndex">Optional. The record index to start at. All items with a lower index will be dropped from the results.</param>
/// <param name="limit">Optional. The maximum number of records to return.</param>
/// <param name="minDate">Optional. The minimum date. Format = ISO.</param>
/// <param name="hasUserId">Optional. Only returns activities that have a user associated.</param>
/// <response code="200">Activity log returned.</response>
/// <returns>A <see cref="QueryResult{ActivityLogEntry}"/> containing the log entries.</returns>
[HttpGet("Entries")]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "hasUserId", Justification = "Imported from ServiceStack")]
public ActionResult<QueryResult<ActivityLogEntry>> GetLogEntries(
[FromQuery] int? startIndex,
[FromQuery] int? limit,
[FromQuery] DateTime? minDate,
bool? hasUserId)
[FromQuery] DateTime? minDate)
{
var filterFunc = new Func<IQueryable<ActivityLog>, IQueryable<ActivityLog>>(
entries => entries.Where(entry => entry.DateCreated >= minDate));

View File

@ -178,14 +178,13 @@ namespace Jellyfin.Api.Controllers
[ApiExplorerSettings(IgnoreApi = true)]
public ActionResult GetRobotsTxt()
{
return GetWebClientResource("robots.txt", string.Empty);
return GetWebClientResource("robots.txt");
}
/// <summary>
/// Gets a resource from the web client.
/// </summary>
/// <param name="resourceName">The resource name.</param>
/// <param name="v">The v.</param>
/// <response code="200">Web client returned.</response>
/// <response code="404">Server does not host a web client.</response>
/// <returns>The resource.</returns>
@ -193,10 +192,7 @@ namespace Jellyfin.Api.Controllers
[ApiExplorerSettings(IgnoreApi = true)]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "v", Justification = "Imported from ServiceStack")]
public ActionResult GetWebClientResource(
[FromRoute] string resourceName,
[FromQuery] string? v)
public ActionResult GetWebClientResource([FromRoute] string resourceName)
{
if (!_appConfig.HostWebClient() || WebClientUiPath == null)
{
@ -228,7 +224,7 @@ namespace Jellyfin.Api.Controllers
[ApiExplorerSettings(IgnoreApi = true)]
public ActionResult GetFavIcon()
{
return GetWebClientResource("favicon.ico", string.Empty);
return GetWebClientResource("favicon.ico");
}
/// <summary>

View File

@ -125,7 +125,6 @@ namespace Jellyfin.Api.Controllers
/// <param name="userId">Optional. User id.</param>
/// <param name="parentId">Optional. Specify this to localize the search to a specific item or folder. Omit to use the root.</param>
/// <param name="includeItemTypes">Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimited.</param>
/// <param name="mediaTypes">[Unused] Optional. Filter by MediaType. Allows multiple, comma delimited.</param>
/// <param name="isAiring">Optional. Is item airing.</param>
/// <param name="isMovie">Optional. Is item movie.</param>
/// <param name="isSports">Optional. Is item sports.</param>
@ -137,12 +136,10 @@ namespace Jellyfin.Api.Controllers
/// <returns>Query filters.</returns>
[HttpGet("/Items/Filters2")]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "mediaTypes", Justification = "Imported from ServiceStack")]
public ActionResult<QueryFilters> GetQueryFilters(
[FromQuery] Guid? userId,
[FromQuery] string? parentId,
[FromQuery] string? includeItemTypes,
[FromQuery] string? mediaTypes,
[FromQuery] bool? isAiring,
[FromQuery] bool? isMovie,
[FromQuery] bool? isSports,

View File

@ -47,7 +47,6 @@ namespace Jellyfin.Api.Controllers
/// <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="204">Item metadata refresh queued.</response>
/// <response code="404">Item to refresh not found.</response>
/// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the item could not be found.</returns>
@ -55,14 +54,12 @@ namespace Jellyfin.Api.Controllers
[Description("Refreshes metadata for an item.")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "recursive", Justification = "Imported from ServiceStack")]
public ActionResult Post(
[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(itemId);
if (item == null)

View File

@ -120,22 +120,13 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Gets critic review for an item.
/// </summary>
/// <param name="itemId">The item id.</param>
/// <param name="startIndex">Optional. The record index to start at. All items with a lower index will be dropped from the results.</param>
/// <param name="limit">Optional. The maximum number of records to return.</param>
/// <response code="200">Critic reviews returned.</response>
/// <returns>The list of critic reviews.</returns>
[HttpGet("/Items/{itemId}/CriticReviews")]
[Authorize(Policy = Policies.DefaultAuthorization)]
[Obsolete("This endpoint is obsolete.")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "itemId", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "startIndex", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "limit", Justification = "Imported from ServiceStack")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<QueryResult<BaseItemDto>> GetCriticReviews(
[FromRoute] Guid itemId,
[FromQuery] int? startIndex,
[FromQuery] int? limit)
public ActionResult<QueryResult<BaseItemDto>> GetCriticReviews()
{
return new QueryResult<BaseItemDto>();
}
@ -682,10 +673,6 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <param name="itemId">The item id.</param>
/// <param name="excludeArtistIds">Exclude artist ids.</param>
/// <param name="enableImages">(Unused) Optional. include image information in output.</param>
/// <param name="enableUserData">(Unused) Optional. include user data.</param>
/// <param name="imageTypeLimit">(Unused) Optional. the max number of images to return, per image type.</param>
/// <param name="enableImageTypes">(Unused) Optional. The image types to include in the output.</param>
/// <param name="userId">Optional. Filter by user id, and attach user data.</param>
/// <param name="limit">Optional. The maximum number of records to return.</param>
/// <param name="fields">Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimited. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines, TrailerUrls.</param>
@ -697,18 +684,10 @@ namespace Jellyfin.Api.Controllers
[HttpGet("/Shows/{itemId}/Similar")]
[HttpGet("/Movies/{itemId}/Similar")]
[HttpGet("/Trailers/{itemId}/Similar")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "enableImages", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "enableUserData", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "imageTypeLimit", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "enableImageTypes", Justification = "Imported from ServiceStack")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<QueryResult<BaseItemDto>> GetSimilarItems(
[FromRoute] Guid itemId,
[FromQuery] string excludeArtistIds,
[FromQuery] bool? enableImages,
[FromQuery] bool? enableUserData,
[FromQuery] int? imageTypeLimit,
[FromQuery] string enableImageTypes,
[FromQuery] Guid userId,
[FromQuery] int? limit,
[FromQuery] string fields)

View File

@ -50,13 +50,11 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Gets all virtual folders.
/// </summary>
/// <param name="userId">The user id.</param>
/// <response code="200">Virtual folders retrieved.</response>
/// <returns>An <see cref="IEnumerable{VirtualFolderInfo}"/> with the virtual folders.</returns>
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]
public ActionResult<IEnumerable<VirtualFolderInfo>> GetVirtualFolders([FromQuery] string userId)
public ActionResult<IEnumerable<VirtualFolderInfo>> GetVirtualFolders()
{
return _libraryManager.GetVirtualFolders(true);
}

View File

@ -36,23 +36,11 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Gets a user's notifications.
/// </summary>
/// <param name="userId">The user's ID.</param>
/// <param name="isRead">An optional filter by notification read state.</param>
/// <param name="startIndex">The optional index to start at. All notifications with a lower index will be omitted from the results.</param>
/// <param name="limit">An optional limit on the number of notifications returned.</param>
/// <response code="200">Notifications returned.</response>
/// <returns>An <see cref="OkResult"/> containing a list of notifications.</returns>
[HttpGet("{userId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "isRead", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "startIndex", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "limit", Justification = "Imported from ServiceStack")]
public ActionResult<NotificationResultDto> GetNotifications(
[FromRoute] string userId,
[FromQuery] bool? isRead,
[FromQuery] int? startIndex,
[FromQuery] int? limit)
public ActionResult<NotificationResultDto> GetNotifications()
{
return new NotificationResultDto();
}
@ -60,14 +48,11 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Gets a user's notification summary.
/// </summary>
/// <param name="userId">The user's ID.</param>
/// <response code="200">Summary of user's notifications returned.</response>
/// <returns>An <cref see="OkResult"/> containing a summary of the users notifications.</returns>
[HttpGet("{userId}/Summary")]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]
public ActionResult<NotificationsSummaryDto> GetNotificationsSummary(
[FromRoute] string userId)
public ActionResult<NotificationsSummaryDto> GetNotificationsSummary()
{
return new NotificationsSummaryDto();
}
@ -134,17 +119,11 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Sets notifications as read.
/// </summary>
/// <param name="userId">The userID.</param>
/// <param name="ids">A comma-separated list of the IDs of notifications which should be set as read.</param>
/// <response code="204">Notifications set as read.</response>
/// <returns>A <cref see="NoContentResult"/>.</returns>
[HttpPost("{userId}/Read")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "ids", Justification = "Imported from ServiceStack")]
public ActionResult SetRead(
[FromRoute] string userId,
[FromQuery] string ids)
public ActionResult SetRead()
{
return NoContent();
}
@ -152,17 +131,11 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Sets notifications as unread.
/// </summary>
/// <param name="userId">The userID.</param>
/// <param name="ids">A comma-separated list of the IDs of notifications which should be set as unread.</param>
/// <response code="204">Notifications set as unread.</response>
/// <returns>A <cref see="NoContentResult"/>.</returns>
[HttpPost("{userId}/Unread")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "ids", Justification = "Imported from ServiceStack")]
public ActionResult SetUnread(
[FromRoute] string userId,
[FromQuery] string ids)
public ActionResult SetUnread()
{
return NoContent();
}

View File

@ -42,13 +42,11 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Gets a list of currently installed plugins.
/// </summary>
/// <param name="isAppStoreEnabled">Optional. Unused.</param>
/// <response code="200">Installed plugins returned.</response>
/// <returns>List of currently installed plugins.</returns>
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "isAppStoreEnabled", Justification = "Imported from ServiceStack")]
public ActionResult<IEnumerable<PluginInfo>> GetPlugins([FromRoute] bool? isAppStoreEnabled)
public ActionResult<IEnumerable<PluginInfo>> GetPlugins()
{
return Ok(_appHost.Plugins.OrderBy(p => p.Name).Select(p => p.GetPluginInfo()));
}

View File

@ -185,12 +185,10 @@ namespace Jellyfin.Api.Controllers
/// <param name="enableImageTypes">Optional. The image types to include in the output.</param>
/// <param name="enableUserData">Optional. Include user data.</param>
/// <param name="sortBy">Optional. Specify one or more sort orders, comma delimeted. Options: Album, AlbumArtist, Artist, Budget, CommunityRating, CriticRating, DateCreated, DatePlayed, PlayCount, PremiereDate, ProductionYear, SortName, Random, Revenue, Runtime.</param>
/// <param name="sortOrder">Optional. Sort order: Ascending,Descending.</param>
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the episodes on success or a <see cref="NotFoundResult"/> if the series was not found.</returns>
[HttpGet("{seriesId}/Episodes")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "sortOrder", Justification = "Imported from ServiceStack")]
public ActionResult<QueryResult<BaseItemDto>> GetEpisodes(
[FromRoute] string seriesId,
[FromQuery] Guid userId,
@ -206,8 +204,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? imageTypeLimit,
[FromQuery] string? enableImageTypes,
[FromQuery] bool? enableUserData,
[FromQuery] string? sortBy,
[FromQuery] SortOrder? sortOrder)
[FromQuery] string? sortBy)
{
var user = _userManager.GetUserById(userId);

View File

@ -68,17 +68,14 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <param name="isHidden">Optional filter by IsHidden=true or false.</param>
/// <param name="isDisabled">Optional filter by IsDisabled=true or false.</param>
/// <param name="isGuest">Optional filter by IsGuest=true or false.</param>
/// <response code="200">Users returned.</response>
/// <returns>An <see cref="IEnumerable{UserDto}"/> containing the users.</returns>
[HttpGet]
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status200OK)]
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "isGuest", Justification = "Imported from ServiceStack")]
public ActionResult<IEnumerable<UserDto>> GetUsers(
[FromQuery] bool? isHidden,
[FromQuery] bool? isDisabled,
[FromQuery] bool? isGuest)
[FromQuery] bool? isDisabled)
{
var users = Get(isHidden, isDisabled, false, false);
return Ok(users);