Sort special features same as other spots, removing unnecssary function

Added to contributors
This commit is contained in:
Zach Phelan 2022-09-13 16:40:47 -06:00
parent 0246ba1fb4
commit c71d6f2358
3 changed files with 3 additions and 14 deletions

View File

@ -148,6 +148,7 @@
- [xosdy](https://github.com/xosdy)
- [XVicarious](https://github.com/XVicarious)
- [YouKnowBlom](https://github.com/YouKnowBlom)
- [ZachPhelan](https://github.com/ZachPhelan)
- [KristupasSavickas](https://github.com/KristupasSavickas)
- [Pusta](https://github.com/pusta)
- [nielsvanvelzen](https://github.com/nielsvanvelzen)

View File

@ -233,7 +233,8 @@ namespace Jellyfin.Api.Controllers
var dtoOptions = new DtoOptions().AddClientFields(Request);
return Ok(item
.GetExtras(BaseItem.DisplayExtraTypes)
.GetExtras()
.Where(i => i.ExtraType.HasValue && BaseItem.DisplayExtraTypes.Contains(i.ExtraType.Value))
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)));
}

View File

@ -2606,19 +2606,6 @@ namespace MediaBrowser.Controller.Entities
.OrderBy(i => i.SortName);
}
/// <summary>
/// Get all extras with specific types that are associated with this item.
/// </summary>
/// <param name="extraTypes">The types of extras to retrieve.</param>
/// <returns>An enumerable containing the extras.</returns>
public IEnumerable<BaseItem> GetExtras(IReadOnlyCollection<ExtraType> extraTypes)
{
return ExtraIds
.Select(LibraryManager.GetItemById)
.Where(i => i != null)
.Where(i => i.ExtraType.HasValue && extraTypes.Contains(i.ExtraType.Value));
}
public virtual long GetRunTimeTicksForPlayState()
{
return RunTimeTicks ?? 0;