| | 1 | | using System; |
| | 2 | | using System.ComponentModel.DataAnnotations; |
| | 3 | | using System.Linq; |
| | 4 | | using Jellyfin.Api.Extensions; |
| | 5 | | using Jellyfin.Api.Helpers; |
| | 6 | | using Jellyfin.Api.ModelBinders; |
| | 7 | | using Jellyfin.Data; |
| | 8 | | using Jellyfin.Data.Enums; |
| | 9 | | using Jellyfin.Database.Implementations.Enums; |
| | 10 | | using Jellyfin.Extensions; |
| | 11 | | using MediaBrowser.Common.Extensions; |
| | 12 | | using MediaBrowser.Controller.Dto; |
| | 13 | | using MediaBrowser.Controller.Entities; |
| | 14 | | using MediaBrowser.Controller.Library; |
| | 15 | | using MediaBrowser.Controller.Session; |
| | 16 | | using MediaBrowser.Model.Dto; |
| | 17 | | using MediaBrowser.Model.Entities; |
| | 18 | | using MediaBrowser.Model.Globalization; |
| | 19 | | using MediaBrowser.Model.Querying; |
| | 20 | | using Microsoft.AspNetCore.Authorization; |
| | 21 | | using Microsoft.AspNetCore.Http; |
| | 22 | | using Microsoft.AspNetCore.Mvc; |
| | 23 | | using Microsoft.Extensions.Logging; |
| | 24 | |
|
| | 25 | | namespace Jellyfin.Api.Controllers; |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// The items controller. |
| | 29 | | /// </summary> |
| | 30 | | [Route("")] |
| | 31 | | [Authorize] |
| | 32 | | public class ItemsController : BaseJellyfinApiController |
| | 33 | | { |
| | 34 | | private readonly IUserManager _userManager; |
| | 35 | | private readonly ILibraryManager _libraryManager; |
| | 36 | | private readonly ILocalizationManager _localization; |
| | 37 | | private readonly IDtoService _dtoService; |
| | 38 | | private readonly ILogger<ItemsController> _logger; |
| | 39 | | private readonly ISessionManager _sessionManager; |
| | 40 | | private readonly IUserDataManager _userDataRepository; |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Initializes a new instance of the <see cref="ItemsController"/> class. |
| | 44 | | /// </summary> |
| | 45 | | /// <param name="userManager">Instance of the <see cref="IUserManager"/> interface.</param> |
| | 46 | | /// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param> |
| | 47 | | /// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param> |
| | 48 | | /// <param name="dtoService">Instance of the <see cref="IDtoService"/> interface.</param> |
| | 49 | | /// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param> |
| | 50 | | /// <param name="sessionManager">Instance of the <see cref="ISessionManager"/> interface.</param> |
| | 51 | | /// <param name="userDataRepository">Instance of the <see cref="IUserDataManager"/> interface.</param> |
| 6 | 52 | | public ItemsController( |
| 6 | 53 | | IUserManager userManager, |
| 6 | 54 | | ILibraryManager libraryManager, |
| 6 | 55 | | ILocalizationManager localization, |
| 6 | 56 | | IDtoService dtoService, |
| 6 | 57 | | ILogger<ItemsController> logger, |
| 6 | 58 | | ISessionManager sessionManager, |
| 6 | 59 | | IUserDataManager userDataRepository) |
| | 60 | | { |
| 6 | 61 | | _userManager = userManager; |
| 6 | 62 | | _libraryManager = libraryManager; |
| 6 | 63 | | _localization = localization; |
| 6 | 64 | | _dtoService = dtoService; |
| 6 | 65 | | _logger = logger; |
| 6 | 66 | | _sessionManager = sessionManager; |
| 6 | 67 | | _userDataRepository = userDataRepository; |
| 6 | 68 | | } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Gets items based on a query. |
| | 72 | | /// </summary> |
| | 73 | | /// <param name="userId">The user id supplied as query parameter; this is required when not using an API key.</param |
| | 74 | | /// <param name="maxOfficialRating">Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).</param> |
| | 75 | | /// <param name="hasThemeSong">Optional filter by items with theme songs.</param> |
| | 76 | | /// <param name="hasThemeVideo">Optional filter by items with theme videos.</param> |
| | 77 | | /// <param name="hasSubtitles">Optional filter by items with subtitles.</param> |
| | 78 | | /// <param name="hasSpecialFeature">Optional filter by items with special features.</param> |
| | 79 | | /// <param name="hasTrailer">Optional filter by items with trailers.</param> |
| | 80 | | /// <param name="adjacentTo">Optional. Return items that are siblings of a supplied item.</param> |
| | 81 | | /// <param name="indexNumber">Optional filter by index number.</param> |
| | 82 | | /// <param name="parentIndexNumber">Optional filter by parent index number.</param> |
| | 83 | | /// <param name="hasParentalRating">Optional filter by items that have or do not have a parental rating.</param> |
| | 84 | | /// <param name="isHd">Optional filter by items that are HD or not.</param> |
| | 85 | | /// <param name="is4K">Optional filter by items that are 4K or not.</param> |
| | 86 | | /// <param name="locationTypes">Optional. If specified, results will be filtered based on LocationType. This allows |
| | 87 | | /// <param name="excludeLocationTypes">Optional. If specified, results will be filtered based on the LocationType. T |
| | 88 | | /// <param name="isMissing">Optional filter by items that are missing episodes or not.</param> |
| | 89 | | /// <param name="isUnaired">Optional filter by items that are unaired episodes or not.</param> |
| | 90 | | /// <param name="minCommunityRating">Optional filter by minimum community rating.</param> |
| | 91 | | /// <param name="minCriticRating">Optional filter by minimum critic rating.</param> |
| | 92 | | /// <param name="minPremiereDate">Optional. The minimum premiere date. Format = ISO.</param> |
| | 93 | | /// <param name="minDateLastSaved">Optional. The minimum last saved date. Format = ISO.</param> |
| | 94 | | /// <param name="minDateLastSavedForUser">Optional. The minimum last saved date for the current user. Format = ISO.< |
| | 95 | | /// <param name="maxPremiereDate">Optional. The maximum premiere date. Format = ISO.</param> |
| | 96 | | /// <param name="hasOverview">Optional filter by items that have an overview or not.</param> |
| | 97 | | /// <param name="hasImdbId">Optional filter by items that have an IMDb id or not.</param> |
| | 98 | | /// <param name="hasTmdbId">Optional filter by items that have a TMDb id or not.</param> |
| | 99 | | /// <param name="hasTvdbId">Optional filter by items that have a TVDb id or not.</param> |
| | 100 | | /// <param name="isMovie">Optional filter for live tv movies.</param> |
| | 101 | | /// <param name="isSeries">Optional filter for live tv series.</param> |
| | 102 | | /// <param name="isNews">Optional filter for live tv news.</param> |
| | 103 | | /// <param name="isKids">Optional filter for live tv kids.</param> |
| | 104 | | /// <param name="isSports">Optional filter for live tv sports.</param> |
| | 105 | | /// <param name="excludeItemIds">Optional. If specified, results will be filtered by excluding item ids. This allows |
| | 106 | | /// <param name="startIndex">Optional. The record index to start at. All items with a lower index will be dropped fr |
| | 107 | | /// <param name="limit">Optional. The maximum number of records to return.</param> |
| | 108 | | /// <param name="recursive">When searching within folders, this determines whether or not the search will be recursi |
| | 109 | | /// <param name="searchTerm">Optional. Filter based on a search term.</param> |
| | 110 | | /// <param name="sortOrder">Sort Order - Ascending, Descending.</param> |
| | 111 | | /// <param name="parentId">Specify this to localize the search to a specific item or folder. Omit to use the root.</ |
| | 112 | | /// <param name="fields">Optional. Specify additional fields of information to return in the output. This allows mul |
| | 113 | | /// <param name="excludeItemTypes">Optional. If specified, results will be filtered based on item type. This allows |
| | 114 | | /// <param name="includeItemTypes">Optional. If specified, results will be filtered based on the item type. This all |
| | 115 | | /// <param name="filters">Optional. Specify additional filters to apply. This allows multiple, comma delimited. Opti |
| | 116 | | /// <param name="isFavorite">Optional filter by items that are marked as favorite, or not.</param> |
| | 117 | | /// <param name="mediaTypes">Optional filter by MediaType. Allows multiple, comma delimited.</param> |
| | 118 | | /// <param name="imageTypes">Optional. If specified, results will be filtered based on those containing image types. |
| | 119 | | /// <param name="sortBy">Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Ar |
| | 120 | | /// <param name="isPlayed">Optional filter by items that are played, or not.</param> |
| | 121 | | /// <param name="genres">Optional. If specified, results will be filtered based on genre. This allows multiple, pipe |
| | 122 | | /// <param name="officialRatings">Optional. If specified, results will be filtered based on OfficialRating. This all |
| | 123 | | /// <param name="tags">Optional. If specified, results will be filtered based on tag. This allows multiple, pipe del |
| | 124 | | /// <param name="years">Optional. If specified, results will be filtered based on production year. This allows multi |
| | 125 | | /// <param name="enableUserData">Optional, include user data.</param> |
| | 126 | | /// <param name="imageTypeLimit">Optional, the max number of images to return, per image type.</param> |
| | 127 | | /// <param name="enableImageTypes">Optional. The image types to include in the output.</param> |
| | 128 | | /// <param name="person">Optional. If specified, results will be filtered to include only those containing the speci |
| | 129 | | /// <param name="personIds">Optional. If specified, results will be filtered to include only those containing the sp |
| | 130 | | /// <param name="personTypes">Optional. If specified, along with Person, results will be filtered to include only th |
| | 131 | | /// <param name="studios">Optional. If specified, results will be filtered based on studio. This allows multiple, pi |
| | 132 | | /// <param name="artists">Optional. If specified, results will be filtered based on artists. This allows multiple, p |
| | 133 | | /// <param name="excludeArtistIds">Optional. If specified, results will be filtered based on artist id. This allows |
| | 134 | | /// <param name="artistIds">Optional. If specified, results will be filtered to include only those containing the sp |
| | 135 | | /// <param name="albumArtistIds">Optional. If specified, results will be filtered to include only those containing t |
| | 136 | | /// <param name="contributingArtistIds">Optional. If specified, results will be filtered to include only those conta |
| | 137 | | /// <param name="albums">Optional. If specified, results will be filtered based on album. This allows multiple, pipe |
| | 138 | | /// <param name="albumIds">Optional. If specified, results will be filtered based on album id. This allows multiple, |
| | 139 | | /// <param name="ids">Optional. If specific items are needed, specify a list of item id's to retrieve. This allows m |
| | 140 | | /// <param name="videoTypes">Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma deli |
| | 141 | | /// <param name="minOfficialRating">Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).</param> |
| | 142 | | /// <param name="isLocked">Optional filter by items that are locked.</param> |
| | 143 | | /// <param name="isPlaceHolder">Optional filter by items that are placeholders.</param> |
| | 144 | | /// <param name="hasOfficialRating">Optional filter by items that have official ratings.</param> |
| | 145 | | /// <param name="collapseBoxSetItems">Whether or not to hide items behind their boxsets.</param> |
| | 146 | | /// <param name="minWidth">Optional. Filter by the minimum width of the item.</param> |
| | 147 | | /// <param name="minHeight">Optional. Filter by the minimum height of the item.</param> |
| | 148 | | /// <param name="maxWidth">Optional. Filter by the maximum width of the item.</param> |
| | 149 | | /// <param name="maxHeight">Optional. Filter by the maximum height of the item.</param> |
| | 150 | | /// <param name="is3D">Optional filter by items that are 3D, or not.</param> |
| | 151 | | /// <param name="seriesStatus">Optional filter by Series Status. Allows multiple, comma delimited.</param> |
| | 152 | | /// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a gi |
| | 153 | | /// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</p |
| | 154 | | /// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</ |
| | 155 | | /// <param name="studioIds">Optional. If specified, results will be filtered based on studio id. This allows multipl |
| | 156 | | /// <param name="genreIds">Optional. If specified, results will be filtered based on genre id. This allows multiple, |
| | 157 | | /// <param name="enableTotalRecordCount">Optional. Enable the total record count.</param> |
| | 158 | | /// <param name="enableImages">Optional, include image information in output.</param> |
| | 159 | | /// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the items.</returns> |
| | 160 | | [HttpGet("Items")] |
| | 161 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 162 | | public ActionResult<QueryResult<BaseItemDto>> GetItems( |
| | 163 | | [FromQuery] Guid? userId, |
| | 164 | | [FromQuery] string? maxOfficialRating, |
| | 165 | | [FromQuery] bool? hasThemeSong, |
| | 166 | | [FromQuery] bool? hasThemeVideo, |
| | 167 | | [FromQuery] bool? hasSubtitles, |
| | 168 | | [FromQuery] bool? hasSpecialFeature, |
| | 169 | | [FromQuery] bool? hasTrailer, |
| | 170 | | [FromQuery] Guid? adjacentTo, |
| | 171 | | [FromQuery] int? indexNumber, |
| | 172 | | [FromQuery] int? parentIndexNumber, |
| | 173 | | [FromQuery] bool? hasParentalRating, |
| | 174 | | [FromQuery] bool? isHd, |
| | 175 | | [FromQuery] bool? is4K, |
| | 176 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] LocationType[] locationTypes, |
| | 177 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] LocationType[] excludeLocationTypes, |
| | 178 | | [FromQuery] bool? isMissing, |
| | 179 | | [FromQuery] bool? isUnaired, |
| | 180 | | [FromQuery] double? minCommunityRating, |
| | 181 | | [FromQuery] double? minCriticRating, |
| | 182 | | [FromQuery] DateTime? minPremiereDate, |
| | 183 | | [FromQuery] DateTime? minDateLastSaved, |
| | 184 | | [FromQuery] DateTime? minDateLastSavedForUser, |
| | 185 | | [FromQuery] DateTime? maxPremiereDate, |
| | 186 | | [FromQuery] bool? hasOverview, |
| | 187 | | [FromQuery] bool? hasImdbId, |
| | 188 | | [FromQuery] bool? hasTmdbId, |
| | 189 | | [FromQuery] bool? hasTvdbId, |
| | 190 | | [FromQuery] bool? isMovie, |
| | 191 | | [FromQuery] bool? isSeries, |
| | 192 | | [FromQuery] bool? isNews, |
| | 193 | | [FromQuery] bool? isKids, |
| | 194 | | [FromQuery] bool? isSports, |
| | 195 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] excludeItemIds, |
| | 196 | | [FromQuery] int? startIndex, |
| | 197 | | [FromQuery] int? limit, |
| | 198 | | [FromQuery] bool? recursive, |
| | 199 | | [FromQuery] string? searchTerm, |
| | 200 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] SortOrder[] sortOrder, |
| | 201 | | [FromQuery] Guid? parentId, |
| | 202 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemFields[] fields, |
| | 203 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] excludeItemTypes, |
| | 204 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] includeItemTypes, |
| | 205 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemFilter[] filters, |
| | 206 | | [FromQuery] bool? isFavorite, |
| | 207 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] MediaType[] mediaTypes, |
| | 208 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ImageType[] imageTypes, |
| | 209 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemSortBy[] sortBy, |
| | 210 | | [FromQuery] bool? isPlayed, |
| | 211 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] genres, |
| | 212 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] officialRatings, |
| | 213 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] tags, |
| | 214 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] int[] years, |
| | 215 | | [FromQuery] bool? enableUserData, |
| | 216 | | [FromQuery] int? imageTypeLimit, |
| | 217 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ImageType[] enableImageTypes, |
| | 218 | | [FromQuery] string? person, |
| | 219 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] personIds, |
| | 220 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] string[] personTypes, |
| | 221 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] studios, |
| | 222 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] artists, |
| | 223 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] excludeArtistIds, |
| | 224 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] artistIds, |
| | 225 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] albumArtistIds, |
| | 226 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] contributingArtistIds, |
| | 227 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] albums, |
| | 228 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] albumIds, |
| | 229 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] ids, |
| | 230 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] VideoType[] videoTypes, |
| | 231 | | [FromQuery] string? minOfficialRating, |
| | 232 | | [FromQuery] bool? isLocked, |
| | 233 | | [FromQuery] bool? isPlaceHolder, |
| | 234 | | [FromQuery] bool? hasOfficialRating, |
| | 235 | | [FromQuery] bool? collapseBoxSetItems, |
| | 236 | | [FromQuery] int? minWidth, |
| | 237 | | [FromQuery] int? minHeight, |
| | 238 | | [FromQuery] int? maxWidth, |
| | 239 | | [FromQuery] int? maxHeight, |
| | 240 | | [FromQuery] bool? is3D, |
| | 241 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] SeriesStatus[] seriesStatus, |
| | 242 | | [FromQuery] string? nameStartsWithOrGreater, |
| | 243 | | [FromQuery] string? nameStartsWith, |
| | 244 | | [FromQuery] string? nameLessThan, |
| | 245 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] studioIds, |
| | 246 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] genreIds, |
| | 247 | | [FromQuery] bool enableTotalRecordCount = true, |
| | 248 | | [FromQuery] bool? enableImages = true) |
| | 249 | | { |
| 4 | 250 | | var isApiKey = User.GetIsApiKey(); |
| | 251 | | // if api key is used (auth.IsApiKey == true), then `user` will be null throughout this method |
| 4 | 252 | | userId = RequestHelpers.GetUserId(User, userId); |
| 4 | 253 | | var user = userId.IsNullOrEmpty() |
| 4 | 254 | | ? null |
| 4 | 255 | | : _userManager.GetUserById(userId.Value) ?? throw new ResourceNotFoundException(); |
| | 256 | |
|
| | 257 | | // beyond this point, we're either using an api key or we have a valid user |
| 3 | 258 | | if (!isApiKey && user is null) |
| | 259 | | { |
| 0 | 260 | | return BadRequest("userId is required"); |
| | 261 | | } |
| | 262 | |
|
| 3 | 263 | | if (user is not null |
| 3 | 264 | | && user.GetPreference(PreferenceKind.AllowedTags).Length != 0 |
| 3 | 265 | | && !fields.Contains(ItemFields.Tags)) |
| | 266 | | { |
| 0 | 267 | | fields = [..fields, ItemFields.Tags]; |
| | 268 | | } |
| | 269 | |
|
| 3 | 270 | | var dtoOptions = new DtoOptions { Fields = fields } |
| 3 | 271 | | .AddClientFields(User) |
| 3 | 272 | | .AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes); |
| | 273 | |
|
| 3 | 274 | | if (includeItemTypes.Length == 1 |
| 3 | 275 | | && includeItemTypes[0] == BaseItemKind.BoxSet) |
| | 276 | | { |
| 0 | 277 | | parentId = null; |
| | 278 | | } |
| | 279 | |
|
| 3 | 280 | | var item = _libraryManager.GetParentItem(parentId, userId); |
| | 281 | | QueryResult<BaseItem> result; |
| | 282 | |
|
| 3 | 283 | | if (item is not Folder folder) |
| | 284 | | { |
| 0 | 285 | | folder = _libraryManager.GetUserRootFolder(); |
| | 286 | | } |
| | 287 | |
|
| 3 | 288 | | CollectionType? collectionType = null; |
| 3 | 289 | | if (folder is IHasCollectionType hasCollectionType) |
| | 290 | | { |
| 0 | 291 | | collectionType = hasCollectionType.CollectionType; |
| | 292 | | } |
| | 293 | |
|
| 3 | 294 | | if (collectionType == CollectionType.playlists) |
| | 295 | | { |
| 0 | 296 | | recursive = true; |
| 0 | 297 | | includeItemTypes = new[] { BaseItemKind.Playlist }; |
| | 298 | | } |
| | 299 | |
|
| 3 | 300 | | if (item is not UserRootFolder |
| 3 | 301 | | // api keys can always access all folders |
| 3 | 302 | | && !isApiKey |
| 3 | 303 | | // check the item is visible for the user |
| 3 | 304 | | && !item.IsVisible(user)) |
| | 305 | | { |
| 0 | 306 | | _logger.LogWarning("{UserName} is not permitted to access Library {ItemName}", user!.Username, item.Name); |
| 0 | 307 | | return Unauthorized($"{user.Username} is not permitted to access Library {item.Name}."); |
| | 308 | | } |
| | 309 | |
|
| 3 | 310 | | if ((recursive.HasValue && recursive.Value) || ids.Length != 0 || item is not UserRootFolder) |
| | 311 | | { |
| 0 | 312 | | var query = new InternalItemsQuery(user) |
| 0 | 313 | | { |
| 0 | 314 | | IsPlayed = isPlayed, |
| 0 | 315 | | MediaTypes = mediaTypes, |
| 0 | 316 | | IncludeItemTypes = includeItemTypes, |
| 0 | 317 | | ExcludeItemTypes = excludeItemTypes, |
| 0 | 318 | | Recursive = recursive ?? false, |
| 0 | 319 | | OrderBy = RequestHelpers.GetOrderBy(sortBy, sortOrder), |
| 0 | 320 | | IsFavorite = isFavorite, |
| 0 | 321 | | Limit = limit, |
| 0 | 322 | | StartIndex = startIndex, |
| 0 | 323 | | IsMissing = isMissing, |
| 0 | 324 | | IsUnaired = isUnaired, |
| 0 | 325 | | CollapseBoxSetItems = collapseBoxSetItems, |
| 0 | 326 | | NameLessThan = nameLessThan, |
| 0 | 327 | | NameStartsWith = nameStartsWith, |
| 0 | 328 | | NameStartsWithOrGreater = nameStartsWithOrGreater, |
| 0 | 329 | | HasImdbId = hasImdbId, |
| 0 | 330 | | IsPlaceHolder = isPlaceHolder, |
| 0 | 331 | | IsLocked = isLocked, |
| 0 | 332 | | MinWidth = minWidth, |
| 0 | 333 | | MinHeight = minHeight, |
| 0 | 334 | | MaxWidth = maxWidth, |
| 0 | 335 | | MaxHeight = maxHeight, |
| 0 | 336 | | Is3D = is3D, |
| 0 | 337 | | HasTvdbId = hasTvdbId, |
| 0 | 338 | | HasTmdbId = hasTmdbId, |
| 0 | 339 | | IsMovie = isMovie, |
| 0 | 340 | | IsSeries = isSeries, |
| 0 | 341 | | IsNews = isNews, |
| 0 | 342 | | IsKids = isKids, |
| 0 | 343 | | IsSports = isSports, |
| 0 | 344 | | HasOverview = hasOverview, |
| 0 | 345 | | HasOfficialRating = hasOfficialRating, |
| 0 | 346 | | HasParentalRating = hasParentalRating, |
| 0 | 347 | | HasSpecialFeature = hasSpecialFeature, |
| 0 | 348 | | HasSubtitles = hasSubtitles, |
| 0 | 349 | | HasThemeSong = hasThemeSong, |
| 0 | 350 | | HasThemeVideo = hasThemeVideo, |
| 0 | 351 | | HasTrailer = hasTrailer, |
| 0 | 352 | | IsHD = isHd, |
| 0 | 353 | | Is4K = is4K, |
| 0 | 354 | | Tags = tags, |
| 0 | 355 | | OfficialRatings = officialRatings, |
| 0 | 356 | | Genres = genres, |
| 0 | 357 | | ArtistIds = artistIds, |
| 0 | 358 | | AlbumArtistIds = albumArtistIds, |
| 0 | 359 | | ContributingArtistIds = contributingArtistIds, |
| 0 | 360 | | GenreIds = genreIds, |
| 0 | 361 | | StudioIds = studioIds, |
| 0 | 362 | | Person = person, |
| 0 | 363 | | PersonIds = personIds, |
| 0 | 364 | | PersonTypes = personTypes, |
| 0 | 365 | | Years = years, |
| 0 | 366 | | ImageTypes = imageTypes, |
| 0 | 367 | | VideoTypes = videoTypes, |
| 0 | 368 | | AdjacentTo = adjacentTo, |
| 0 | 369 | | ItemIds = ids, |
| 0 | 370 | | MinCommunityRating = minCommunityRating, |
| 0 | 371 | | MinCriticRating = minCriticRating, |
| 0 | 372 | | ParentId = parentId ?? Guid.Empty, |
| 0 | 373 | | IndexNumber = indexNumber, |
| 0 | 374 | | ParentIndexNumber = parentIndexNumber, |
| 0 | 375 | | EnableTotalRecordCount = enableTotalRecordCount, |
| 0 | 376 | | ExcludeItemIds = excludeItemIds, |
| 0 | 377 | | DtoOptions = dtoOptions, |
| 0 | 378 | | SearchTerm = searchTerm, |
| 0 | 379 | | MinDateLastSaved = minDateLastSaved?.ToUniversalTime(), |
| 0 | 380 | | MinDateLastSavedForUser = minDateLastSavedForUser?.ToUniversalTime(), |
| 0 | 381 | | MinPremiereDate = minPremiereDate?.ToUniversalTime(), |
| 0 | 382 | | MaxPremiereDate = maxPremiereDate?.ToUniversalTime(), |
| 0 | 383 | | }; |
| | 384 | |
|
| 0 | 385 | | if (ids.Length != 0 || !string.IsNullOrWhiteSpace(searchTerm)) |
| | 386 | | { |
| 0 | 387 | | query.CollapseBoxSetItems = false; |
| | 388 | | } |
| | 389 | |
|
| 0 | 390 | | foreach (var filter in filters) |
| | 391 | | { |
| | 392 | | switch (filter) |
| | 393 | | { |
| | 394 | | case ItemFilter.Dislikes: |
| 0 | 395 | | query.IsLiked = false; |
| 0 | 396 | | break; |
| | 397 | | case ItemFilter.IsFavorite: |
| 0 | 398 | | query.IsFavorite = true; |
| 0 | 399 | | break; |
| | 400 | | case ItemFilter.IsFavoriteOrLikes: |
| 0 | 401 | | query.IsFavoriteOrLiked = true; |
| 0 | 402 | | break; |
| | 403 | | case ItemFilter.IsFolder: |
| 0 | 404 | | query.IsFolder = true; |
| 0 | 405 | | break; |
| | 406 | | case ItemFilter.IsNotFolder: |
| 0 | 407 | | query.IsFolder = false; |
| 0 | 408 | | break; |
| | 409 | | case ItemFilter.IsPlayed: |
| 0 | 410 | | query.IsPlayed = true; |
| 0 | 411 | | break; |
| | 412 | | case ItemFilter.IsResumable: |
| 0 | 413 | | query.IsResumable = true; |
| 0 | 414 | | break; |
| | 415 | | case ItemFilter.IsUnplayed: |
| 0 | 416 | | query.IsPlayed = false; |
| 0 | 417 | | break; |
| | 418 | | case ItemFilter.Likes: |
| 0 | 419 | | query.IsLiked = true; |
| | 420 | | break; |
| | 421 | | } |
| | 422 | | } |
| | 423 | |
|
| | 424 | | // Filter by Series Status |
| 0 | 425 | | if (seriesStatus.Length != 0) |
| | 426 | | { |
| 0 | 427 | | query.SeriesStatuses = seriesStatus; |
| | 428 | | } |
| | 429 | |
|
| | 430 | | // Exclude Blocked Unrated Items |
| 0 | 431 | | var blockedUnratedItems = user?.GetPreferenceValues<UnratedItem>(PreferenceKind.BlockUnratedItems); |
| 0 | 432 | | if (blockedUnratedItems is not null) |
| | 433 | | { |
| 0 | 434 | | query.BlockUnratedItems = blockedUnratedItems; |
| | 435 | | } |
| | 436 | |
|
| | 437 | | // ExcludeLocationTypes |
| 0 | 438 | | if (excludeLocationTypes.Any(t => t == LocationType.Virtual)) |
| | 439 | | { |
| 0 | 440 | | query.IsVirtualItem = false; |
| | 441 | | } |
| | 442 | |
|
| 0 | 443 | | if (locationTypes.Length > 0 && locationTypes.Length < 4) |
| | 444 | | { |
| 0 | 445 | | query.IsVirtualItem = locationTypes.Contains(LocationType.Virtual); |
| | 446 | | } |
| | 447 | |
|
| | 448 | | // Min official rating |
| 0 | 449 | | if (!string.IsNullOrWhiteSpace(minOfficialRating)) |
| | 450 | | { |
| 0 | 451 | | query.MinParentalRating = _localization.GetRatingScore(minOfficialRating); |
| | 452 | | } |
| | 453 | |
|
| | 454 | | // Max official rating |
| 0 | 455 | | if (!string.IsNullOrWhiteSpace(maxOfficialRating)) |
| | 456 | | { |
| 0 | 457 | | query.MaxParentalRating = _localization.GetRatingScore(maxOfficialRating); |
| | 458 | | } |
| | 459 | |
|
| | 460 | | // Artists |
| 0 | 461 | | if (artists.Length != 0) |
| | 462 | | { |
| 0 | 463 | | query.ArtistIds = artists.Select(i => |
| 0 | 464 | | { |
| 0 | 465 | | try |
| 0 | 466 | | { |
| 0 | 467 | | return _libraryManager.GetArtist(i, new DtoOptions(false)); |
| 0 | 468 | | } |
| 0 | 469 | | catch |
| 0 | 470 | | { |
| 0 | 471 | | return null; |
| 0 | 472 | | } |
| 0 | 473 | | }).Where(i => i is not null).Select(i => i!.Id).ToArray(); |
| | 474 | | } |
| | 475 | |
|
| | 476 | | // ExcludeArtistIds |
| 0 | 477 | | if (excludeArtistIds.Length != 0) |
| | 478 | | { |
| 0 | 479 | | query.ExcludeArtistIds = excludeArtistIds; |
| | 480 | | } |
| | 481 | |
|
| 0 | 482 | | if (albumIds.Length != 0) |
| | 483 | | { |
| 0 | 484 | | query.AlbumIds = albumIds; |
| | 485 | | } |
| | 486 | |
|
| | 487 | | // Albums |
| 0 | 488 | | if (albums.Length != 0) |
| | 489 | | { |
| 0 | 490 | | query.AlbumIds = albums.SelectMany(i => |
| 0 | 491 | | { |
| 0 | 492 | | return _libraryManager.GetItemIds(new InternalItemsQuery { IncludeItemTypes = new[] { BaseItemKind.M |
| 0 | 493 | | }).ToArray(); |
| | 494 | | } |
| | 495 | |
|
| | 496 | | // Studios |
| 0 | 497 | | if (studios.Length != 0) |
| | 498 | | { |
| 0 | 499 | | query.StudioIds = studios.Select(i => |
| 0 | 500 | | { |
| 0 | 501 | | try |
| 0 | 502 | | { |
| 0 | 503 | | return _libraryManager.GetStudio(i); |
| 0 | 504 | | } |
| 0 | 505 | | catch |
| 0 | 506 | | { |
| 0 | 507 | | return null; |
| 0 | 508 | | } |
| 0 | 509 | | }).Where(i => i is not null).Select(i => i!.Id).ToArray(); |
| | 510 | | } |
| | 511 | |
|
| | 512 | | // Apply default sorting if none requested |
| 0 | 513 | | if (query.OrderBy.Count == 0) |
| | 514 | | { |
| | 515 | | // Albums by artist |
| 0 | 516 | | if (query.ArtistIds.Length > 0 && query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes[0] == Bas |
| | 517 | | { |
| 0 | 518 | | query.OrderBy = new[] { (ItemSortBy.ProductionYear, SortOrder.Descending), (ItemSortBy.SortName, Sor |
| | 519 | | } |
| | 520 | | } |
| | 521 | |
|
| 0 | 522 | | query.Parent = null; |
| 0 | 523 | | result = folder.GetItems(query); |
| | 524 | | } |
| | 525 | | else |
| | 526 | | { |
| 3 | 527 | | var itemsArray = folder.GetChildren(user, true); |
| 3 | 528 | | result = new QueryResult<BaseItem>(itemsArray); |
| | 529 | | } |
| | 530 | |
|
| 3 | 531 | | return new QueryResult<BaseItemDto>( |
| 3 | 532 | | startIndex, |
| 3 | 533 | | result.TotalRecordCount, |
| 3 | 534 | | _dtoService.GetBaseItemDtos(result.Items, dtoOptions, user)); |
| | 535 | | } |
| | 536 | |
|
| | 537 | | /// <summary> |
| | 538 | | /// Gets items based on a query. |
| | 539 | | /// </summary> |
| | 540 | | /// <param name="userId">The user id supplied as query parameter.</param> |
| | 541 | | /// <param name="maxOfficialRating">Optional filter by maximum official rating (PG, PG-13, TV-MA, etc).</param> |
| | 542 | | /// <param name="hasThemeSong">Optional filter by items with theme songs.</param> |
| | 543 | | /// <param name="hasThemeVideo">Optional filter by items with theme videos.</param> |
| | 544 | | /// <param name="hasSubtitles">Optional filter by items with subtitles.</param> |
| | 545 | | /// <param name="hasSpecialFeature">Optional filter by items with special features.</param> |
| | 546 | | /// <param name="hasTrailer">Optional filter by items with trailers.</param> |
| | 547 | | /// <param name="adjacentTo">Optional. Return items that are siblings of a supplied item.</param> |
| | 548 | | /// <param name="parentIndexNumber">Optional filter by parent index number.</param> |
| | 549 | | /// <param name="hasParentalRating">Optional filter by items that have or do not have a parental rating.</param> |
| | 550 | | /// <param name="isHd">Optional filter by items that are HD or not.</param> |
| | 551 | | /// <param name="is4K">Optional filter by items that are 4K or not.</param> |
| | 552 | | /// <param name="locationTypes">Optional. If specified, results will be filtered based on LocationType. This allows |
| | 553 | | /// <param name="excludeLocationTypes">Optional. If specified, results will be filtered based on the LocationType. T |
| | 554 | | /// <param name="isMissing">Optional filter by items that are missing episodes or not.</param> |
| | 555 | | /// <param name="isUnaired">Optional filter by items that are unaired episodes or not.</param> |
| | 556 | | /// <param name="minCommunityRating">Optional filter by minimum community rating.</param> |
| | 557 | | /// <param name="minCriticRating">Optional filter by minimum critic rating.</param> |
| | 558 | | /// <param name="minPremiereDate">Optional. The minimum premiere date. Format = ISO.</param> |
| | 559 | | /// <param name="minDateLastSaved">Optional. The minimum last saved date. Format = ISO.</param> |
| | 560 | | /// <param name="minDateLastSavedForUser">Optional. The minimum last saved date for the current user. Format = ISO.< |
| | 561 | | /// <param name="maxPremiereDate">Optional. The maximum premiere date. Format = ISO.</param> |
| | 562 | | /// <param name="hasOverview">Optional filter by items that have an overview or not.</param> |
| | 563 | | /// <param name="hasImdbId">Optional filter by items that have an IMDb id or not.</param> |
| | 564 | | /// <param name="hasTmdbId">Optional filter by items that have a TMDb id or not.</param> |
| | 565 | | /// <param name="hasTvdbId">Optional filter by items that have a TVDb id or not.</param> |
| | 566 | | /// <param name="isMovie">Optional filter for live tv movies.</param> |
| | 567 | | /// <param name="isSeries">Optional filter for live tv series.</param> |
| | 568 | | /// <param name="isNews">Optional filter for live tv news.</param> |
| | 569 | | /// <param name="isKids">Optional filter for live tv kids.</param> |
| | 570 | | /// <param name="isSports">Optional filter for live tv sports.</param> |
| | 571 | | /// <param name="excludeItemIds">Optional. If specified, results will be filtered by excluding item ids. This allows |
| | 572 | | /// <param name="startIndex">Optional. The record index to start at. All items with a lower index will be dropped fr |
| | 573 | | /// <param name="limit">Optional. The maximum number of records to return.</param> |
| | 574 | | /// <param name="recursive">When searching within folders, this determines whether or not the search will be recursi |
| | 575 | | /// <param name="searchTerm">Optional. Filter based on a search term.</param> |
| | 576 | | /// <param name="sortOrder">Sort Order - Ascending, Descending.</param> |
| | 577 | | /// <param name="parentId">Specify this to localize the search to a specific item or folder. Omit to use the root.</ |
| | 578 | | /// <param name="fields">Optional. Specify additional fields of information to return in the output. This allows mul |
| | 579 | | /// <param name="excludeItemTypes">Optional. If specified, results will be filtered based on item type. This allows |
| | 580 | | /// <param name="includeItemTypes">Optional. If specified, results will be filtered based on the item type. This all |
| | 581 | | /// <param name="filters">Optional. Specify additional filters to apply. This allows multiple, comma delimited. Opti |
| | 582 | | /// <param name="isFavorite">Optional filter by items that are marked as favorite, or not.</param> |
| | 583 | | /// <param name="mediaTypes">Optional filter by MediaType. Allows multiple, comma delimited.</param> |
| | 584 | | /// <param name="imageTypes">Optional. If specified, results will be filtered based on those containing image types. |
| | 585 | | /// <param name="sortBy">Optional. Specify one or more sort orders, comma delimited. Options: Album, AlbumArtist, Ar |
| | 586 | | /// <param name="isPlayed">Optional filter by items that are played, or not.</param> |
| | 587 | | /// <param name="genres">Optional. If specified, results will be filtered based on genre. This allows multiple, pipe |
| | 588 | | /// <param name="officialRatings">Optional. If specified, results will be filtered based on OfficialRating. This all |
| | 589 | | /// <param name="tags">Optional. If specified, results will be filtered based on tag. This allows multiple, pipe del |
| | 590 | | /// <param name="years">Optional. If specified, results will be filtered based on production year. This allows multi |
| | 591 | | /// <param name="enableUserData">Optional, include user data.</param> |
| | 592 | | /// <param name="imageTypeLimit">Optional, the max number of images to return, per image type.</param> |
| | 593 | | /// <param name="enableImageTypes">Optional. The image types to include in the output.</param> |
| | 594 | | /// <param name="person">Optional. If specified, results will be filtered to include only those containing the speci |
| | 595 | | /// <param name="personIds">Optional. If specified, results will be filtered to include only those containing the sp |
| | 596 | | /// <param name="personTypes">Optional. If specified, along with Person, results will be filtered to include only th |
| | 597 | | /// <param name="studios">Optional. If specified, results will be filtered based on studio. This allows multiple, pi |
| | 598 | | /// <param name="artists">Optional. If specified, results will be filtered based on artists. This allows multiple, p |
| | 599 | | /// <param name="excludeArtistIds">Optional. If specified, results will be filtered based on artist id. This allows |
| | 600 | | /// <param name="artistIds">Optional. If specified, results will be filtered to include only those containing the sp |
| | 601 | | /// <param name="albumArtistIds">Optional. If specified, results will be filtered to include only those containing t |
| | 602 | | /// <param name="contributingArtistIds">Optional. If specified, results will be filtered to include only those conta |
| | 603 | | /// <param name="albums">Optional. If specified, results will be filtered based on album. This allows multiple, pipe |
| | 604 | | /// <param name="albumIds">Optional. If specified, results will be filtered based on album id. This allows multiple, |
| | 605 | | /// <param name="ids">Optional. If specific items are needed, specify a list of item id's to retrieve. This allows m |
| | 606 | | /// <param name="videoTypes">Optional filter by VideoType (videofile, dvd, bluray, iso). Allows multiple, comma deli |
| | 607 | | /// <param name="minOfficialRating">Optional filter by minimum official rating (PG, PG-13, TV-MA, etc).</param> |
| | 608 | | /// <param name="isLocked">Optional filter by items that are locked.</param> |
| | 609 | | /// <param name="isPlaceHolder">Optional filter by items that are placeholders.</param> |
| | 610 | | /// <param name="hasOfficialRating">Optional filter by items that have official ratings.</param> |
| | 611 | | /// <param name="collapseBoxSetItems">Whether or not to hide items behind their boxsets.</param> |
| | 612 | | /// <param name="minWidth">Optional. Filter by the minimum width of the item.</param> |
| | 613 | | /// <param name="minHeight">Optional. Filter by the minimum height of the item.</param> |
| | 614 | | /// <param name="maxWidth">Optional. Filter by the maximum width of the item.</param> |
| | 615 | | /// <param name="maxHeight">Optional. Filter by the maximum height of the item.</param> |
| | 616 | | /// <param name="is3D">Optional filter by items that are 3D, or not.</param> |
| | 617 | | /// <param name="seriesStatus">Optional filter by Series Status. Allows multiple, comma delimited.</param> |
| | 618 | | /// <param name="nameStartsWithOrGreater">Optional filter by items whose name is sorted equally or greater than a gi |
| | 619 | | /// <param name="nameStartsWith">Optional filter by items whose name is sorted equally than a given input string.</p |
| | 620 | | /// <param name="nameLessThan">Optional filter by items whose name is equally or lesser than a given input string.</ |
| | 621 | | /// <param name="studioIds">Optional. If specified, results will be filtered based on studio id. This allows multipl |
| | 622 | | /// <param name="genreIds">Optional. If specified, results will be filtered based on genre id. This allows multiple, |
| | 623 | | /// <param name="enableTotalRecordCount">Optional. Enable the total record count.</param> |
| | 624 | | /// <param name="enableImages">Optional, include image information in output.</param> |
| | 625 | | /// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the items.</returns> |
| | 626 | | [HttpGet("Users/{userId}/Items")] |
| | 627 | | [Obsolete("Kept for backwards compatibility")] |
| | 628 | | [ApiExplorerSettings(IgnoreApi = true)] |
| | 629 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 630 | | public ActionResult<QueryResult<BaseItemDto>> GetItemsByUserIdLegacy( |
| | 631 | | [FromRoute] Guid userId, |
| | 632 | | [FromQuery] string? maxOfficialRating, |
| | 633 | | [FromQuery] bool? hasThemeSong, |
| | 634 | | [FromQuery] bool? hasThemeVideo, |
| | 635 | | [FromQuery] bool? hasSubtitles, |
| | 636 | | [FromQuery] bool? hasSpecialFeature, |
| | 637 | | [FromQuery] bool? hasTrailer, |
| | 638 | | [FromQuery] Guid? adjacentTo, |
| | 639 | | [FromQuery] int? parentIndexNumber, |
| | 640 | | [FromQuery] bool? hasParentalRating, |
| | 641 | | [FromQuery] bool? isHd, |
| | 642 | | [FromQuery] bool? is4K, |
| | 643 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] LocationType[] locationTypes, |
| | 644 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] LocationType[] excludeLocationTypes, |
| | 645 | | [FromQuery] bool? isMissing, |
| | 646 | | [FromQuery] bool? isUnaired, |
| | 647 | | [FromQuery] double? minCommunityRating, |
| | 648 | | [FromQuery] double? minCriticRating, |
| | 649 | | [FromQuery] DateTime? minPremiereDate, |
| | 650 | | [FromQuery] DateTime? minDateLastSaved, |
| | 651 | | [FromQuery] DateTime? minDateLastSavedForUser, |
| | 652 | | [FromQuery] DateTime? maxPremiereDate, |
| | 653 | | [FromQuery] bool? hasOverview, |
| | 654 | | [FromQuery] bool? hasImdbId, |
| | 655 | | [FromQuery] bool? hasTmdbId, |
| | 656 | | [FromQuery] bool? hasTvdbId, |
| | 657 | | [FromQuery] bool? isMovie, |
| | 658 | | [FromQuery] bool? isSeries, |
| | 659 | | [FromQuery] bool? isNews, |
| | 660 | | [FromQuery] bool? isKids, |
| | 661 | | [FromQuery] bool? isSports, |
| | 662 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] excludeItemIds, |
| | 663 | | [FromQuery] int? startIndex, |
| | 664 | | [FromQuery] int? limit, |
| | 665 | | [FromQuery] bool? recursive, |
| | 666 | | [FromQuery] string? searchTerm, |
| | 667 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] SortOrder[] sortOrder, |
| | 668 | | [FromQuery] Guid? parentId, |
| | 669 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemFields[] fields, |
| | 670 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] excludeItemTypes, |
| | 671 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] includeItemTypes, |
| | 672 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemFilter[] filters, |
| | 673 | | [FromQuery] bool? isFavorite, |
| | 674 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] MediaType[] mediaTypes, |
| | 675 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ImageType[] imageTypes, |
| | 676 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemSortBy[] sortBy, |
| | 677 | | [FromQuery] bool? isPlayed, |
| | 678 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] genres, |
| | 679 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] officialRatings, |
| | 680 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] tags, |
| | 681 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] int[] years, |
| | 682 | | [FromQuery] bool? enableUserData, |
| | 683 | | [FromQuery] int? imageTypeLimit, |
| | 684 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ImageType[] enableImageTypes, |
| | 685 | | [FromQuery] string? person, |
| | 686 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] personIds, |
| | 687 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] string[] personTypes, |
| | 688 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] studios, |
| | 689 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] artists, |
| | 690 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] excludeArtistIds, |
| | 691 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] artistIds, |
| | 692 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] albumArtistIds, |
| | 693 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] contributingArtistIds, |
| | 694 | | [FromQuery, ModelBinder(typeof(PipeDelimitedCollectionModelBinder))] string[] albums, |
| | 695 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] albumIds, |
| | 696 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] ids, |
| | 697 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] VideoType[] videoTypes, |
| | 698 | | [FromQuery] string? minOfficialRating, |
| | 699 | | [FromQuery] bool? isLocked, |
| | 700 | | [FromQuery] bool? isPlaceHolder, |
| | 701 | | [FromQuery] bool? hasOfficialRating, |
| | 702 | | [FromQuery] bool? collapseBoxSetItems, |
| | 703 | | [FromQuery] int? minWidth, |
| | 704 | | [FromQuery] int? minHeight, |
| | 705 | | [FromQuery] int? maxWidth, |
| | 706 | | [FromQuery] int? maxHeight, |
| | 707 | | [FromQuery] bool? is3D, |
| | 708 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] SeriesStatus[] seriesStatus, |
| | 709 | | [FromQuery] string? nameStartsWithOrGreater, |
| | 710 | | [FromQuery] string? nameStartsWith, |
| | 711 | | [FromQuery] string? nameLessThan, |
| | 712 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] studioIds, |
| | 713 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] Guid[] genreIds, |
| | 714 | | [FromQuery] bool enableTotalRecordCount = true, |
| | 715 | | [FromQuery] bool? enableImages = true) |
| | 716 | | => GetItems( |
| | 717 | | userId, |
| | 718 | | maxOfficialRating, |
| | 719 | | hasThemeSong, |
| | 720 | | hasThemeVideo, |
| | 721 | | hasSubtitles, |
| | 722 | | hasSpecialFeature, |
| | 723 | | hasTrailer, |
| | 724 | | adjacentTo, |
| | 725 | | null, |
| | 726 | | parentIndexNumber, |
| | 727 | | hasParentalRating, |
| | 728 | | isHd, |
| | 729 | | is4K, |
| | 730 | | locationTypes, |
| | 731 | | excludeLocationTypes, |
| | 732 | | isMissing, |
| | 733 | | isUnaired, |
| | 734 | | minCommunityRating, |
| | 735 | | minCriticRating, |
| | 736 | | minPremiereDate, |
| | 737 | | minDateLastSaved, |
| | 738 | | minDateLastSavedForUser, |
| | 739 | | maxPremiereDate, |
| | 740 | | hasOverview, |
| | 741 | | hasImdbId, |
| | 742 | | hasTmdbId, |
| | 743 | | hasTvdbId, |
| | 744 | | isMovie, |
| | 745 | | isSeries, |
| | 746 | | isNews, |
| | 747 | | isKids, |
| | 748 | | isSports, |
| | 749 | | excludeItemIds, |
| | 750 | | startIndex, |
| | 751 | | limit, |
| | 752 | | recursive, |
| | 753 | | searchTerm, |
| | 754 | | sortOrder, |
| | 755 | | parentId, |
| | 756 | | fields, |
| | 757 | | excludeItemTypes, |
| | 758 | | includeItemTypes, |
| | 759 | | filters, |
| | 760 | | isFavorite, |
| | 761 | | mediaTypes, |
| | 762 | | imageTypes, |
| | 763 | | sortBy, |
| | 764 | | isPlayed, |
| | 765 | | genres, |
| | 766 | | officialRatings, |
| | 767 | | tags, |
| | 768 | | years, |
| | 769 | | enableUserData, |
| | 770 | | imageTypeLimit, |
| | 771 | | enableImageTypes, |
| | 772 | | person, |
| | 773 | | personIds, |
| | 774 | | personTypes, |
| | 775 | | studios, |
| | 776 | | artists, |
| | 777 | | excludeArtistIds, |
| | 778 | | artistIds, |
| | 779 | | albumArtistIds, |
| | 780 | | contributingArtistIds, |
| | 781 | | albums, |
| | 782 | | albumIds, |
| | 783 | | ids, |
| | 784 | | videoTypes, |
| | 785 | | minOfficialRating, |
| | 786 | | isLocked, |
| | 787 | | isPlaceHolder, |
| | 788 | | hasOfficialRating, |
| | 789 | | collapseBoxSetItems, |
| | 790 | | minWidth, |
| | 791 | | minHeight, |
| | 792 | | maxWidth, |
| | 793 | | maxHeight, |
| | 794 | | is3D, |
| | 795 | | seriesStatus, |
| | 796 | | nameStartsWithOrGreater, |
| | 797 | | nameStartsWith, |
| | 798 | | nameLessThan, |
| | 799 | | studioIds, |
| | 800 | | genreIds, |
| | 801 | | enableTotalRecordCount, |
| | 802 | | enableImages); |
| | 803 | |
|
| | 804 | | /// <summary> |
| | 805 | | /// Gets items based on a query. |
| | 806 | | /// </summary> |
| | 807 | | /// <param name="userId">The user id.</param> |
| | 808 | | /// <param name="startIndex">The start index.</param> |
| | 809 | | /// <param name="limit">The item limit.</param> |
| | 810 | | /// <param name="searchTerm">The search term.</param> |
| | 811 | | /// <param name="parentId">Specify this to localize the search to a specific item or folder. Omit to use the root.</ |
| | 812 | | /// <param name="fields">Optional. Specify additional fields of information to return in the output. This allows mul |
| | 813 | | /// <param name="mediaTypes">Optional. Filter by MediaType. Allows multiple, comma delimited.</param> |
| | 814 | | /// <param name="enableUserData">Optional. Include user data.</param> |
| | 815 | | /// <param name="imageTypeLimit">Optional. The max number of images to return, per image type.</param> |
| | 816 | | /// <param name="enableImageTypes">Optional. The image types to include in the output.</param> |
| | 817 | | /// <param name="excludeItemTypes">Optional. If specified, results will be filtered based on item type. This allows |
| | 818 | | /// <param name="includeItemTypes">Optional. If specified, results will be filtered based on the item type. This all |
| | 819 | | /// <param name="enableTotalRecordCount">Optional. Enable the total record count.</param> |
| | 820 | | /// <param name="enableImages">Optional. Include image information in output.</param> |
| | 821 | | /// <param name="excludeActiveSessions">Optional. Whether to exclude the currently active sessions.</param> |
| | 822 | | /// <response code="200">Items returned.</response> |
| | 823 | | /// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the items that are resumable.</returns> |
| | 824 | | [HttpGet("UserItems/Resume")] |
| | 825 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 826 | | public ActionResult<QueryResult<BaseItemDto>> GetResumeItems( |
| | 827 | | [FromQuery] Guid? userId, |
| | 828 | | [FromQuery] int? startIndex, |
| | 829 | | [FromQuery] int? limit, |
| | 830 | | [FromQuery] string? searchTerm, |
| | 831 | | [FromQuery] Guid? parentId, |
| | 832 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemFields[] fields, |
| | 833 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] MediaType[] mediaTypes, |
| | 834 | | [FromQuery] bool? enableUserData, |
| | 835 | | [FromQuery] int? imageTypeLimit, |
| | 836 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ImageType[] enableImageTypes, |
| | 837 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] excludeItemTypes, |
| | 838 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] includeItemTypes, |
| | 839 | | [FromQuery] bool enableTotalRecordCount = true, |
| | 840 | | [FromQuery] bool? enableImages = true, |
| | 841 | | [FromQuery] bool excludeActiveSessions = false) |
| | 842 | | { |
| 2 | 843 | | var requestUserId = RequestHelpers.GetUserId(User, userId); |
| 2 | 844 | | var user = _userManager.GetUserById(requestUserId); |
| 2 | 845 | | if (user is null) |
| | 846 | | { |
| 1 | 847 | | return NotFound(); |
| | 848 | | } |
| | 849 | |
|
| 1 | 850 | | var parentIdGuid = parentId ?? Guid.Empty; |
| 1 | 851 | | var dtoOptions = new DtoOptions { Fields = fields } |
| 1 | 852 | | .AddClientFields(User) |
| 1 | 853 | | .AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes); |
| | 854 | |
|
| 1 | 855 | | var ancestorIds = Array.Empty<Guid>(); |
| | 856 | |
|
| 1 | 857 | | var excludeFolderIds = user.GetPreferenceValues<Guid>(PreferenceKind.LatestItemExcludes); |
| 1 | 858 | | if (parentIdGuid.IsEmpty() && excludeFolderIds.Length > 0) |
| | 859 | | { |
| 0 | 860 | | ancestorIds = _libraryManager.GetUserRootFolder().GetChildren(user, true) |
| 0 | 861 | | .Where(i => i is Folder) |
| 0 | 862 | | .Where(i => !excludeFolderIds.Contains(i.Id)) |
| 0 | 863 | | .Select(i => i.Id) |
| 0 | 864 | | .ToArray(); |
| | 865 | | } |
| | 866 | |
|
| 1 | 867 | | var excludeItemIds = Array.Empty<Guid>(); |
| 1 | 868 | | if (excludeActiveSessions) |
| | 869 | | { |
| 0 | 870 | | excludeItemIds = _sessionManager.Sessions |
| 0 | 871 | | .Where(s => s.UserId.Equals(requestUserId) && s.NowPlayingItem is not null) |
| 0 | 872 | | .Select(s => s.NowPlayingItem.Id) |
| 0 | 873 | | .ToArray(); |
| | 874 | | } |
| | 875 | |
|
| 1 | 876 | | var itemsResult = _libraryManager.GetItemsResult(new InternalItemsQuery(user) |
| 1 | 877 | | { |
| 1 | 878 | | OrderBy = new[] { (ItemSortBy.DatePlayed, SortOrder.Descending) }, |
| 1 | 879 | | IsResumable = true, |
| 1 | 880 | | StartIndex = startIndex, |
| 1 | 881 | | Limit = limit, |
| 1 | 882 | | ParentId = parentIdGuid, |
| 1 | 883 | | Recursive = true, |
| 1 | 884 | | DtoOptions = dtoOptions, |
| 1 | 885 | | MediaTypes = mediaTypes, |
| 1 | 886 | | IsVirtualItem = false, |
| 1 | 887 | | CollapseBoxSetItems = false, |
| 1 | 888 | | EnableTotalRecordCount = enableTotalRecordCount, |
| 1 | 889 | | AncestorIds = ancestorIds, |
| 1 | 890 | | IncludeItemTypes = includeItemTypes, |
| 1 | 891 | | ExcludeItemTypes = excludeItemTypes, |
| 1 | 892 | | SearchTerm = searchTerm, |
| 1 | 893 | | ExcludeItemIds = excludeItemIds |
| 1 | 894 | | }); |
| | 895 | |
|
| 1 | 896 | | var returnItems = _dtoService.GetBaseItemDtos(itemsResult.Items, dtoOptions, user); |
| | 897 | |
|
| 1 | 898 | | return new QueryResult<BaseItemDto>( |
| 1 | 899 | | startIndex, |
| 1 | 900 | | itemsResult.TotalRecordCount, |
| 1 | 901 | | returnItems); |
| | 902 | | } |
| | 903 | |
|
| | 904 | | /// <summary> |
| | 905 | | /// Gets items based on a query. |
| | 906 | | /// </summary> |
| | 907 | | /// <param name="userId">The user id.</param> |
| | 908 | | /// <param name="startIndex">The start index.</param> |
| | 909 | | /// <param name="limit">The item limit.</param> |
| | 910 | | /// <param name="searchTerm">The search term.</param> |
| | 911 | | /// <param name="parentId">Specify this to localize the search to a specific item or folder. Omit to use the root.</ |
| | 912 | | /// <param name="fields">Optional. Specify additional fields of information to return in the output. This allows mul |
| | 913 | | /// <param name="mediaTypes">Optional. Filter by MediaType. Allows multiple, comma delimited.</param> |
| | 914 | | /// <param name="enableUserData">Optional. Include user data.</param> |
| | 915 | | /// <param name="imageTypeLimit">Optional. The max number of images to return, per image type.</param> |
| | 916 | | /// <param name="enableImageTypes">Optional. The image types to include in the output.</param> |
| | 917 | | /// <param name="excludeItemTypes">Optional. If specified, results will be filtered based on item type. This allows |
| | 918 | | /// <param name="includeItemTypes">Optional. If specified, results will be filtered based on the item type. This all |
| | 919 | | /// <param name="enableTotalRecordCount">Optional. Enable the total record count.</param> |
| | 920 | | /// <param name="enableImages">Optional. Include image information in output.</param> |
| | 921 | | /// <param name="excludeActiveSessions">Optional. Whether to exclude the currently active sessions.</param> |
| | 922 | | /// <response code="200">Items returned.</response> |
| | 923 | | /// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the items that are resumable.</returns> |
| | 924 | | [HttpGet("Users/{userId}/Items/Resume")] |
| | 925 | | [Obsolete("Kept for backwards compatibility")] |
| | 926 | | [ApiExplorerSettings(IgnoreApi = true)] |
| | 927 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 928 | | public ActionResult<QueryResult<BaseItemDto>> GetResumeItemsLegacy( |
| | 929 | | [FromRoute, Required] Guid userId, |
| | 930 | | [FromQuery] int? startIndex, |
| | 931 | | [FromQuery] int? limit, |
| | 932 | | [FromQuery] string? searchTerm, |
| | 933 | | [FromQuery] Guid? parentId, |
| | 934 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ItemFields[] fields, |
| | 935 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] MediaType[] mediaTypes, |
| | 936 | | [FromQuery] bool? enableUserData, |
| | 937 | | [FromQuery] int? imageTypeLimit, |
| | 938 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] ImageType[] enableImageTypes, |
| | 939 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] excludeItemTypes, |
| | 940 | | [FromQuery, ModelBinder(typeof(CommaDelimitedCollectionModelBinder))] BaseItemKind[] includeItemTypes, |
| | 941 | | [FromQuery] bool enableTotalRecordCount = true, |
| | 942 | | [FromQuery] bool? enableImages = true, |
| | 943 | | [FromQuery] bool excludeActiveSessions = false) |
| | 944 | | => GetResumeItems( |
| | 945 | | userId, |
| | 946 | | startIndex, |
| | 947 | | limit, |
| | 948 | | searchTerm, |
| | 949 | | parentId, |
| | 950 | | fields, |
| | 951 | | mediaTypes, |
| | 952 | | enableUserData, |
| | 953 | | imageTypeLimit, |
| | 954 | | enableImageTypes, |
| | 955 | | excludeItemTypes, |
| | 956 | | includeItemTypes, |
| | 957 | | enableTotalRecordCount, |
| | 958 | | enableImages, |
| | 959 | | excludeActiveSessions); |
| | 960 | |
|
| | 961 | | /// <summary> |
| | 962 | | /// Get Item User Data. |
| | 963 | | /// </summary> |
| | 964 | | /// <param name="userId">The user id.</param> |
| | 965 | | /// <param name="itemId">The item id.</param> |
| | 966 | | /// <response code="200">return item user data.</response> |
| | 967 | | /// <response code="404">Item is not found.</response> |
| | 968 | | /// <returns>Return <see cref="UserItemDataDto"/>.</returns> |
| | 969 | | [HttpGet("UserItems/{itemId}/UserData")] |
| | 970 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 971 | | [ProducesResponseType(StatusCodes.Status404NotFound)] |
| | 972 | | public ActionResult<UserItemDataDto?> GetItemUserData( |
| | 973 | | [FromQuery] Guid? userId, |
| | 974 | | [FromRoute, Required] Guid itemId) |
| | 975 | | { |
| 0 | 976 | | var requestUserId = RequestHelpers.GetUserId(User, userId); |
| 0 | 977 | | var user = _userManager.GetUserById(requestUserId); |
| 0 | 978 | | if (user is null) |
| | 979 | | { |
| 0 | 980 | | return NotFound(); |
| | 981 | | } |
| | 982 | |
|
| 0 | 983 | | if (!RequestHelpers.AssertCanUpdateUser(User, user, true)) |
| | 984 | | { |
| 0 | 985 | | return StatusCode(StatusCodes.Status403Forbidden, "User is not allowed to view this item user data."); |
| | 986 | | } |
| | 987 | |
|
| 0 | 988 | | var item = _libraryManager.GetItemById<BaseItem>(itemId, user); |
| 0 | 989 | | if (item is null) |
| | 990 | | { |
| 0 | 991 | | return NotFound(); |
| | 992 | | } |
| | 993 | |
|
| 0 | 994 | | return _userDataRepository.GetUserDataDto(item, user); |
| | 995 | | } |
| | 996 | |
|
| | 997 | | /// <summary> |
| | 998 | | /// Get Item User Data. |
| | 999 | | /// </summary> |
| | 1000 | | /// <param name="userId">The user id.</param> |
| | 1001 | | /// <param name="itemId">The item id.</param> |
| | 1002 | | /// <response code="200">return item user data.</response> |
| | 1003 | | /// <response code="404">Item is not found.</response> |
| | 1004 | | /// <returns>Return <see cref="UserItemDataDto"/>.</returns> |
| | 1005 | | [HttpGet("Users/{userId}/Items/{itemId}/UserData")] |
| | 1006 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 1007 | | [ProducesResponseType(StatusCodes.Status404NotFound)] |
| | 1008 | | [Obsolete("Kept for backwards compatibility")] |
| | 1009 | | [ApiExplorerSettings(IgnoreApi = true)] |
| | 1010 | | public ActionResult<UserItemDataDto?> GetItemUserDataLegacy( |
| | 1011 | | [FromRoute, Required] Guid userId, |
| | 1012 | | [FromRoute, Required] Guid itemId) |
| | 1013 | | => GetItemUserData(userId, itemId); |
| | 1014 | |
|
| | 1015 | | /// <summary> |
| | 1016 | | /// Update Item User Data. |
| | 1017 | | /// </summary> |
| | 1018 | | /// <param name="userId">The user id.</param> |
| | 1019 | | /// <param name="itemId">The item id.</param> |
| | 1020 | | /// <param name="userDataDto">New user data object.</param> |
| | 1021 | | /// <response code="200">return updated user item data.</response> |
| | 1022 | | /// <response code="404">Item is not found.</response> |
| | 1023 | | /// <returns>Return <see cref="UserItemDataDto"/>.</returns> |
| | 1024 | | [HttpPost("UserItems/{itemId}/UserData")] |
| | 1025 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 1026 | | [ProducesResponseType(StatusCodes.Status404NotFound)] |
| | 1027 | | public ActionResult<UserItemDataDto?> UpdateItemUserData( |
| | 1028 | | [FromQuery] Guid? userId, |
| | 1029 | | [FromRoute, Required] Guid itemId, |
| | 1030 | | [FromBody, Required] UpdateUserItemDataDto userDataDto) |
| | 1031 | | { |
| 0 | 1032 | | var requestUserId = RequestHelpers.GetUserId(User, userId); |
| 0 | 1033 | | var user = _userManager.GetUserById(requestUserId); |
| 0 | 1034 | | if (user is null) |
| | 1035 | | { |
| 0 | 1036 | | return NotFound(); |
| | 1037 | | } |
| | 1038 | |
|
| 0 | 1039 | | if (!RequestHelpers.AssertCanUpdateUser(User, user, true)) |
| | 1040 | | { |
| 0 | 1041 | | return StatusCode(StatusCodes.Status403Forbidden, "User is not allowed to update this item user data."); |
| | 1042 | | } |
| | 1043 | |
|
| 0 | 1044 | | var item = _libraryManager.GetItemById<BaseItem>(itemId, user); |
| 0 | 1045 | | if (item is null) |
| | 1046 | | { |
| 0 | 1047 | | return NotFound(); |
| | 1048 | | } |
| | 1049 | |
|
| 0 | 1050 | | _userDataRepository.SaveUserData(user, item, userDataDto, UserDataSaveReason.UpdateUserData); |
| | 1051 | |
|
| 0 | 1052 | | return _userDataRepository.GetUserDataDto(item, user); |
| | 1053 | | } |
| | 1054 | |
|
| | 1055 | | /// <summary> |
| | 1056 | | /// Update Item User Data. |
| | 1057 | | /// </summary> |
| | 1058 | | /// <param name="userId">The user id.</param> |
| | 1059 | | /// <param name="itemId">The item id.</param> |
| | 1060 | | /// <param name="userDataDto">New user data object.</param> |
| | 1061 | | /// <response code="200">return updated user item data.</response> |
| | 1062 | | /// <response code="404">Item is not found.</response> |
| | 1063 | | /// <returns>Return <see cref="UserItemDataDto"/>.</returns> |
| | 1064 | | [HttpPost("Users/{userId}/Items/{itemId}/UserData")] |
| | 1065 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 1066 | | [ProducesResponseType(StatusCodes.Status404NotFound)] |
| | 1067 | | [Obsolete("Kept for backwards compatibility")] |
| | 1068 | | [ApiExplorerSettings(IgnoreApi = true)] |
| | 1069 | | public ActionResult<UserItemDataDto?> UpdateItemUserDataLegacy( |
| | 1070 | | [FromRoute, Required] Guid userId, |
| | 1071 | | [FromRoute, Required] Guid itemId, |
| | 1072 | | [FromBody, Required] UpdateUserItemDataDto userDataDto) |
| | 1073 | | => UpdateItemUserData(userId, itemId, userDataDto); |
| | 1074 | | } |