reduce system info refreshing from dashboard
This commit is contained in:
parent
04468452ea
commit
b7a8b92c00
|
@ -107,7 +107,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Take(50)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
|
||||
view.SpotlightItems = dtos.ToArray();
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Take(50)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
|
||||
view.SpotlightItems = dtos.ToArray();
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.AsParallel()
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
|
||||
view.SpotlightItems = dtos.ToArray();
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
|
||||
view.ShowsItems = series
|
||||
.Where(i => i.BackdropImagePaths.Count > 0)
|
||||
|
@ -186,7 +186,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
var romanceGenres = request.RomanceGenre.Split(',').ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||
var comedyGenres = request.ComedyGenre.Split(',').ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||
|
@ -197,7 +197,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.ComedyItems = seriesWithBackdrops
|
||||
.Where(i => i.Genres.Any(comedyGenres.ContainsKey))
|
||||
|
@ -205,7 +205,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.ActorItems = GetActors(series);
|
||||
|
||||
|
@ -252,14 +252,14 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Take(50)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
|
||||
view.SpotlightItems = dtos.ToArray();
|
||||
view.SpotlightItems = dtos.ToList();
|
||||
|
||||
view.MovieItems = moviesWithBackdrops
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.TrailerItems = items
|
||||
.OfType<Trailer>()
|
||||
|
@ -268,7 +268,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Primary))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.BoxSetItems = items
|
||||
.OfType<BoxSet>()
|
||||
|
@ -277,7 +277,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.ThreeDItems = moviesWithBackdrops
|
||||
.Where(i => i.Is3D)
|
||||
|
@ -285,7 +285,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
var romanceGenres = request.RomanceGenre.Split(',').ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||
var comedyGenres = request.ComedyGenre.Split(',').ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||
|
@ -296,7 +296,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.ComedyItems = moviesWithBackdrops
|
||||
.Where(i => i.Genres.Any(comedyGenres.ContainsKey))
|
||||
|
@ -304,7 +304,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.HDItems = hdMovies
|
||||
.Where(i => i.BackdropImagePaths.Count > 0)
|
||||
|
@ -312,7 +312,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.FamilyMovies = familyMovies
|
||||
.Where(i => i.BackdropImagePaths.Count > 0)
|
||||
|
@ -320,7 +320,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => GetItemStub(i, ImageType.Backdrop))
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
view.PeopleItems = GetActors(items);
|
||||
|
||||
|
@ -362,7 +362,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
}
|
||||
}
|
||||
|
||||
private ItemStub[] GetActors(IEnumerable<BaseItem> mediaItems)
|
||||
private List<ItemStub> GetActors(IEnumerable<BaseItem> mediaItems)
|
||||
{
|
||||
var actors = mediaItems.SelectMany(i => i.People)
|
||||
.Select(i => i.Name)
|
||||
|
@ -390,7 +390,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
})
|
||||
.Where(i => i != null)
|
||||
.Take(3)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
}
|
||||
|
||||
private ItemStub GetItemStub(BaseItem item, ImageType imageType)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Api.DefaultTheme
|
||||
{
|
||||
|
@ -14,19 +15,19 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
public class MoviesView
|
||||
{
|
||||
public BaseItemDto[] SpotlightItems { get; set; }
|
||||
public ItemStub[] MovieItems { get; set; }
|
||||
public ItemStub[] PeopleItems { get; set; }
|
||||
public List<BaseItemDto> SpotlightItems { get; set; }
|
||||
public List<ItemStub> MovieItems { get; set; }
|
||||
public List<ItemStub> PeopleItems { get; set; }
|
||||
|
||||
public ItemStub[] BoxSetItems { get; set; }
|
||||
public ItemStub[] TrailerItems { get; set; }
|
||||
public ItemStub[] HDItems { get; set; }
|
||||
public ItemStub[] ThreeDItems { get; set; }
|
||||
public List<ItemStub> BoxSetItems { get; set; }
|
||||
public List<ItemStub> TrailerItems { get; set; }
|
||||
public List<ItemStub> HDItems { get; set; }
|
||||
public List<ItemStub> ThreeDItems { get; set; }
|
||||
|
||||
public ItemStub[] FamilyMovies { get; set; }
|
||||
public List<ItemStub> FamilyMovies { get; set; }
|
||||
|
||||
public ItemStub[] RomanceItems { get; set; }
|
||||
public ItemStub[] ComedyItems { get; set; }
|
||||
public List<ItemStub> RomanceItems { get; set; }
|
||||
public List<ItemStub> ComedyItems { get; set; }
|
||||
|
||||
public double FamilyMoviePercentage { get; set; }
|
||||
|
||||
|
@ -35,21 +36,21 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
public class TvView
|
||||
{
|
||||
public BaseItemDto[] SpotlightItems { get; set; }
|
||||
public ItemStub[] ShowsItems { get; set; }
|
||||
public ItemStub[] ActorItems { get; set; }
|
||||
public List<BaseItemDto> SpotlightItems { get; set; }
|
||||
public List<ItemStub> ShowsItems { get; set; }
|
||||
public List<ItemStub> ActorItems { get; set; }
|
||||
|
||||
public ItemStub[] RomanceItems { get; set; }
|
||||
public ItemStub[] ComedyItems { get; set; }
|
||||
public List<ItemStub> RomanceItems { get; set; }
|
||||
public List<ItemStub> ComedyItems { get; set; }
|
||||
}
|
||||
|
||||
public class GamesView
|
||||
{
|
||||
public BaseItemDto[] SpotlightItems { get; set; }
|
||||
public List<BaseItemDto> SpotlightItems { get; set; }
|
||||
}
|
||||
|
||||
public class HomeView
|
||||
{
|
||||
public BaseItemDto[] SpotlightItems { get; set; }
|
||||
public List<BaseItemDto> SpotlightItems { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,14 +57,13 @@ namespace MediaBrowser.Api.Images
|
|||
public ImageOutputFormat Format { get; set; }
|
||||
|
||||
[ApiMember(Name = "Indicator", Description = "Determines what overlay to render, if any. none, watched.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
|
||||
public ImageOverlay Indicator { get; set; }
|
||||
public ImageOverlay? Indicator { get; set; }
|
||||
|
||||
public ImageRequest()
|
||||
{
|
||||
EnableImageEnhancers = true;
|
||||
|
||||
Format = ImageOutputFormat.Original;
|
||||
Indicator = ImageOverlay.None;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -124,14 +124,14 @@ namespace MediaBrowser.Api
|
|||
.Select(i => i.Item1)
|
||||
.Take(limit)
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
var result = new ItemsResult
|
||||
{
|
||||
TotalRecordCount = items.Length
|
||||
TotalRecordCount = items.Count
|
||||
};
|
||||
|
||||
var dtos = items.Take(request.Limit ?? items.Length)
|
||||
var dtos = items.Take(request.Limit ?? items.Count)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
|
||||
result.Items = dtos.ToArray();
|
||||
|
|
|
@ -235,7 +235,7 @@ namespace MediaBrowser.Api
|
|||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <returns>Task{BaseItemDto[]}.</returns>
|
||||
public BaseItemDto[] GetAncestors(GetAncestors request)
|
||||
public List<BaseItemDto> GetAncestors(GetAncestors request)
|
||||
{
|
||||
var item = _dtoService.GetItemByDtoId(request.Id);
|
||||
|
||||
|
@ -267,7 +267,7 @@ namespace MediaBrowser.Api
|
|||
parent = parent.Parent;
|
||||
}
|
||||
|
||||
return baseItemDtos.ToArray();
|
||||
return baseItemDtos.ToList();
|
||||
}
|
||||
|
||||
private BaseItem TranslateParentItem(BaseItem item, User user)
|
||||
|
@ -463,7 +463,7 @@ namespace MediaBrowser.Api
|
|||
Id = request.Id,
|
||||
UserId = request.UserId
|
||||
|
||||
}).Result;
|
||||
});
|
||||
|
||||
var themeVideos = GetThemeVideos(new GetThemeVideos
|
||||
{
|
||||
|
@ -471,7 +471,7 @@ namespace MediaBrowser.Api
|
|||
Id = request.Id,
|
||||
UserId = request.UserId
|
||||
|
||||
}).Result;
|
||||
});
|
||||
|
||||
return ToOptimizedResult(new AllThemeMediaResult
|
||||
{
|
||||
|
@ -487,12 +487,12 @@ namespace MediaBrowser.Api
|
|||
/// <returns>System.Object.</returns>
|
||||
public object Get(GetThemeSongs request)
|
||||
{
|
||||
var result = GetThemeSongs(request).Result;
|
||||
var result = GetThemeSongs(request);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
private async Task<ThemeMediaResult> GetThemeSongs(GetThemeSongs request)
|
||||
private ThemeMediaResult GetThemeSongs(GetThemeSongs request)
|
||||
{
|
||||
var user = request.UserId.HasValue ? _userManager.GetUserById(request.UserId.Value) : null;
|
||||
|
||||
|
@ -533,12 +533,12 @@ namespace MediaBrowser.Api
|
|||
/// <returns>System.Object.</returns>
|
||||
public object Get(GetThemeVideos request)
|
||||
{
|
||||
var result = GetThemeVideos(request).Result;
|
||||
var result = GetThemeVideos(request);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
public async Task<ThemeMediaResult> GetThemeVideos(GetThemeVideos request)
|
||||
public ThemeMediaResult GetThemeVideos(GetThemeVideos request)
|
||||
{
|
||||
var user = request.UserId.HasValue ? _userManager.GetUserById(request.UserId.Value) : null;
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
var results = await _searchEngine.GetSearchHints(inputItems, request.SearchTerm).ConfigureAwait(false);
|
||||
|
||||
var searchResultArray = results.ToArray();
|
||||
var searchResultArray = results.ToList();
|
||||
|
||||
IEnumerable<SearchHintInfo> returnResults = searchResultArray;
|
||||
|
||||
|
@ -134,7 +134,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
return new SearchHintResult
|
||||
{
|
||||
TotalRecordCount = searchResultArray.Length,
|
||||
TotalRecordCount = searchResultArray.Count,
|
||||
|
||||
SearchHints = returnResults.Select(GetSearchHintResult).ToArray()
|
||||
};
|
||||
|
|
|
@ -108,13 +108,20 @@ namespace MediaBrowser.Api
|
|||
: user.RootFolder.GetRecursiveChildren(user);
|
||||
|
||||
var items = GetSimilaritems(item, inputItems, includeInSearch, getSimilarityScore)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
IEnumerable<BaseItem> returnItems = items;
|
||||
|
||||
if (request.Limit.HasValue)
|
||||
{
|
||||
returnItems = returnItems.Take(request.Limit.Value);
|
||||
}
|
||||
|
||||
var result = new ItemsResult
|
||||
{
|
||||
Items = items.Take(request.Limit ?? items.Length).Select(i => dtoService.GetBaseItemDto(i, fields, user)).ToArray(),
|
||||
Items = returnItems.Select(i => dtoService.GetBaseItemDto(i, fields, user)).ToArray(),
|
||||
|
||||
TotalRecordCount = items.Length
|
||||
TotalRecordCount = items.Count
|
||||
};
|
||||
|
||||
return result;
|
||||
|
|
|
@ -3,13 +3,11 @@ using MediaBrowser.Controller.Entities;
|
|||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using ServiceStack.ServiceHost;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Api
|
||||
{
|
||||
|
@ -144,7 +142,7 @@ namespace MediaBrowser.Api
|
|||
/// <returns>System.Object.</returns>
|
||||
public object Get(GetNextUpEpisodes request)
|
||||
{
|
||||
var result = GetNextUpEpisodes(request).Result;
|
||||
var result = GetNextUpEpisodes(request);
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
@ -154,18 +152,18 @@ namespace MediaBrowser.Api
|
|||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <returns>Task{ItemsResult}.</returns>
|
||||
private async Task<ItemsResult> GetNextUpEpisodes(GetNextUpEpisodes request)
|
||||
private ItemsResult GetNextUpEpisodes(GetNextUpEpisodes request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
var itemsArray = user.RootFolder
|
||||
var itemsList = user.RootFolder
|
||||
.GetRecursiveChildren(user)
|
||||
.OfType<Series>()
|
||||
.AsParallel()
|
||||
.Select(i => GetNextUp(i, user))
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
itemsArray = itemsArray
|
||||
itemsList = itemsList
|
||||
.Where(i => i.Item1 != null)
|
||||
.OrderByDescending(i =>
|
||||
{
|
||||
|
@ -185,9 +183,9 @@ namespace MediaBrowser.Api
|
|||
return 0;
|
||||
})
|
||||
.ThenByDescending(i => i.Item1.PremiereDate ?? DateTime.MinValue)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
var pagedItems = ApplyPaging(request, itemsArray.Select(i => i.Item1));
|
||||
var pagedItems = ApplyPaging(request, itemsList.Select(i => i.Item1));
|
||||
|
||||
var fields = request.GetItemFields().ToList();
|
||||
|
||||
|
@ -195,7 +193,7 @@ namespace MediaBrowser.Api
|
|||
|
||||
return new ItemsResult
|
||||
{
|
||||
TotalRecordCount = itemsArray.Length,
|
||||
TotalRecordCount = itemsList.Count,
|
||||
Items = returnItems
|
||||
};
|
||||
}
|
||||
|
|
|
@ -96,13 +96,13 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
filteredItems = ItemsService.ApplySortOrder(request, filteredItems, user, LibraryManager).Cast<TItemType>();
|
||||
|
||||
var ibnItemsArray = filteredItems.ToArray();
|
||||
var ibnItemsArray = filteredItems.ToList();
|
||||
|
||||
IEnumerable<TItemType> ibnItems = ibnItemsArray;
|
||||
|
||||
var result = new ItemsResult
|
||||
{
|
||||
TotalRecordCount = ibnItemsArray.Length
|
||||
TotalRecordCount = ibnItemsArray.Count
|
||||
};
|
||||
|
||||
if (request.StartIndex.HasValue || request.Limit.HasValue)
|
||||
|
@ -142,8 +142,8 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
items = items.Where(i => string.Compare(request.NameStartsWithOrGreater, i.Name, StringComparison.CurrentCultureIgnoreCase) < 1);
|
||||
}
|
||||
|
||||
var imageTypes = request.GetImageTypes().ToArray();
|
||||
if (imageTypes.Length > 0)
|
||||
var imageTypes = request.GetImageTypes().ToList();
|
||||
if (imageTypes.Count > 0)
|
||||
{
|
||||
items = items.Where(item => imageTypes.Any(imageType => ItemsService.HasImage(item, imageType)));
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
items = ApplySortOrder(request, items, user, _libraryManager);
|
||||
|
||||
var itemsArray = items.ToArray();
|
||||
var itemsArray = items.ToList();
|
||||
|
||||
var pagedItems = ApplyPaging(request, itemsArray);
|
||||
|
||||
|
@ -264,7 +264,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
return new ItemsResult
|
||||
{
|
||||
TotalRecordCount = itemsArray.Length,
|
||||
TotalRecordCount = itemsArray.Count,
|
||||
Items = returnItems
|
||||
};
|
||||
}
|
||||
|
@ -307,9 +307,9 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
internal static IEnumerable<BaseItem> ApplySortOrder(BaseItemsRequest request, IEnumerable<BaseItem> items, User user, ILibraryManager libraryManager)
|
||||
{
|
||||
var orderBy = request.GetOrderBy().ToArray();
|
||||
var orderBy = request.GetOrderBy().ToList();
|
||||
|
||||
return orderBy.Length == 0 ? items : libraryManager.Sort(items, user, orderBy, request.SortOrder ?? SortOrder.Ascending);
|
||||
return orderBy.Count == 0 ? items : libraryManager.Sort(items, user, orderBy, request.SortOrder ?? SortOrder.Ascending);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -603,8 +603,8 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
items = items.Where(i => !string.IsNullOrEmpty(i.MediaType) && types.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
var imageTypes = request.GetImageTypes().ToArray();
|
||||
if (imageTypes.Length > 0)
|
||||
var imageTypes = request.GetImageTypes().ToList();
|
||||
if (imageTypes.Count > 0)
|
||||
{
|
||||
items = items.Where(item => imageTypes.Any(imageType => HasImage(item, imageType)));
|
||||
}
|
||||
|
|
|
@ -398,7 +398,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
private BaseItemDto[] GetAsync(GetSpecialFeatures request)
|
||||
private List<BaseItemDto> GetAsync(GetSpecialFeatures request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
|
@ -420,7 +420,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
.OrderBy(i => i.SortName)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user, movie1));
|
||||
|
||||
return dtos.ToArray();
|
||||
return dtos.ToList();
|
||||
}
|
||||
|
||||
var series = item as Series;
|
||||
|
@ -448,7 +448,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
.ThenBy(i => i.SortName)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user));
|
||||
|
||||
return dtos.ToArray();
|
||||
return dtos.ToList();
|
||||
}
|
||||
|
||||
throw new ArgumentException("The item does not support special features");
|
||||
|
@ -466,7 +466,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
||||
private BaseItemDto[] GetAsync(GetLocalTrailers request)
|
||||
private List<BaseItemDto> GetAsync(GetLocalTrailers request)
|
||||
{
|
||||
var user = _userManager.GetUserById(request.UserId);
|
||||
|
||||
|
@ -480,7 +480,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
.OrderBy(i => i.SortName)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user, item));
|
||||
|
||||
return dtos.ToArray();
|
||||
return dtos.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace MediaBrowser.Common.Implementations
|
|||
{
|
||||
FailedAssemblies.Clear();
|
||||
|
||||
var assemblies = GetComposablePartAssemblies().ToArray();
|
||||
var assemblies = GetComposablePartAssemblies().ToList();
|
||||
|
||||
foreach (var assembly in assemblies)
|
||||
{
|
||||
|
@ -431,7 +431,7 @@ namespace MediaBrowser.Common.Implementations
|
|||
/// <returns>IEnumerable{``0}.</returns>
|
||||
public IEnumerable<T> GetExports<T>(bool manageLiftime = true)
|
||||
{
|
||||
var parts = GetExportTypes<T>().Select(CreateInstance).Cast<T>().ToArray();
|
||||
var parts = GetExportTypes<T>().Select(CreateInstance).Cast<T>().ToList();
|
||||
|
||||
if (manageLiftime)
|
||||
{
|
||||
|
|
|
@ -470,7 +470,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||
{
|
||||
var message = new HttpRequestMessage(HttpMethod.Get, options.Url);
|
||||
|
||||
foreach (var pair in options.RequestHeaders.ToArray())
|
||||
foreach (var pair in options.RequestHeaders.ToList())
|
||||
{
|
||||
message.Headers.Add(pair.Key, pair.Value);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MediaBrowser.Common.ScheduledTasks
|
|||
State = task.State,
|
||||
Id = task.Id,
|
||||
LastExecutionResult = task.LastExecutionResult,
|
||||
Triggers = task.Triggers.Select(GetTriggerInfo).ToArray(),
|
||||
Triggers = task.Triggers.Select(GetTriggerInfo).ToList(),
|
||||
Description = task.Description,
|
||||
Category = task.Category
|
||||
};
|
||||
|
|
|
@ -35,6 +35,6 @@ namespace MediaBrowser.Controller.Drawing
|
|||
|
||||
public ImageOutputFormat OutputFormat { get; set; }
|
||||
|
||||
public ImageOverlay Indicator { get; set; }
|
||||
public ImageOverlay? Indicator { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,8 @@ namespace MediaBrowser.Controller.Entities
|
|||
IndexCache.Clear();
|
||||
}
|
||||
|
||||
ResetDynamicChildren();
|
||||
|
||||
return NullTaskResult;
|
||||
}
|
||||
|
||||
|
@ -99,7 +101,8 @@ namespace MediaBrowser.Controller.Entities
|
|||
return LibraryManager.RootFolder.Children
|
||||
.OfType<Folder>()
|
||||
.Where(i => i.Path != null && locationsDicionary.ContainsKey(i.Path))
|
||||
.SelectMany(c => c.LinkedChildren).ToList();
|
||||
.SelectMany(c => c.LinkedChildren)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
private IEnumerable<BaseItem> _actualChildren;
|
||||
|
@ -131,7 +134,8 @@ namespace MediaBrowser.Controller.Entities
|
|||
LibraryManager.RootFolder.Children
|
||||
.OfType<Folder>()
|
||||
.Where(i => i.Path != null && locationsDicionary.ContainsKey(i.Path))
|
||||
.SelectMany(c => c.Children);
|
||||
.SelectMany(c => c.Children)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void ResetDynamicChildren()
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
item.DateModified = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
_children.Add(item);
|
||||
AddChildrenInternal(new[] { item });
|
||||
|
||||
await LibraryManager.CreateItem(item, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
@ -728,10 +728,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
|
||||
if (actualRemovals.Count > 0)
|
||||
{
|
||||
lock (ChildrenSyncLock)
|
||||
{
|
||||
_children = new ConcurrentBag<BaseItem>(_children.Except(actualRemovals));
|
||||
}
|
||||
RemoveChildrenInternal(actualRemovals);
|
||||
}
|
||||
|
||||
await LibraryManager.CreateItems(newItems, cancellationToken).ConfigureAwait(false);
|
||||
|
|
|
@ -6,10 +6,6 @@ namespace MediaBrowser.Model.Drawing
|
|||
/// </summary>
|
||||
public enum ImageOverlay
|
||||
{
|
||||
/// <summary>
|
||||
/// The none
|
||||
/// </summary>
|
||||
None,
|
||||
/// <summary>
|
||||
/// The watched
|
||||
/// </summary>
|
||||
|
|
|
@ -72,14 +72,13 @@ namespace MediaBrowser.Model.Dto
|
|||
|
||||
public ImageOutputFormat Format { get; set; }
|
||||
|
||||
public ImageOverlay Indicator { get; set; }
|
||||
public ImageOverlay? Indicator { get; set; }
|
||||
|
||||
public ImageOptions()
|
||||
{
|
||||
EnableImageEnhancers = true;
|
||||
|
||||
Format = ImageOutputFormat.Original;
|
||||
Indicator = ImageOverlay.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Model.Updates;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Model.System
|
||||
{
|
||||
|
@ -35,7 +36,7 @@ namespace MediaBrowser.Model.System
|
|||
/// Gets or sets the in progress installations.
|
||||
/// </summary>
|
||||
/// <value>The in progress installations.</value>
|
||||
public InstallationInfo[] InProgressInstallations { get; set; }
|
||||
public List<InstallationInfo> InProgressInstallations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the web socket port number.
|
||||
|
@ -47,7 +48,7 @@ namespace MediaBrowser.Model.System
|
|||
/// Gets or sets the completed installations.
|
||||
/// </summary>
|
||||
/// <value>The completed installations.</value>
|
||||
public InstallationInfo[] CompletedInstallations { get; set; }
|
||||
public List<InstallationInfo> CompletedInstallations { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [supports native web socket].
|
||||
|
@ -59,7 +60,7 @@ namespace MediaBrowser.Model.System
|
|||
/// Gets or sets plugin assemblies that failed to load.
|
||||
/// </summary>
|
||||
/// <value>The failed assembly loads.</value>
|
||||
public string[] FailedPluginAssemblies { get; set; }
|
||||
public List<string> FailedPluginAssemblies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id.
|
||||
|
@ -84,11 +85,11 @@ namespace MediaBrowser.Model.System
|
|||
/// </summary>
|
||||
public SystemInfo()
|
||||
{
|
||||
InProgressInstallations = new InstallationInfo[] { };
|
||||
InProgressInstallations = new List<InstallationInfo>();
|
||||
|
||||
CompletedInstallations = new InstallationInfo[] { };
|
||||
CompletedInstallations = new List<InstallationInfo>();
|
||||
|
||||
FailedPluginAssemblies = new string[] { };
|
||||
FailedPluginAssemblies = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Model.Tasks
|
||||
{
|
||||
|
@ -41,7 +42,7 @@ namespace MediaBrowser.Model.Tasks
|
|||
/// Gets or sets the triggers.
|
||||
/// </summary>
|
||||
/// <value>The triggers.</value>
|
||||
public TaskTriggerInfo[] Triggers { get; set; }
|
||||
public List<TaskTriggerInfo> Triggers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the description.
|
||||
|
@ -60,7 +61,7 @@ namespace MediaBrowser.Model.Tasks
|
|||
/// </summary>
|
||||
public TaskInfo()
|
||||
{
|
||||
Triggers = new TaskTriggerInfo[] {};
|
||||
Triggers = new List<TaskTriggerInfo>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,9 +172,9 @@ namespace MediaBrowser.Providers.Movies
|
|||
var files = new DirectoryInfo(path)
|
||||
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
|
||||
.Select(i => i.LastWriteTimeUtc)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
if (files.Length > 0)
|
||||
if (files.Count > 0)
|
||||
{
|
||||
return files.Max();
|
||||
}
|
||||
|
|
|
@ -166,9 +166,9 @@ namespace MediaBrowser.Providers.Music
|
|||
var files = new DirectoryInfo(path)
|
||||
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
|
||||
.Select(i => i.LastWriteTimeUtc)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
if (files.Length > 0)
|
||||
if (files.Count > 0)
|
||||
{
|
||||
return files.Max();
|
||||
}
|
||||
|
|
|
@ -103,9 +103,9 @@ namespace MediaBrowser.Providers.TV
|
|||
var files = new DirectoryInfo(path)
|
||||
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
|
||||
.Select(i => i.LastWriteTimeUtc)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
if (files.Length > 0)
|
||||
if (files.Count > 0)
|
||||
{
|
||||
return files.Max();
|
||||
}
|
||||
|
|
|
@ -165,9 +165,9 @@ namespace MediaBrowser.Providers.TV
|
|||
var files = new DirectoryInfo(path)
|
||||
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
|
||||
.Select(i => i.LastWriteTimeUtc)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
if (files.Length > 0)
|
||||
if (files.Count > 0)
|
||||
{
|
||||
return files.Max();
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ namespace MediaBrowser.Providers.TV
|
|||
/// <returns>Task{System.Boolean}.</returns>
|
||||
private async Task FetchSeriesData(Series series, string seriesId, string seriesDataPath, bool isForcedRefresh, CancellationToken cancellationToken)
|
||||
{
|
||||
var files = Directory.EnumerateFiles(seriesDataPath, "*.xml", SearchOption.TopDirectoryOnly).Select(Path.GetFileName).ToArray();
|
||||
var files = Directory.EnumerateFiles(seriesDataPath, "*.xml", SearchOption.TopDirectoryOnly).Select(Path.GetFileName).ToList();
|
||||
|
||||
var seriesXmlFilename = ConfigurationManager.Configuration.PreferredMetadataLanguage.ToLower() + ".xml";
|
||||
|
||||
|
@ -555,9 +555,9 @@ namespace MediaBrowser.Providers.TV
|
|||
.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(i => i.Trim())
|
||||
.Where(i => !string.IsNullOrWhiteSpace(i))
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
if (vals.Length > 0)
|
||||
if (vals.Count > 0)
|
||||
{
|
||||
item.Genres.Clear();
|
||||
|
||||
|
@ -584,9 +584,9 @@ namespace MediaBrowser.Providers.TV
|
|||
.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(i => i.Trim())
|
||||
.Where(i => !string.IsNullOrWhiteSpace(i))
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
if (vals.Length > 0)
|
||||
if (vals.Count > 0)
|
||||
{
|
||||
item.Studios.Clear();
|
||||
|
||||
|
|
|
@ -208,15 +208,27 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
|||
|
||||
private WatchedIndicatorDrawer _watchedDrawer;
|
||||
|
||||
private void DrawIndicator(Graphics graphics, int imageWidth, int imageHeight, ImageOverlay indicator)
|
||||
private void DrawIndicator(Graphics graphics, int imageWidth, int imageHeight, ImageOverlay? indicator)
|
||||
{
|
||||
if (indicator == ImageOverlay.Watched)
|
||||
if (!indicator.HasValue)
|
||||
{
|
||||
_watchedDrawer = _watchedDrawer ?? (_watchedDrawer = new WatchedIndicatorDrawer());
|
||||
return;
|
||||
}
|
||||
|
||||
var currentImageSize = new Size(imageWidth, imageHeight);
|
||||
try
|
||||
{
|
||||
if (indicator.Value == ImageOverlay.Watched)
|
||||
{
|
||||
_watchedDrawer = _watchedDrawer ?? (_watchedDrawer = new WatchedIndicatorDrawer());
|
||||
|
||||
_watchedDrawer.Process(graphics, currentImageSize);
|
||||
var currentImageSize = new Size(imageWidth, imageHeight);
|
||||
|
||||
_watchedDrawer.Process(graphics, currentImageSize);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error drawing indicator overlay", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,7 +350,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
|||
/// <summary>
|
||||
/// Gets the cache file path based on a set of parameters
|
||||
/// </summary>
|
||||
private string GetCacheFilePath(string originalPath, ImageSize outputSize, int quality, DateTime dateModified, ImageOutputFormat format, ImageOverlay overlay)
|
||||
private string GetCacheFilePath(string originalPath, ImageSize outputSize, int quality, DateTime dateModified, ImageOutputFormat format, ImageOverlay? overlay)
|
||||
{
|
||||
var filename = originalPath;
|
||||
|
||||
|
@ -355,9 +367,9 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
|||
filename += "format=" + format;
|
||||
}
|
||||
|
||||
if (overlay != ImageOverlay.None)
|
||||
if (overlay.HasValue)
|
||||
{
|
||||
filename += "overlay=" + overlay;
|
||||
filename += "overlay=" + overlay.Value;
|
||||
}
|
||||
|
||||
return GetCachePath(_resizedImageCachePath, filename, Path.GetExtension(originalPath));
|
||||
|
@ -414,9 +426,13 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
|||
|
||||
try
|
||||
{
|
||||
var result = File.ReadAllText(fullCachePath).Split('|').Select(i => double.Parse(i, UsCulture)).ToArray();
|
||||
var result = File.ReadAllText(fullCachePath).Split('|');
|
||||
|
||||
return new ImageSize { Width = result[0], Height = result[1] };
|
||||
return new ImageSize
|
||||
{
|
||||
Width = double.Parse(result[0], UsCulture),
|
||||
Height = double.Parse(result[1], UsCulture)
|
||||
};
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
|
@ -429,12 +445,13 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
|||
{
|
||||
try
|
||||
{
|
||||
var result = File.ReadAllText(fullCachePath)
|
||||
.Split('|')
|
||||
.Select(i => double.Parse(i, UsCulture))
|
||||
.ToArray();
|
||||
var result = File.ReadAllText(fullCachePath).Split('|');
|
||||
|
||||
return new ImageSize { Width = result[0], Height = result[1] };
|
||||
return new ImageSize
|
||||
{
|
||||
Width = double.Parse(result[0], UsCulture),
|
||||
Height = double.Parse(result[1], UsCulture)
|
||||
};
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
|
|
|
@ -299,7 +299,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
/// <param name="searchInput">The search input.</param>
|
||||
/// <param name="searchWords">The search input.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
private Tuple<string, int> GetIndex(string input, string searchInput, string[] searchWords)
|
||||
private Tuple<string, int> GetIndex(string input, string searchInput, List<string> searchWords)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
|
@ -324,11 +324,11 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
|
||||
var items = GetWords(input);
|
||||
|
||||
for (var i = 0; i < searchWords.Length; i++)
|
||||
for (var i = 0; i < searchWords.Count; i++)
|
||||
{
|
||||
var searchTerm = searchWords[i];
|
||||
|
||||
for (var j = 0; j < items.Length; j++)
|
||||
for (var j = 0; j < items.Count; j++)
|
||||
{
|
||||
var item = items[j];
|
||||
|
||||
|
@ -357,9 +357,9 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
/// </summary>
|
||||
/// <param name="term">The term.</param>
|
||||
/// <returns>System.String[][].</returns>
|
||||
private string[] GetWords(string term)
|
||||
private List<string> GetWords(string term)
|
||||
{
|
||||
return term.Split().Where(i => !string.IsNullOrWhiteSpace(i)).ToArray();
|
||||
return term.Split().Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,10 +57,10 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
/// <returns>Task.</returns>
|
||||
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var allItems = _libraryManager.RootFolder.RecursiveChildren.ToArray();
|
||||
var allItems = _libraryManager.RootFolder.RecursiveChildren.ToList();
|
||||
|
||||
var allMusicArtists = allItems.OfType<MusicArtist>().ToArray();
|
||||
var allSongs = allItems.OfType<Audio>().ToArray();
|
||||
var allMusicArtists = allItems.OfType<MusicArtist>().ToList();
|
||||
var allSongs = allItems.OfType<Audio>().ToList();
|
||||
|
||||
var innerProgress = new ActionableProgress<double>();
|
||||
|
||||
|
@ -73,8 +73,8 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
var numComplete = 0;
|
||||
|
||||
var userLibraries = _userManager.Users
|
||||
.Select(i => new Tuple<Guid, IHasArtist[]>(i.Id, i.RootFolder.GetRecursiveChildren(i).OfType<IHasArtist>().ToArray()))
|
||||
.ToArray();
|
||||
.Select(i => new Tuple<Guid, List<IHasArtist>>(i.Id, i.RootFolder.GetRecursiveChildren(i).OfType<IHasArtist>().ToList()))
|
||||
.ToList();
|
||||
|
||||
var numArtists = allArtists.Count;
|
||||
|
||||
|
@ -140,11 +140,11 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
|
||||
var items = allItems
|
||||
.Where(i => i.HasArtist(name))
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
var counts = new ItemByNameCounts
|
||||
{
|
||||
TotalCount = items.Length,
|
||||
TotalCount = items.Count,
|
||||
|
||||
SongCount = items.OfType<Audio>().Count(),
|
||||
|
||||
|
@ -167,7 +167,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
private void MergeImages(Dictionary<ImageType, string> source, Dictionary<ImageType, string> target)
|
||||
{
|
||||
foreach (var key in source.Keys
|
||||
.ToArray()
|
||||
.Where(k => !target.ContainsKey(k)))
|
||||
{
|
||||
string path;
|
||||
|
@ -202,7 +201,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
return list;
|
||||
})
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
const int maxTasks = 3;
|
||||
|
||||
|
@ -211,6 +210,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
var returnArtists = new ConcurrentBag<Artist>();
|
||||
|
||||
var numComplete = 0;
|
||||
var numArtists = allArtists.Count;
|
||||
|
||||
foreach (var artist in allArtists)
|
||||
{
|
||||
|
@ -248,7 +248,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
{
|
||||
numComplete++;
|
||||
double percent = numComplete;
|
||||
percent /= allArtists.Length;
|
||||
percent /= numArtists;
|
||||
|
||||
progress.Report(100 * percent);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
private void RunInternal(IProgress<double> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
var userLibraries = _userManager.Users
|
||||
.Select(i => new Tuple<Guid, BaseItem[]>(i.Id, i.RootFolder.GetRecursiveChildren(i).ToArray()))
|
||||
.Select(i => new Tuple<Guid, List<BaseItem>>(i.Id, i.RootFolder.GetRecursiveChildren(i).ToList()))
|
||||
.ToList();
|
||||
|
||||
var masterDictionary = new Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>>(StringComparer.OrdinalIgnoreCase);
|
||||
|
@ -118,7 +118,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
var names = media
|
||||
.People.Select(i => i.Name)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.ToArray();
|
||||
.ToList();
|
||||
|
||||
CountHelpers.SetItemCounts(userId, media, names, masterDictionary);
|
||||
}
|
||||
|
|
|
@ -460,11 +460,11 @@ namespace MediaBrowser.ServerApplication
|
|||
GetExports<ILibraryPostScanTask>(),
|
||||
GetExports<IMetadataSaver>());
|
||||
|
||||
ProviderManager.AddParts(GetExports<BaseMetadataProvider>().ToArray());
|
||||
ProviderManager.AddParts(GetExports<BaseMetadataProvider>());
|
||||
|
||||
IsoManager.AddParts(GetExports<IIsoMounter>().ToArray());
|
||||
IsoManager.AddParts(GetExports<IIsoMounter>());
|
||||
|
||||
ImageProcessor.AddParts(GetExports<IImageEnhancer>().ToArray());
|
||||
ImageProcessor.AddParts(GetExports<IImageEnhancer>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -607,9 +607,9 @@ namespace MediaBrowser.ServerApplication
|
|||
IsNetworkDeployed = CanSelfUpdate,
|
||||
WebSocketPortNumber = ServerManager.WebSocketPortNumber,
|
||||
SupportsNativeWebSocket = ServerManager.SupportsNativeWebSocket,
|
||||
FailedPluginAssemblies = FailedAssemblies.ToArray(),
|
||||
InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToArray(),
|
||||
CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(),
|
||||
FailedPluginAssemblies = FailedAssemblies.ToList(),
|
||||
InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToList(),
|
||||
CompletedInstallations = InstallationManager.CompletedInstallations.ToList(),
|
||||
Id = _systemId,
|
||||
ProgramDataPath = ApplicationPaths.ProgramDataPath,
|
||||
MacAddress = GetMacAddress(),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.WebDashboard.Api
|
||||
{
|
||||
|
@ -20,7 +21,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
/// Gets or sets the running tasks.
|
||||
/// </summary>
|
||||
/// <value>The running tasks.</value>
|
||||
public TaskInfo[] RunningTasks { get; set; }
|
||||
public List<TaskInfo> RunningTasks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the application update task id.
|
||||
|
@ -32,7 +33,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
/// Gets or sets the active connections.
|
||||
/// </summary>
|
||||
/// <value>The active connections.</value>
|
||||
public SessionInfoDto[] ActiveConnections { get; set; }
|
||||
public List<SessionInfoDto> ActiveConnections { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
ITaskManager taskManager,
|
||||
ISessionManager connectionManager, IDtoService dtoService)
|
||||
{
|
||||
var connections = connectionManager.Sessions.Where(i => i.IsActive).ToArray();
|
||||
var connections = connectionManager.Sessions.Where(i => i.IsActive).ToList();
|
||||
|
||||
return new DashboardInfo
|
||||
{
|
||||
|
@ -195,11 +195,11 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
|
||||
RunningTasks = taskManager.ScheduledTasks.Where(i => i.State == TaskState.Running || i.State == TaskState.Cancelling)
|
||||
.Select(ScheduledTaskHelpers.GetTaskInfo)
|
||||
.ToArray(),
|
||||
.ToList(),
|
||||
|
||||
ApplicationUpdateTaskId = taskManager.ScheduledTasks.First(t => t.ScheduledTask.GetType().Name.Equals("SystemUpdateTask", StringComparison.OrdinalIgnoreCase)).Id,
|
||||
|
||||
ActiveConnections = connections.Select(dtoService.GetSessionInfoDto).ToArray()
|
||||
ActiveConnections = connections.Select(dtoService.GetSessionInfoDto).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user