The Free Software Media System - Server Backend & API
update active recordings
Luke Pulverentie441e2f53db0
diff --git a/Emby.Dlna/ContentDirectory/ContentDirectory.cs b/Emby.Dlna/ContentDirectory/ContentDirectory.csindex 92d388e3b2..d547ad8d43 100644--- a/Emby.Dlna/ContentDirectory/ContentDirectory.cs+++ b/Emby.Dlna/ContentDirectory/ContentDirectory.cs@@ -10,7 +10,6 @@ using MediaBrowser.Model.Dlna;using MediaBrowser.Model.Logging;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Controller.MediaEncoding;using MediaBrowser.Controller.TV;using MediaBrowser.Model.Globalization;@@ -129,9 +128,20 @@ namespace Emby.Dlna.ContentDirectory}}- // No configuration so it's going to be pretty arbitrary- return _userManager.Users.FirstOrDefault(i => i.Policy.IsAdministrator) ??- _userManager.Users.First();+ foreach (var user in _userManager.Users)+ {+ if (user.Policy.IsAdministrator)+ {+ return user;+ }+ }++ foreach (var user in _userManager.Users)+ {+ return user;+ }++ return null;}public void Dispose()diff --git a/Emby.Dlna/Didl/Filter.cs b/Emby.Dlna/Didl/Filter.csindex 5e9aeb530a..2c9a1ea184 100644--- a/Emby.Dlna/Didl/Filter.cs+++ b/Emby.Dlna/Didl/Filter.cs@@ -1,13 +1,12 @@using MediaBrowser.Model.Extensions;using System;using System.Collections.Generic;-using System.Linq;namespace Emby.Dlna.Didl{public class Filter{- private readonly List<string> _fields;+ private readonly string[] _fields;private readonly bool _all;public Filter()@@ -20,9 +19,7 @@ namespace Emby.Dlna.Didl{_all = StringHelper.EqualsIgnoreCase(filter, "*");- var list = (filter ?? string.Empty).Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).ToList();-- _fields = list;+ _fields = (filter ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);}public bool Contains(string field)diff --git a/Emby.Dlna/Didl/StringWriterWithEncoding.cs b/Emby.Dlna/Didl/StringWriterWithEncoding.csindex 052d6610b1..b5c565801f 100644--- a/Emby.Dlna/Didl/StringWriterWithEncoding.cs+++ b/Emby.Dlna/Didl/StringWriterWithEncoding.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.csindex d563b5addd..4b77f998d3 100644--- a/Emby.Dlna/PlayTo/PlayToController.cs+++ b/Emby.Dlna/PlayTo/PlayToController.cs@@ -13,7 +13,6 @@ using MediaBrowser.Model.System;using System;using System.Collections.Generic;using System.Globalization;-using System.Linq;using System.Threading;using System.Threading.Tasks;using MediaBrowser.Common.Configuration;@@ -49,7 +48,7 @@ namespace Emby.Dlna.PlayTo{get{- var lastDateKnownActivity = new[] { _creationTime, _device.DateLastActivity }.Max();+ var lastDateKnownActivity = _creationTime > _device.DateLastActivity ? _creationTime : _device.DateLastActivity;if (DateTime.UtcNow >= lastDateKnownActivity.AddSeconds(120)){@@ -565,7 +564,7 @@ namespace Emby.Dlna.PlayTostreamInfo.TargetVideoCodecTag,streamInfo.IsTargetAVC);- return list.FirstOrDefault();+ return list.Count == 0 ? null : list[0];}return null;diff --git a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs b/Emby.Dlna/Profiles/PanasonicVieraProfile.csindex 63c7e3a8e0..095788485b 100644--- a/Emby.Dlna/Profiles/PanasonicVieraProfile.cs+++ b/Emby.Dlna/Profiles/PanasonicVieraProfile.cs@@ -30,107 +30,6 @@ namespace Emby.Dlna.ProfilesTimelineOffsetSeconds = 10;- TranscodingProfiles = new[]- {- new TranscodingProfile- {- Container = "mp3",- AudioCodec = "mp3",- Type = DlnaProfileType.Audio- },- new TranscodingProfile- {- Container = "ts",- AudioCodec = "ac3",- VideoCodec = "h264",- Type = DlnaProfileType.Video- },- new TranscodingProfile- {- Container = "jpeg",- Type = DlnaProfileType.Photo- }- };-- DirectPlayProfiles = new[]- {- new DirectPlayProfile- {- Container = "mpeg,mpg",- VideoCodec = "mpeg2video,mpeg4",- AudioCodec = "ac3,mp3,pcm_dvd",- Type = DlnaProfileType.Video- },-- new DirectPlayProfile- {- Container = "mkv",- VideoCodec = "h264,mpeg2video",- AudioCodec = "aac,ac3,dca,mp3,mp2,pcm,dts",- Type = DlnaProfileType.Video- },-- new DirectPlayProfile- {- Container = "ts",- VideoCodec = "h264,mpeg2video",- AudioCodec = "aac,mp3,mp2",- Type = DlnaProfileType.Video- },-- new DirectPlayProfile- {- Container = "mp4,m4v",- VideoCodec = "h264",- AudioCodec = "aac,ac3,mp3,pcm",- Type = DlnaProfileType.Video- },-- new DirectPlayProfile- {- Container = "mov",- VideoCodec = "h264",- AudioCodec = "aac,pcm",- Type = DlnaProfileType.Video- },-- new DirectPlayProfile- {- Container = "avi",- VideoCodec = "mpeg4",- AudioCodec = "pcm",- Type = DlnaProfileType.Video- },-- new DirectPlayProfile- {- Container = "flv",- VideoCodec = "h264",- AudioCodec = "aac",- Type = DlnaProfileType.Video- },-- new DirectPlayProfile- {- Container = "mp3",- AudioCodec = "mp3",- Type = DlnaProfileType.Audio- },-- new DirectPlayProfile- {- Container = "mp4",- AudioCodec = "aac",- Type = DlnaProfileType.Audio- },-- new DirectPlayProfile- {- Container = "jpeg",- Type = DlnaProfileType.Photo- }- };-ContainerProfiles = new[]{new ContainerProfilediff --git a/Emby.Dlna/Ssdp/Extensions.cs b/Emby.Dlna/Ssdp/Extensions.csindex 611bf7e022..41a361515b 100644--- a/Emby.Dlna/Ssdp/Extensions.cs+++ b/Emby.Dlna/Ssdp/Extensions.cs@@ -1,5 +1,4 @@using System;-using System.Linq;using System.Net;using System.Threading.Tasks;using System.Xml.Linq;@@ -24,10 +23,12 @@ namespace Emby.Dlna.Ssdppublic static string GetDescendantValue(this XElement container, XName name){- var node = container.Descendants(name)- .FirstOrDefault();+ foreach (var node in container.Descendants(name))+ {+ return node.Value;+ }- return node == null ? null : node.Value;+ return null;}}}diff --git a/Emby.Drawing.ImageMagick/ImageHelpers.cs b/Emby.Drawing.ImageMagick/ImageHelpers.csindex c623c21aa2..8666933995 100644--- a/Emby.Drawing.ImageMagick/ImageHelpers.cs+++ b/Emby.Drawing.ImageMagick/ImageHelpers.cs@@ -6,13 +6,13 @@ namespace Emby.Drawing.ImageMagick{internal static class ImageHelpers{- internal static List<string> ProjectPaths(List<string> paths, int count)+ internal static List<string> ProjectPaths(string[] paths, int count){if (count <= 0){throw new ArgumentOutOfRangeException("count");}- if (paths.Count == 0)+ if (paths.Length == 0){throw new ArgumentOutOfRangeException("paths");}@@ -24,7 +24,7 @@ namespace Emby.Drawing.ImageMagickreturn list.Take(count).ToList();}- private static void AddToList(List<string> list, List<string> paths, int count)+ private static void AddToList(List<string> list, string[] paths, int count){while (list.Count < count){diff --git a/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs b/Emby.Drawing.ImageMagick/ImageMagickEncoder.csindex ea8687de01..9abf85e70f 100644--- a/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs+++ b/Emby.Drawing.ImageMagick/ImageMagickEncoder.cs@@ -7,7 +7,6 @@ using MediaBrowser.Model.Drawing;using MediaBrowser.Model.Logging;using System;using System.IO;-using System.Linq;using MediaBrowser.Model.IO;using MediaBrowser.Model.System;@@ -306,15 +305,15 @@ namespace Emby.Drawing.ImageMagickif (ratio >= 1.4){- new StripCollageBuilder(_appPaths, _fileSystem).BuildThumbCollage(options.InputPaths.ToList(), options.OutputPath, options.Width, options.Height);+ new StripCollageBuilder(_appPaths, _fileSystem).BuildThumbCollage(options.InputPaths, options.OutputPath, options.Width, options.Height);}else if (ratio >= .9){- new StripCollageBuilder(_appPaths, _fileSystem).BuildSquareCollage(options.InputPaths.ToList(), options.OutputPath, options.Width, options.Height);+ new StripCollageBuilder(_appPaths, _fileSystem).BuildSquareCollage(options.InputPaths, options.OutputPath, options.Width, options.Height);}else{- new StripCollageBuilder(_appPaths, _fileSystem).BuildPosterCollage(options.InputPaths.ToList(), options.OutputPath, options.Width, options.Height);+ new StripCollageBuilder(_appPaths, _fileSystem).BuildPosterCollage(options.InputPaths, options.OutputPath, options.Width, options.Height);}}diff --git a/Emby.Drawing.ImageMagick/StripCollageBuilder.cs b/Emby.Drawing.ImageMagick/StripCollageBuilder.csindex 63cf8fe5f9..26c6c868db 100644--- a/Emby.Drawing.ImageMagick/StripCollageBuilder.cs+++ b/Emby.Drawing.ImageMagick/StripCollageBuilder.cs@@ -19,7 +19,7 @@ namespace Emby.Drawing.ImageMagick_fileSystem = fileSystem;}- public void BuildPosterCollage(List<string> paths, string outputPath, int width, int height)+ public void BuildPosterCollage(string[] paths, string outputPath, int width, int height){using (var wand = BuildPosterCollageWand(paths, width, height)){@@ -27,7 +27,7 @@ namespace Emby.Drawing.ImageMagick}}- public void BuildSquareCollage(List<string> paths, string outputPath, int width, int height)+ public void BuildSquareCollage(string[] paths, string outputPath, int width, int height){using (var wand = BuildSquareCollageWand(paths, width, height)){@@ -35,7 +35,7 @@ namespace Emby.Drawing.ImageMagick}}- public void BuildThumbCollage(List<string> paths, string outputPath, int width, int height)+ public void BuildThumbCollage(string[] paths, string outputPath, int width, int height){using (var wand = BuildThumbCollageWand(paths, width, height)){@@ -43,7 +43,7 @@ namespace Emby.Drawing.ImageMagick}}- private MagickWand BuildPosterCollageWand(List<string> paths, int width, int height)+ private MagickWand BuildPosterCollageWand(string[] paths, int width, int height){var inputPaths = ImageHelpers.ProjectPaths(paths, 3);using (var wandImages = new MagickWand(inputPaths.ToArray()))@@ -108,7 +108,7 @@ namespace Emby.Drawing.ImageMagick}}- private MagickWand BuildThumbCollageWand(List<string> paths, int width, int height)+ private MagickWand BuildThumbCollageWand(string[] paths, int width, int height){var inputPaths = ImageHelpers.ProjectPaths(paths, 4);using (var wandImages = new MagickWand(inputPaths.ToArray()))@@ -173,7 +173,7 @@ namespace Emby.Drawing.ImageMagick}}- private MagickWand BuildSquareCollageWand(List<string> paths, int width, int height)+ private MagickWand BuildSquareCollageWand(string[] paths, int width, int height){var inputPaths = ImageHelpers.ProjectPaths(paths, 4);var outputWand = new MagickWand(width, height, new PixelWand("none", 1));diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.csindex bd23eba7aa..63fa5f1f5e 100644--- a/Emby.Drawing/ImageProcessor.cs+++ b/Emby.Drawing/ImageProcessor.cs@@ -44,7 +44,7 @@ namespace Emby.Drawing/// Image processors are specialized metadata providers that run after the normal ones/// </summary>/// <value>The image enhancers.</value>- public IEnumerable<IImageEnhancer> ImageEnhancers { get; private set; }+ public IImageEnhancer[] ImageEnhancers { get; private set; }/// <summary>/// The _logger@@ -71,7 +71,7 @@ namespace Emby.Drawing_libraryManager = libraryManager;_appPaths = appPaths;- ImageEnhancers = new List<IImageEnhancer>();+ ImageEnhancers = new IImageEnhancer[] {};_saveImageSizeTimer = timerFactory.Create(SaveImageSizeCallback, null, Timeout.Infinite, Timeout.Infinite);ImageHelper.ImageProcessor = this;@@ -618,7 +618,7 @@ namespace Emby.Drawingvar supportedEnhancers = GetSupportedEnhancers(item, image.Type);- return GetImageCacheTag(item, image, supportedEnhancers.ToList());+ return GetImageCacheTag(item, image, supportedEnhancers);}/// <summary>@@ -672,7 +672,7 @@ namespace Emby.Drawing/// <returns>Task{System.String}.</returns>public async Task<string> GetEnhancedImage(IHasMetadata item, ImageType imageType, int imageIndex){- var enhancers = GetSupportedEnhancers(item, imageType).ToList();+ var enhancers = GetSupportedEnhancers(item, imageType);var imageInfo = item.GetImageInfo(imageType, imageIndex);@@ -866,21 +866,25 @@ namespace Emby.Drawing_logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);}- public IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasMetadata item, ImageType imageType)+ public List<IImageEnhancer> GetSupportedEnhancers(IHasMetadata item, ImageType imageType){- return ImageEnhancers.Where(i =>+ var list = new List<IImageEnhancer>();++ foreach (var i in ImageEnhancers){try{- return i.Supports(item, imageType);+ if (i.Supports(item, imageType))+ {+ list.Add(i);+ }}catch (Exception ex){_logger.ErrorException("Error in image enhancer: {0}", ex, i.GetType().Name);-- return false;}- });+ }+ return list;}private bool _disposed;diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.csindex ea6c2aaf5f..6441fe4f2d 100644--- a/Emby.Server.Implementations/ApplicationHost.cs+++ b/Emby.Server.Implementations/ApplicationHost.cs@@ -861,7 +861,7 @@ namespace Emby.Server.ImplementationsSecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LogManager, FileSystemManager, CryptographyProvider);RegisterSingleInstance(SecurityManager);- InstallationManager = new InstallationManager(LogManager.GetLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ConfigurationManager, FileSystemManager, CryptographyProvider);+ InstallationManager = new InstallationManager(LogManager.GetLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ConfigurationManager, FileSystemManager, CryptographyProvider, PackageRuntime);RegisterSingleInstance(InstallationManager);ZipClient = new ZipClient(FileSystemManager);@@ -1048,6 +1048,14 @@ namespace Emby.Server.Implementationsawait ((UserManager)UserManager).Initialize().ConfigureAwait(false);}+ protected virtual string PackageRuntime+ {+ get+ {+ return "netframework";+ }+ }+public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, bool isStartup){logger.LogMultiline("Emby", LogSeverity.Info, GetBaseExceptionMessage(appPaths));diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.csindex 28a1503700..d8d69a62ed 100644--- a/Emby.Server.Implementations/Channels/ChannelManager.cs+++ b/Emby.Server.Implementations/Channels/ChannelManager.cs@@ -1330,7 +1330,7 @@ namespace Emby.Server.Implementations.Channelsvar hasArtists = item as IHasArtist;if (hasArtists != null){- hasArtists.Artists = info.Artists;+ hasArtists.Artists = info.Artists.ToArray();}var hasAlbumArtists = item as IHasAlbumArtist;diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex 064a66cd0a..423ad2782b 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -1028,9 +1028,9 @@ namespace Emby.Server.Implementations.Datavar hasArtists = item as IHasArtist;if (hasArtists != null){- if (hasArtists.Artists.Count > 0)+ if (hasArtists.Artists.Length > 0){- artists = string.Join("|", hasArtists.Artists.ToArray());+ artists = string.Join("|", hasArtists.Artists);}}saveItemStatement.TryBind("@Artists", artists);@@ -1908,7 +1908,7 @@ namespace Emby.Server.Implementations.Datavar hasArtists = item as IHasArtist;if (hasArtists != null && !reader.IsDBNull(index)){- hasArtists.Artists = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();+ hasArtists.Artists = reader.GetString(index).Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);}index++;diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.csindex 17e91bfa88..0282572708 100644--- a/Emby.Server.Implementations/Dto/DtoService.cs+++ b/Emby.Server.Implementations/Dto/DtoService.cs@@ -1617,7 +1617,7 @@ namespace Emby.Server.Implementations.Dtoreturn null;}- var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary).ToList();+ var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary);ImageSize size;diff --git a/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs b/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.csindex 6c7c1f052f..6a1f8ec6f2 100644--- a/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs+++ b/Emby.Server.Implementations/Library/Resolvers/SpecialFolderResolver.cs@@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Library.Resolversreturn new CollectionFolder{CollectionType = GetCollectionType(args),- PhysicalLocationsList = args.PhysicalLocations.ToList()+ PhysicalLocationsList = args.PhysicalLocations};}}diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.csindex f3d40ae19e..2e12f46bf9 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs@@ -607,20 +607,22 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVvar timer = _timerProvider.GetTimer(timerId);if (timer != null){+ timer.Status = RecordingStatus.Cancelled;+if (string.IsNullOrWhiteSpace(timer.SeriesTimerId) || isSeriesCancelled){_timerProvider.Delete(timer);}else{- timer.Status = RecordingStatus.Cancelled;_timerProvider.AddOrUpdate(timer, false);}}ActiveRecordingInfo activeRecordingInfo;if (_activeRecordings.TryGetValue(timerId, out activeRecordingInfo))- {+ {+ activeRecordingInfo.Timer = timer;activeRecordingInfo.CancellationTokenSource.Cancel();}}@@ -865,7 +867,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVpublic async Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken){return new List<RecordingInfo>();- //return _activeRecordings.Values.ToList().Select(GetRecordingInfo).ToList();}public string GetActiveRecordingPath(string id)@@ -881,7 +882,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVpublic IEnumerable<ActiveRecordingInfo> GetAllActiveRecordings(){- return _activeRecordings.Values;+ return _activeRecordings.Values.Where(i => i.Timer.Status == RecordingStatus.InProgress && !i.CancellationTokenSource.IsCancellationRequested);}public ActiveRecordingInfo GetActiveRecordingInfo(string path)@@ -893,59 +894,19 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVforeach (var recording in _activeRecordings.Values){- if (string.Equals(recording.Path, path, StringComparison.Ordinal))+ if (string.Equals(recording.Path, path, StringComparison.Ordinal) && !recording.CancellationTokenSource.IsCancellationRequested){+ var timer = recording.Timer;+ if (timer.Status != RecordingStatus.InProgress)+ {+ return null;+ }return recording;}}return null;}- private RecordingInfo GetRecordingInfo(ActiveRecordingInfo info)- {- var timer = info.Timer;- var program = info.Program;-- var result = new RecordingInfo- {- ChannelId = timer.ChannelId,- CommunityRating = timer.CommunityRating,- DateLastUpdated = DateTime.UtcNow,- EndDate = timer.EndDate,- EpisodeTitle = timer.EpisodeTitle,- Genres = timer.Genres,- Id = "recording" + timer.Id,- IsKids = timer.IsKids,- IsMovie = timer.IsMovie,- IsNews = timer.IsNews,- IsRepeat = timer.IsRepeat,- IsSeries = timer.IsProgramSeries,- IsSports = timer.IsSports,- Name = timer.Name,- OfficialRating = timer.OfficialRating,- OriginalAirDate = timer.OriginalAirDate,- Overview = timer.Overview,- ProgramId = timer.ProgramId,- SeriesTimerId = timer.SeriesTimerId,- StartDate = timer.StartDate,- Status = RecordingStatus.InProgress,- TimerId = timer.Id- };-- if (program != null)- {- result.Audio = program.Audio;- result.ImagePath = program.ImagePath;- result.ImageUrl = program.ImageUrl;- result.IsHD = program.IsHD;- result.IsLive = program.IsLive;- result.IsPremiere = program.IsPremiere;- result.ShowId = program.ShowId;- }-- return result;- }-public Task<IEnumerable<TimerInfo>> GetTimersAsync(CancellationToken cancellationToken){var excludeStatues = new List<RecordingStatus>diff --git a/Emby.Server.Implementations/Notifications/Notifications.cs b/Emby.Server.Implementations/Notifications/Notifications.csindex f95b3f701a..ac3cc75647 100644--- a/Emby.Server.Implementations/Notifications/Notifications.cs+++ b/Emby.Server.Implementations/Notifications/Notifications.cs@@ -422,7 +422,7 @@ namespace Emby.Server.Implementations.Notifications{var artists = hasArtist.AllArtists;- if (artists.Count > 0)+ if (artists.Length > 0){name = hasArtist.AllArtists[0] + " - " + name;}@@ -440,7 +440,7 @@ namespace Emby.Server.Implementations.Notificationsname = item.SeriesName + " - " + name;}- if (item.Artists != null && item.Artists.Count > 0)+ if (item.Artists != null && item.Artists.Length > 0){name = item.Artists[0] + " - " + name;}diff --git a/Emby.Server.Implementations/Services/ServiceHandler.cs b/Emby.Server.Implementations/Services/ServiceHandler.csindex 526e62d398..f9fcfdbabd 100644--- a/Emby.Server.Implementations/Services/ServiceHandler.cs+++ b/Emby.Server.Implementations/Services/ServiceHandler.cs@@ -215,13 +215,13 @@ namespace Emby.Server.Implementations.Servicesif (name == null) continue; //thank you ASP.NETvar values = request.QueryString.GetValues(name);- if (values.Length == 1)+ if (values.Count == 1){map[name] = values[0];}else{- for (var i = 0; i < values.Length; i++)+ for (var i = 0; i < values.Count; i++){map[name + (i == 0 ? "" : "#" + i)] = values[i];}@@ -235,13 +235,13 @@ namespace Emby.Server.Implementations.Servicesif (name == null) continue; //thank you ASP.NETvar values = request.FormData.GetValues(name);- if (values.Length == 1)+ if (values.Count == 1){map[name] = values[0];}else{- for (var i = 0; i < values.Length; i++)+ for (var i = 0; i < values.Count; i++){map[name + (i == 0 ? "" : "#" + i)] = values[i];}diff --git a/Emby.Server.Implementations/Sorting/ArtistComparer.cs b/Emby.Server.Implementations/Sorting/ArtistComparer.csindex edb195820f..616aff673d 100644--- a/Emby.Server.Implementations/Sorting/ArtistComparer.cs+++ b/Emby.Server.Implementations/Sorting/ArtistComparer.cs@@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.Sortingreturn string.Empty;}- return audio.Artists.Count == 0 ? null : audio.Artists[0];+ return audio.Artists.Length == 0 ? null : audio.Artists[0];}/// <summary>diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.csindex 393fb76e2f..75328a39a3 100644--- a/Emby.Server.Implementations/Updates/InstallationManager.cs+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs@@ -122,7 +122,10 @@ namespace Emby.Server.Implementations.Updatesprivate readonly ICryptoProvider _cryptographyProvider;- public InstallationManager(ILogger logger, IApplicationHost appHost, IApplicationPaths appPaths, IHttpClient httpClient, IJsonSerializer jsonSerializer, ISecurityManager securityManager, IConfigurationManager config, IFileSystem fileSystem, ICryptoProvider cryptographyProvider)+ // netframework or netcore+ private readonly string _packageRuntime;++ public InstallationManager(ILogger logger, IApplicationHost appHost, IApplicationPaths appPaths, IHttpClient httpClient, IJsonSerializer jsonSerializer, ISecurityManager securityManager, IConfigurationManager config, IFileSystem fileSystem, ICryptoProvider cryptographyProvider, string packageRuntime){if (logger == null){@@ -140,6 +143,7 @@ namespace Emby.Server.Implementations.Updates_config = config;_fileSystem = fileSystem;_cryptographyProvider = cryptographyProvider;+ _packageRuntime = packageRuntime;_logger = logger;}@@ -157,7 +161,7 @@ namespace Emby.Server.Implementations.Updates/// Gets all available packages./// </summary>/// <returns>Task{List{PackageInfo}}.</returns>- public async Task<PackageInfo[]> GetAvailablePackages(CancellationToken cancellationToken,+ public async Task<List<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,bool withRegistration = true,string packageType = null,Version applicationVersion = null)@@ -171,7 +175,7 @@ namespace Emby.Server.Implementations.Updates{ "systemid", _applicationHost.SystemId }};- using (var json = await _httpClient.Post("https://www.mb3admin.com/admin/service/package/retrieveall", data, cancellationToken).ConfigureAwait(false))+ using (var json = await _httpClient.Post("https://www.mb3admin.com/admin/service/package/retrieveall?includeAllRuntimes=true", data, cancellationToken).ConfigureAwait(false)){cancellationToken.ThrowIfCancellationRequested();@@ -195,7 +199,7 @@ namespace Emby.Server.Implementations.Updates/// </summary>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task{List{PackageInfo}}.</returns>- public async Task<PackageInfo[]> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken)+ public async Task<List<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken){_logger.Info("Opening {0}", PackageCachePath);try@@ -209,7 +213,7 @@ namespace Emby.Server.Implementations.UpdatesUpdateCachedPackages(CancellationToken.None, false);}- return packages;+ return FilterPackages(packages);}}catch (Exception)@@ -221,7 +225,7 @@ namespace Emby.Server.Implementations.Updatesawait UpdateCachedPackages(cancellationToken, true).ConfigureAwait(false);using (var stream = _fileSystem.OpenRead(PackageCachePath)){- return _jsonSerializer.DeserializeFromStream<PackageInfo[]>(stream);+ return FilterPackages(_jsonSerializer.DeserializeFromStream<PackageInfo[]>(stream));}}@@ -244,7 +248,7 @@ namespace Emby.Server.Implementations.Updatesvar tempFile = await _httpClient.GetTempFile(new HttpRequestOptions{- Url = "https://www.mb3admin.com/admin/service/MB3Packages.json",+ Url = "https://www.mb3admin.com/admin/service/EmbyPackages.json",CancellationToken = cancellationToken,Progress = new SimpleProgress<Double>()@@ -280,47 +284,74 @@ namespace Emby.Server.Implementations.Updatesreturn TimeSpan.FromMinutes(3);}- protected PackageInfo[] FilterPackages(List<PackageInfo> packages)+ protected List<PackageInfo> FilterPackages(IEnumerable<PackageInfo> packages){+ var list = new List<PackageInfo>();foreach (var package in packages){- package.versions = package.versions.Where(v => !string.IsNullOrWhiteSpace(v.sourceUrl))- .OrderByDescending(GetPackageVersion).ToArray();+ var versions = new List<PackageVersionInfo>();+ foreach (var version in package.versions)+ {+ if (string.IsNullOrWhiteSpace(version.sourceUrl))+ {+ continue;+ }++ if (string.IsNullOrWhiteSpace(version.runtimes) || version.runtimes.IndexOf(_packageRuntime, StringComparison.OrdinalIgnoreCase) == -1)+ {+ continue;+ }++ versions.Add(version);+ }++ package.versions = versions+ .OrderByDescending(GetPackageVersion)+ .ToArray();++ if (package.versions.Length == 0)+ {+ continue;+ }++ list.Add(package);}// Remove packages with no versions- return packages.Where(p => p.versions.Any()).ToArray();+ return list;}- protected PackageInfo[] FilterPackages(PackageInfo[] packages, string packageType, Version applicationVersion)+ protected List<PackageInfo> FilterPackages(IEnumerable<PackageInfo> packages, string packageType, Version applicationVersion){- foreach (var package in packages)- {- package.versions = package.versions.Where(v => !string.IsNullOrWhiteSpace(v.sourceUrl))- .OrderByDescending(GetPackageVersion).ToArray();- }+ var packagesList = FilterPackages(packages);- IEnumerable<PackageInfo> packagesList = packages;+ var returnList = new List<PackageInfo>();- if (!string.IsNullOrWhiteSpace(packageType))- {- packagesList = packagesList.Where(p => string.Equals(p.type, packageType, StringComparison.OrdinalIgnoreCase));- }+ var filterOnPackageType = !string.IsNullOrWhiteSpace(packageType);- // If an app version was supplied, filter the versions for each package to only include supported versions- if (applicationVersion != null)+ foreach (var p in packagesList){- foreach (var package in packages)+ if (filterOnPackageType && !string.Equals(p.type, packageType, StringComparison.OrdinalIgnoreCase)){- package.versions = package.versions.Where(v => IsPackageVersionUpToDate(v, applicationVersion)).ToArray();+ continue;}- }- // Remove packages with no versions- packagesList = packagesList.Where(p => p.versions.Any());+ // If an app version was supplied, filter the versions for each package to only include supported versions+ if (applicationVersion != null)+ {+ p.versions = p.versions.Where(v => IsPackageVersionUpToDate(v, applicationVersion)).ToArray();+ }++ if (p.versions.Length == 0)+ {+ continue;+ }++ returnList.Add(p);+ }- return packagesList.ToArray();+ return returnList;}/// <summary>diff --git a/MediaBrowser.Api/ChannelService.cs b/MediaBrowser.Api/ChannelService.csindex c7ceb41bcb..35ac2b4828 100644--- a/MediaBrowser.Api/ChannelService.cs+++ b/MediaBrowser.Api/ChannelService.cs@@ -231,7 +231,7 @@ namespace MediaBrowser.ApiSortOrder = request.SortOrder,SortBy = (request.SortBy ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToArray(),Filters = request.GetFilters().ToArray(),- Fields = request.GetItemFields().ToArray()+ Fields = request.GetItemFields()}, CancellationToken.None).ConfigureAwait(false);diff --git a/MediaBrowser.Api/ConfigurationService.cs b/MediaBrowser.Api/ConfigurationService.csindex 92128634e3..643ecd9c86 100644--- a/MediaBrowser.Api/ConfigurationService.cs+++ b/MediaBrowser.Api/ConfigurationService.cs@@ -6,7 +6,6 @@ using MediaBrowser.Model.Configuration;using MediaBrowser.Model.Serialization;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Threading.Tasks;using MediaBrowser.Controller.IO;diff --git a/MediaBrowser.Api/Devices/DeviceService.cs b/MediaBrowser.Api/Devices/DeviceService.csindex 544960f5f5..012f0ddb27 100644--- a/MediaBrowser.Api/Devices/DeviceService.cs+++ b/MediaBrowser.Api/Devices/DeviceService.cs@@ -1,5 +1,4 @@using System;-using System.Linq;using MediaBrowser.Controller.Devices;using MediaBrowser.Controller.Net;using MediaBrowser.Model.Devices;@@ -143,7 +142,7 @@ namespace MediaBrowser.Api.Devices}else{- var file = Request.Files.First();+ var file = Request.Files.Length == 0 ? null : Request.Files[0];var task = _deviceManager.AcceptCameraUpload(deviceId, file.InputStream, new LocalFileInfo{diff --git a/MediaBrowser.Api/Dlna/DlnaServerService.cs b/MediaBrowser.Api/Dlna/DlnaServerService.csindex fc8c0edf6b..389244aa96 100644--- a/MediaBrowser.Api/Dlna/DlnaServerService.cs+++ b/MediaBrowser.Api/Dlna/DlnaServerService.cs@@ -3,7 +3,6 @@ using System;using System.Collections.Generic;using System.Globalization;using System.IO;-using System.Linq;using System.Threading.Tasks;using MediaBrowser.Controller.IO;diff --git a/MediaBrowser.Api/Dlna/DlnaService.cs b/MediaBrowser.Api/Dlna/DlnaService.csindex fa3287ebdd..4dd71f4463 100644--- a/MediaBrowser.Api/Dlna/DlnaService.cs+++ b/MediaBrowser.Api/Dlna/DlnaService.cs@@ -1,7 +1,7 @@-using MediaBrowser.Controller.Dlna;+using System.Linq;+using MediaBrowser.Controller.Dlna;using MediaBrowser.Controller.Net;using MediaBrowser.Model.Dlna;-using System.Linq;using MediaBrowser.Model.Services;namespace MediaBrowser.Api.Dlnadiff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.csindex 318360336a..309c7195ba 100644--- a/MediaBrowser.Api/Images/ImageService.cs+++ b/MediaBrowser.Api/Images/ImageService.cs@@ -556,20 +556,7 @@ namespace MediaBrowser.Api.Imagesthrow new ResourceNotFoundException(string.Format("{0} does not have an image of type {1}", item.Name, request.Type));}- var supportedImageEnhancers = request.EnableImageEnhancers ? _imageProcessor.ImageEnhancers.Where(i =>- {- try- {- return i.Supports(item, request.Type);- }- catch (Exception ex)- {- Logger.ErrorException("Error in image enhancer: {0}", ex, i.GetType().Name);-- return false;- }-- }).ToList() : new List<IImageEnhancer>();+ var supportedImageEnhancers = request.EnableImageEnhancers ? _imageProcessor.GetSupportedEnhancers(item, request.Type) : new List<IImageEnhancer>();var cropwhitespace = request.Type == ImageType.Logo ||request.Type == ImageType.Artdiff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.csindex 56caf884bb..47bd46ea5d 100644--- a/MediaBrowser.Api/ItemUpdateService.cs+++ b/MediaBrowser.Api/ItemUpdateService.cs@@ -352,7 +352,7 @@ namespace MediaBrowser.ApihasArtists.Artists = request.ArtistItems.Select(i => i.Name)- .ToList();+ .ToArray();}}diff --git a/MediaBrowser.Api/LocalizationService.cs b/MediaBrowser.Api/LocalizationService.csindex 2c92505b17..56d32fc374 100644--- a/MediaBrowser.Api/LocalizationService.cs+++ b/MediaBrowser.Api/LocalizationService.cs@@ -2,7 +2,6 @@using MediaBrowser.Model.Entities;using MediaBrowser.Model.Globalization;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.Services;namespace MediaBrowser.Apidiff --git a/MediaBrowser.Api/Movies/CollectionService.cs b/MediaBrowser.Api/Movies/CollectionService.csindex 6511d31279..c63712f4cc 100644--- a/MediaBrowser.Api/Movies/CollectionService.cs+++ b/MediaBrowser.Api/Movies/CollectionService.cs@@ -4,7 +4,6 @@ using MediaBrowser.Controller.Net;using MediaBrowser.Model.Collections;using System;using System.Collections.Generic;-using System.Linq;using System.Threading.Tasks;using MediaBrowser.Model.Services;diff --git a/MediaBrowser.Api/Movies/MoviesService.cs b/MediaBrowser.Api/Movies/MoviesService.csindex 7873c1cd38..3e42026b14 100644--- a/MediaBrowser.Api/Movies/MoviesService.cs+++ b/MediaBrowser.Api/Movies/MoviesService.cs@@ -426,7 +426,7 @@ namespace MediaBrowser.Api.Movies{var people = _libraryManager.GetPeople(new InternalPeopleQuery{- PersonTypes = new List<string>+ PersonTypes = new string[]{PersonType.Director}diff --git a/MediaBrowser.Api/PlaylistService.cs b/MediaBrowser.Api/PlaylistService.csindex 07a976f396..54c995d3d1 100644--- a/MediaBrowser.Api/PlaylistService.cs+++ b/MediaBrowser.Api/PlaylistService.cs@@ -1,11 +1,11 @@-using MediaBrowser.Controller.Dto;+using System.Linq;+using MediaBrowser.Controller.Dto;using MediaBrowser.Controller.Library;using MediaBrowser.Controller.Net;using MediaBrowser.Controller.Playlists;using MediaBrowser.Model.Dto;using MediaBrowser.Model.Playlists;using MediaBrowser.Model.Querying;-using System.Linq;using System.Threading.Tasks;using MediaBrowser.Model.Services;using MediaBrowser.Model.Extensions;diff --git a/MediaBrowser.Api/Reports/Data/ReportBuilder.cs b/MediaBrowser.Api/Reports/Data/ReportBuilder.csindex 6b10fcb05d..6a1502c7e6 100644--- a/MediaBrowser.Api/Reports/Data/ReportBuilder.cs+++ b/MediaBrowser.Api/Reports/Data/ReportBuilder.cs@@ -533,7 +533,7 @@ namespace MediaBrowser.Api.Reportsbreak;case HeaderMetadata.Tracks:- option.Column = (i, r) => this.GetObject<MusicAlbum, List<Audio>>(i, (x) => x.Tracks.ToList(), new List<Audio>()).Count();+ option.Column = (i, r) => this.GetObject<MusicAlbum, List<Audio>>(i, (x) => x.Tracks.Cast<Audio>().ToList(), new List<Audio>()).Count();break;case HeaderMetadata.Audio:diff --git a/MediaBrowser.Api/SearchService.cs b/MediaBrowser.Api/SearchService.csindex 77e29d6cc5..ad79ea57b9 100644--- a/MediaBrowser.Api/SearchService.cs+++ b/MediaBrowser.Api/SearchService.cs@@ -1,4 +1,5 @@-using MediaBrowser.Controller.Drawing;+using System.Linq;+using MediaBrowser.Controller.Drawing;using MediaBrowser.Controller.Dto;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Entities.Audio;@@ -7,7 +8,6 @@ using MediaBrowser.Controller.Library;using MediaBrowser.Controller.Net;using MediaBrowser.Model.Entities;using MediaBrowser.Model.Search;-using System.Linq;using System.Threading.Tasks;using MediaBrowser.Controller.LiveTv;using MediaBrowser.Model.Services;@@ -240,7 +240,7 @@ namespace MediaBrowser.Apiif (album != null){- result.Artists = album.Artists.ToArray();+ result.Artists = album.Artists;result.AlbumArtist = album.AlbumArtist;}@@ -250,7 +250,7 @@ namespace MediaBrowser.Api{result.Album = song.Album;result.AlbumArtist = song.AlbumArtists.FirstOrDefault();- result.Artists = song.Artists.ToArray();+ result.Artists = song.Artists;}if (!string.IsNullOrWhiteSpace(item.ChannelId))diff --git a/MediaBrowser.Api/SuggestionsService.cs b/MediaBrowser.Api/SuggestionsService.csindex 22432bf518..931772e6ae 100644--- a/MediaBrowser.Api/SuggestionsService.cs+++ b/MediaBrowser.Api/SuggestionsService.cs@@ -5,7 +5,6 @@ using MediaBrowser.Model.Dto;using MediaBrowser.Model.Querying;using MediaBrowser.Model.Services;using System;-using System.Linq;using System.Threading.Tasks;using MediaBrowser.Controller.Library;using MediaBrowser.Model.Extensions;diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.csindex cd0c5d9e51..4b1e69c5d1 100644--- a/MediaBrowser.Api/TvShowsService.cs+++ b/MediaBrowser.Api/TvShowsService.cs@@ -14,7 +14,6 @@ using System.Linq;using System.Threading.Tasks;using MediaBrowser.Model.Dto;using MediaBrowser.Model.Services;-using MediaBrowser.Model.Extensions;namespace MediaBrowser.Api{diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.csindex 7c1519e9fd..4018759d99 100644--- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs+++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs@@ -132,7 +132,7 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>- protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)+ protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items){throw new NotImplementedException();}diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.csindex 1d0065c7cf..fca842289b 100644--- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs+++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs@@ -257,7 +257,7 @@ namespace MediaBrowser.Api.UserLibraryparentItem = string.IsNullOrEmpty(request.ParentId) ? LibraryManager.RootFolder : LibraryManager.GetItemById(request.ParentId);}- IEnumerable<BaseItem> items;+ IList<BaseItem> items;var excludeItemTypes = request.GetExcludeItemTypes();var includeItemTypes = request.GetIncludeItemTypes();@@ -280,19 +280,19 @@ namespace MediaBrowser.Api.UserLibraryif (!string.IsNullOrWhiteSpace(request.UserId)){items = request.Recursive ?- folder.GetRecursiveChildren(user, query) :- folder.GetChildren(user, true).Where(filter);+ folder.GetRecursiveChildren(user, query).ToList() :+ folder.GetChildren(user, true).Where(filter).ToList();}else{items = request.Recursive ?folder.GetRecursiveChildren(filter) :- folder.Children.Where(filter);+ folder.Children.Where(filter).ToList();}}else{- items = new[] { parentItem }.Where(filter);+ items = new[] { parentItem }.Where(filter).ToList();}var extractedItems = GetAllItems(request, items);@@ -500,7 +500,7 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Task{`0}}.</returns>- protected abstract IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items);+ protected abstract IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items);}/// <summary>diff --git a/MediaBrowser.Api/UserLibrary/GameGenresService.cs b/MediaBrowser.Api/UserLibrary/GameGenresService.csindex 56730c1b20..0b2ca4daf9 100644--- a/MediaBrowser.Api/UserLibrary/GameGenresService.cs+++ b/MediaBrowser.Api/UserLibrary/GameGenresService.cs@@ -93,7 +93,7 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>- protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)+ protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items){throw new NotImplementedException();}diff --git a/MediaBrowser.Api/UserLibrary/GenresService.cs b/MediaBrowser.Api/UserLibrary/GenresService.csindex fc387e5e39..d913f52d96 100644--- a/MediaBrowser.Api/UserLibrary/GenresService.cs+++ b/MediaBrowser.Api/UserLibrary/GenresService.cs@@ -115,7 +115,7 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>- protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)+ protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items){throw new NotImplementedException();}diff --git a/MediaBrowser.Api/UserLibrary/MusicGenresService.cs b/MediaBrowser.Api/UserLibrary/MusicGenresService.csindex d1d4aa634b..36dc773d4d 100644--- a/MediaBrowser.Api/UserLibrary/MusicGenresService.cs+++ b/MediaBrowser.Api/UserLibrary/MusicGenresService.cs@@ -94,7 +94,7 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>- protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)+ protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items){throw new NotImplementedException();}diff --git a/MediaBrowser.Api/UserLibrary/PersonsService.cs b/MediaBrowser.Api/UserLibrary/PersonsService.csindex 21f416025e..9417447d84 100644--- a/MediaBrowser.Api/UserLibrary/PersonsService.cs+++ b/MediaBrowser.Api/UserLibrary/PersonsService.cs@@ -96,15 +96,13 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>- protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)+ protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items){var inputPersonTypes = ((GetPersons)request).PersonTypes;var personTypes = string.IsNullOrEmpty(inputPersonTypes) ? new string[] { } : inputPersonTypes.Split(',');- var itemsList = items.ToList();-// Either get all people, or all people filtered by a specific person type- var allPeople = GetAllPeople(itemsList, personTypes);+ var allPeople = GetAllPeople(items, personTypes);return allPeople.Select(i => i.Name)@@ -132,13 +130,13 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="itemsList">The items list.</param>/// <param name="personTypes">The person types.</param>/// <returns>IEnumerable{PersonInfo}.</returns>- private IEnumerable<PersonInfo> GetAllPeople(IEnumerable<BaseItem> itemsList, IEnumerable<string> personTypes)+ private IEnumerable<PersonInfo> GetAllPeople(IList<BaseItem> itemsList, string[] personTypes){- var allIds = itemsList.Select(i => i.Id).ToList();+ var allIds = itemsList.Select(i => i.Id).ToArray();var allPeople = LibraryManager.GetPeople(new InternalPeopleQuery{- PersonTypes = personTypes.ToList()+ PersonTypes = personTypes});return allPeople.Where(i => allIds.Contains(i.ItemId)).OrderBy(p => p.SortOrder ?? int.MaxValue).ThenBy(p => p.Type);diff --git a/MediaBrowser.Api/UserLibrary/StudiosService.cs b/MediaBrowser.Api/UserLibrary/StudiosService.csindex 7ac1264e8f..f10cccbb13 100644--- a/MediaBrowser.Api/UserLibrary/StudiosService.cs+++ b/MediaBrowser.Api/UserLibrary/StudiosService.cs@@ -103,11 +103,9 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>- protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)+ protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items){- var itemsList = items.Where(i => i.Studios != null).ToList();-- return itemsList+ return items.SelectMany(i => i.Studios).DistinctNames().Select(name => LibraryManager.GetStudio(name));diff --git a/MediaBrowser.Api/UserLibrary/YearsService.cs b/MediaBrowser.Api/UserLibrary/YearsService.csindex 1059b72cb8..db622a9b34 100644--- a/MediaBrowser.Api/UserLibrary/YearsService.cs+++ b/MediaBrowser.Api/UserLibrary/YearsService.cs@@ -96,11 +96,9 @@ namespace MediaBrowser.Api.UserLibrary/// <param name="request">The request.</param>/// <param name="items">The items.</param>/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>- protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)+ protected override IEnumerable<BaseItem> GetAllItems(GetItemsByName request, IList<BaseItem> items){- var itemsList = items.Where(i => i.ProductionYear != null).ToList();-- return itemsList+ return items.Select(i => i.ProductionYear ?? 0).Where(i => i > 0).Distinct()diff --git a/MediaBrowser.Api/VideosService.cs b/MediaBrowser.Api/VideosService.csindex dc7d098634..3bd0497f7e 100644--- a/MediaBrowser.Api/VideosService.cs+++ b/MediaBrowser.Api/VideosService.cs@@ -140,7 +140,6 @@ namespace MediaBrowser.Apipublic async Task PostAsync(MergeVersions request){var items = request.Ids.Split(',')- .Select(i => new Guid(i)).Select(i => _libraryManager.GetItemById(i)).OfType<Video>().ToList();diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.csindex ecc2726055..dab38b27c2 100644--- a/MediaBrowser.Common/Updates/IInstallationManager.cs+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs@@ -48,7 +48,7 @@ namespace MediaBrowser.Common.Updates/// <param name="packageType">Type of the package.</param>/// <param name="applicationVersion">The application version.</param>/// <returns>Task{List{PackageInfo}}.</returns>- Task<PackageInfo[]> GetAvailablePackages(CancellationToken cancellationToken,+ Task<List<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,bool withRegistration = true,string packageType = null,Version applicationVersion = null);@@ -58,7 +58,7 @@ namespace MediaBrowser.Common.Updates/// </summary>/// <param name="cancellationToken">The cancellation token.</param>/// <returns>Task{List{PackageInfo}}.</returns>- Task<PackageInfo[]> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken);+ Task<List<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken);/// <summary>/// Gets the package.diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.csindex 29363f4927..113f823f5f 100644--- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs+++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs@@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.Drawing/// Gets the image enhancers./// </summary>/// <value>The image enhancers.</value>- IEnumerable<IImageEnhancer> ImageEnhancers { get; }+ IImageEnhancer[] ImageEnhancers { get; }/// <summary>/// Gets the size of the image.@@ -54,7 +54,7 @@ namespace MediaBrowser.Controller.Drawing/// <param name="item">The item.</param>/// <param name="imageType">Type of the image.</param>/// <returns>IEnumerable{IImageEnhancer}.</returns>- IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasMetadata item, ImageType imageType);+ List<IImageEnhancer> GetSupportedEnhancers(IHasMetadata item, ImageType imageType);/// <summary>/// Gets the image cache tag.diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.csindex db84d6e2f9..2105ef9079 100644--- a/MediaBrowser.Controller/Entities/AggregateFolder.cs+++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs@@ -20,7 +20,7 @@ namespace MediaBrowser.Controller.Entities{public AggregateFolder(){- PhysicalLocationsList = new List<string>();+ PhysicalLocationsList = EmptyStringArray;}[IgnoreDataMember]@@ -58,7 +58,7 @@ namespace MediaBrowser.Controller.Entities}[IgnoreDataMember]- public override IEnumerable<string> PhysicalLocations+ public override string[] PhysicalLocations{get{@@ -66,23 +66,23 @@ namespace MediaBrowser.Controller.Entities}}- public List<string> PhysicalLocationsList { get; set; }+ public string[] PhysicalLocationsList { get; set; }protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService){- return CreateResolveArgs(directoryService, true).FileSystemChildren.ToArray();+ return CreateResolveArgs(directoryService, true).FileSystemChildren;}- private List<Guid> _childrenIds = null;+ private Guid[] _childrenIds = null;private readonly object _childIdsLock = new object();protected override List<BaseItem> LoadChildren(){lock (_childIdsLock){- if (_childrenIds == null || _childrenIds.Count == 0)+ if (_childrenIds == null || _childrenIds.Length == 0){- var list = base.LoadChildren().ToList();- _childrenIds = list.Select(i => i.Id).ToList();+ var list = base.LoadChildren();+ _childrenIds = list.Select(i => i.Id).ToArray();return list;}@@ -105,9 +105,9 @@ namespace MediaBrowser.Controller.Entitiesif (!changed){- var locations = PhysicalLocations.ToList();+ var locations = PhysicalLocations;- var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations.ToList();+ var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations;if (!locations.SequenceEqual(newLocations)){@@ -163,7 +163,7 @@ namespace MediaBrowser.Controller.Entities_requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations);if (setPhysicalLocations){- PhysicalLocationsList = args.PhysicalLocations.ToList();+ PhysicalLocationsList = args.PhysicalLocations;}return args;@@ -212,7 +212,14 @@ namespace MediaBrowser.Controller.Entitiesthrow new ArgumentNullException("id");}- return _virtualChildren.FirstOrDefault(i => i.Id == id);+ foreach (var child in _virtualChildren)+ {+ if (child.Id == id)+ {+ return child;+ }+ }+ return null;}}}diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.csindex 0781dc35b0..e029a447eb 100644--- a/MediaBrowser.Controller/Entities/Audio/Audio.cs+++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs@@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.Entities.Audio/// </summary>/// <value>The artist.</value>[IgnoreDataMember]- public List<string> Artists { get; set; }+ public string[] Artists { get; set; }[IgnoreDataMember]public string[] AlbumArtists { get; set; }@@ -42,7 +42,7 @@ namespace MediaBrowser.Controller.Entities.Audiopublic Audio(){- Artists = new List<string>();+ Artists = EmptyStringArray;AlbumArtists = EmptyStringArray;}@@ -98,13 +98,23 @@ namespace MediaBrowser.Controller.Entities.Audio}[IgnoreDataMember]- public List<string> AllArtists+ public string[] AllArtists{get{- var list = AlbumArtists.ToList();+ var list = new string[AlbumArtists.Length + Artists.Length];- list.AddRange(Artists);+ var index = 0;+ foreach (var artist in AlbumArtists)+ {+ list[index] = artist;+ index++;+ }+ foreach (var artist in AlbumArtists)+ {+ list[index] = artist;+ index++;+ }return list;@@ -160,7 +170,7 @@ namespace MediaBrowser.Controller.Entities.AudiosongKey = Album + "-" + songKey;}- var albumArtist = AlbumArtists.FirstOrDefault();+ var albumArtist = AlbumArtists.Length == 0 ? null : AlbumArtists[0];if (!string.IsNullOrWhiteSpace(albumArtist)){songKey = albumArtist + "-" + songKey;diff --git a/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs b/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.csindex 6900699e59..b2dedada47 100644--- a/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs+++ b/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs@@ -1,6 +1,4 @@-using MediaBrowser.Controller.Library;-using System.Collections.Generic;-+namespace MediaBrowser.Controller.Entities.Audio{public interface IHasAlbumArtist@@ -10,16 +8,8 @@ namespace MediaBrowser.Controller.Entities.Audiopublic interface IHasArtist{- List<string> AllArtists { get; }-- List<string> Artists { get; set; }- }+ string[] AllArtists { get; }- public static class HasArtistExtensions- {- public static bool HasAnyArtist(this IHasArtist hasArtist, string artist)- {- return NameExtensions.EqualsAny(hasArtist.AllArtists, artist);- }+ string[] Artists { get; set; }}}diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.csindex c35e818265..82f880b3f5 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs@@ -10,7 +10,6 @@ using System.Threading;using System.Threading.Tasks;using MediaBrowser.Controller.Dto;using MediaBrowser.Controller.Library;-using MediaBrowser.Model.Dto;namespace MediaBrowser.Controller.Entities.Audio{@@ -20,11 +19,11 @@ namespace MediaBrowser.Controller.Entities.Audiopublic class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo>, IMetadataContainer{public string[] AlbumArtists { get; set; }- public List<string> Artists { get; set; }+ public string[] Artists { get; set; }public MusicAlbum(){- Artists = new List<string>();+ Artists = EmptyStringArray;AlbumArtists = EmptyStringArray;}@@ -48,17 +47,22 @@ namespace MediaBrowser.Controller.Entities.Audiopublic MusicArtist GetMusicArtist(DtoOptions options){- var artist = GetParents().OfType<MusicArtist>().FirstOrDefault();-- if (artist == null)+ var parents = GetParents();+ foreach (var parent in parents){- var name = AlbumArtist;- if (!string.IsNullOrWhiteSpace(name))+ var artist = parent as MusicArtist;+ if (artist != null){- artist = LibraryManager.GetArtist(name, options);+ return artist;}}- return artist;++ var name = AlbumArtist;+ if (!string.IsNullOrWhiteSpace(name))+ {+ return LibraryManager.GetArtist(name, options);+ }+ return null;}[IgnoreDataMember]@@ -80,23 +84,32 @@ namespace MediaBrowser.Controller.Entities.Audio}[IgnoreDataMember]- public List<string> AllArtists+ public string[] AllArtists{get{- var list = AlbumArtists.ToList();+ var list = new string[AlbumArtists.Length + Artists.Length];- list.AddRange(Artists);+ var index = 0;+ foreach (var artist in AlbumArtists)+ {+ list[index] = artist;+ index++;+ }+ foreach (var artist in AlbumArtists)+ {+ list[index] = artist;+ index++;+ }return list;-}}[IgnoreDataMember]public string AlbumArtist{- get { return AlbumArtists.FirstOrDefault(); }+ get { return AlbumArtists.Length == 0 ? null : AlbumArtists[0]; }}[IgnoreDataMember]@@ -110,11 +123,11 @@ namespace MediaBrowser.Controller.Entities.Audio/// </summary>/// <value>The tracks.</value>[IgnoreDataMember]- public IEnumerable<Audio> Tracks+ public IEnumerable<BaseItem> Tracks{get{- return GetRecursiveChildren(i => i is Audio).Cast<Audio>();+ return GetRecursiveChildren(i => i is Audio);}}@@ -200,7 +213,7 @@ namespace MediaBrowser.Controller.Entities.Audiopublic async Task RefreshAllMetadata(MetadataRefreshOptions refreshOptions, IProgress<double> progress, CancellationToken cancellationToken){- var items = GetRecursiveChildren().ToList();+ var items = GetRecursiveChildren();var totalItems = items.Count;var numComplete = 0;@@ -239,27 +252,22 @@ namespace MediaBrowser.Controller.Entities.Audioprivate async Task RefreshArtists(MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken){- var artists = AllArtists.Select(i =>+ var all = AllArtists;+ foreach (var i in all){// This should not be necessary but we're seeing some cases of itif (string.IsNullOrWhiteSpace(i)){- return null;+ continue;}var artist = LibraryManager.GetArtist(i);if (!artist.IsAccessedByName){- return null;+ continue;}- return artist;-- }).Where(i => i != null).ToList();-- foreach (var artist in artists)- {await artist.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);}}diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.csindex 559806ac4a..19fe68e25f 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs@@ -214,18 +214,19 @@ namespace MediaBrowser.Controller.Entities.Audio{var items = GetRecursiveChildren();- var songs = items.OfType<Audio>().ToList();-- var others = items.Except(songs).ToList();-- var totalItems = songs.Count + others.Count;+ var totalItems = items.Count;var numComplete = 0;var childUpdateType = ItemUpdateType.None;// Refresh songs- foreach (var item in songs)+ foreach (var item in items){+ if (!(item is Audio))+ {+ continue;+ }+cancellationToken.ThrowIfCancellationRequested();var updateType = await item.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);@@ -248,8 +249,13 @@ namespace MediaBrowser.Controller.Entities.Audioawait RefreshMetadata(parentRefreshOptions, cancellationToken).ConfigureAwait(false);// Refresh all non-songs- foreach (var item in others)+ foreach (var item in items){+ if (item is Audio)+ {+ continue;+ }+cancellationToken.ThrowIfCancellationRequested();var updateType = await item.RefreshMetadata(parentRefreshOptions, cancellationToken).ConfigureAwait(false);diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.csindex d4a85b4d07..02e6520488 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.Serialization;using MediaBrowser.Common.Extensions;using MediaBrowser.Controller.Extensions;diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex c158378a67..24fa80ef6e 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -570,7 +570,7 @@ namespace MediaBrowser.Controller.Entities}[IgnoreDataMember]- public virtual IEnumerable<string> PhysicalLocations+ public virtual string[] PhysicalLocations{get{diff --git a/MediaBrowser.Controller/Entities/Book.cs b/MediaBrowser.Controller/Entities/Book.csindex 7cb2425899..9b1a52f836 100644--- a/MediaBrowser.Controller/Entities/Book.cs+++ b/MediaBrowser.Controller/Entities/Book.cs@@ -1,7 +1,7 @@using System;+using System.Linq;using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Configuration;-using System.Linq;using MediaBrowser.Model.Serialization;using MediaBrowser.Model.Entities;diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.csindex 3e2c501b44..537beb26b6 100644--- a/MediaBrowser.Controller/Entities/CollectionFolder.cs+++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs@@ -27,8 +27,8 @@ namespace MediaBrowser.Controller.Entitiespublic CollectionFolder(){- PhysicalLocationsList = new List<string>();- PhysicalFolderIds = new List<Guid>();+ PhysicalLocationsList = EmptyStringArray;+ PhysicalFolderIds = EmptyGuidArray;}[IgnoreDataMember]@@ -140,7 +140,7 @@ namespace MediaBrowser.Controller.Entities}[IgnoreDataMember]- public override IEnumerable<string> PhysicalLocations+ public override string[] PhysicalLocations{get{@@ -153,12 +153,12 @@ namespace MediaBrowser.Controller.Entitiesreturn true;}- public List<string> PhysicalLocationsList { get; set; }- public List<Guid> PhysicalFolderIds { get; set; }+ public string[] PhysicalLocationsList { get; set; }+ public Guid[] PhysicalFolderIds { get; set; }protected override FileSystemMetadata[] GetFileSystemChildren(IDirectoryService directoryService){- return CreateResolveArgs(directoryService, true).FileSystemChildren.ToArray();+ return CreateResolveArgs(directoryService, true).FileSystemChildren;}private bool _requiresRefresh;@@ -168,9 +168,9 @@ namespace MediaBrowser.Controller.Entitiesif (!changed){- var locations = PhysicalLocations.ToList();+ var locations = PhysicalLocations;- var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations.ToList();+ var newLocations = CreateResolveArgs(new DirectoryService(Logger, FileSystem), false).PhysicalLocations;if (!locations.SequenceEqual(newLocations)){@@ -180,7 +180,7 @@ namespace MediaBrowser.Controller.Entitiesif (!changed){- var folderIds = PhysicalFolderIds.ToList();+ var folderIds = PhysicalFolderIds;var newFolderIds = GetPhysicalFolders(false).Select(i => i.Id).ToList();@@ -242,15 +242,15 @@ namespace MediaBrowser.Controller.EntitiesLinkedChildren = linkedChildren.ToArray(linkedChildren.Count);- var folderIds = PhysicalFolderIds.ToList();- var newFolderIds = physicalFolders.Select(i => i.Id).ToList();+ var folderIds = PhysicalFolderIds;+ var newFolderIds = physicalFolders.Select(i => i.Id).ToArray();if (!folderIds.SequenceEqual(newFolderIds)){changed = true;if (setFolders){- PhysicalFolderIds = newFolderIds.ToList();+ PhysicalFolderIds = newFolderIds;}}@@ -307,7 +307,7 @@ namespace MediaBrowser.Controller.Entities_requiresRefresh = _requiresRefresh || !args.PhysicalLocations.SequenceEqual(PhysicalLocations);if (setPhysicalLocations){- PhysicalLocationsList = args.PhysicalLocations.ToList();+ PhysicalLocationsList = args.PhysicalLocations;}return args;diff --git a/MediaBrowser.Controller/Entities/Game.cs b/MediaBrowser.Controller/Entities/Game.csindex eb2638ee4a..a99058925f 100644--- a/MediaBrowser.Controller/Entities/Game.cs+++ b/MediaBrowser.Controller/Entities/Game.cs@@ -3,7 +3,6 @@ using MediaBrowser.Model.Configuration;using MediaBrowser.Model.Entities;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.IO;using MediaBrowser.Model.Serialization;diff --git a/MediaBrowser.Controller/Entities/GameGenre.cs b/MediaBrowser.Controller/Entities/GameGenre.csindex 836020d886..4e78a7fa5e 100644--- a/MediaBrowser.Controller/Entities/GameGenre.cs+++ b/MediaBrowser.Controller/Entities/GameGenre.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.Serialization;using MediaBrowser.Common.Extensions;using MediaBrowser.Controller.Extensions;diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.csindex 4b70eae586..790f8938e4 100644--- a/MediaBrowser.Controller/Entities/Genre.cs+++ b/MediaBrowser.Controller/Entities/Genre.cs@@ -2,7 +2,6 @@using MediaBrowser.Controller.Entities.Audio;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Common.Extensions;using MediaBrowser.Controller.Extensions;using MediaBrowser.Model.Extensions;diff --git a/MediaBrowser.Controller/Entities/ICollectionFolder.cs b/MediaBrowser.Controller/Entities/ICollectionFolder.csindex d8b02034c7..b70ad322d9 100644--- a/MediaBrowser.Controller/Entities/ICollectionFolder.cs+++ b/MediaBrowser.Controller/Entities/ICollectionFolder.cs@@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Entitiesstring Path { get; }string Name { get; }Guid Id { get; }- IEnumerable<string> PhysicalLocations { get; }+ string[] PhysicalLocations { get; }}public interface ISupportsUserSpecificViewdiff --git a/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs b/MediaBrowser.Controller/Entities/InternalPeopleQuery.csindex 05d23d9866..9e0e9c2088 100644--- a/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs+++ b/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs@@ -6,7 +6,7 @@ namespace MediaBrowser.Controller.Entitiespublic class InternalPeopleQuery{public Guid ItemId { get; set; }- public List<string> PersonTypes { get; set; }+ public string[] PersonTypes { get; set; }public List<string> ExcludePersonTypes { get; set; }public int? MaxListOrder { get; set; }public Guid AppearsInItemId { get; set; }@@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entitiespublic InternalPeopleQuery(){- PersonTypes = new List<string>();+ PersonTypes = new string[] {};ExcludePersonTypes = new List<string>();}}diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.csindex 2768d84659..900e8a6646 100644--- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs+++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs@@ -1,5 +1,4 @@-using MediaBrowser.Controller.Entities.TV;-using MediaBrowser.Controller.Providers;+using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Configuration;using MediaBrowser.Model.Entities;using MediaBrowser.Model.Querying;@@ -169,7 +168,7 @@ namespace MediaBrowser.Controller.Entities.Moviesif (base.IsVisible(user)){- return base.GetChildren(user, true).Any();+ return base.GetChildren(user, true).Count > 0;}return false;diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.csindex 2028c1c3bf..b7470d679d 100644--- a/MediaBrowser.Controller/Entities/MusicVideo.cs+++ b/MediaBrowser.Controller/Entities/MusicVideo.cs@@ -9,15 +9,15 @@ namespace MediaBrowser.Controller.Entitiespublic class MusicVideo : Video, IHasArtist, IHasMusicGenres, IHasLookupInfo<MusicVideoInfo>{[IgnoreDataMember]- public List<string> Artists { get; set; }+ public string[] Artists { get; set; }public MusicVideo(){- Artists = new List<string>();+ Artists = EmptyStringArray;}[IgnoreDataMember]- public List<string> AllArtists+ public string[] AllArtists{get{diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.csindex 40a93d9e6f..412eb94998 100644--- a/MediaBrowser.Controller/Entities/PeopleHelper.cs+++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs@@ -105,7 +105,15 @@ namespace MediaBrowser.Controller.Entities{throw new ArgumentNullException("name");}- return people.Any(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase));++ foreach (var i in people)+ {+ if (string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase))+ {+ return true;+ }+ }+ return false;}}}diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.csindex 20d9c7999d..b3a91f9446 100644--- a/MediaBrowser.Controller/Entities/Person.cs+++ b/MediaBrowser.Controller/Entities/Person.cs@@ -1,7 +1,6 @@using MediaBrowser.Controller.Providers;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Common.Extensions;using MediaBrowser.Controller.Extensions;using MediaBrowser.Model.Entities;diff --git a/MediaBrowser.Controller/Entities/Photo.cs b/MediaBrowser.Controller/Entities/Photo.csindex e95ceee52c..8e9eac50cd 100644--- a/MediaBrowser.Controller/Entities/Photo.cs+++ b/MediaBrowser.Controller/Entities/Photo.cs@@ -1,5 +1,4 @@using MediaBrowser.Model.Drawing;-using System.Linq;using MediaBrowser.Model.Serialization;namespace MediaBrowser.Controller.Entities@@ -39,7 +38,16 @@ namespace MediaBrowser.Controller.Entities{get{- return GetParents().OfType<PhotoAlbum>().FirstOrDefault();+ var parents = GetParents();+ foreach (var parent in parents)+ {+ var photoAlbum = parent as PhotoAlbum;+ if (photoAlbum != null)+ {+ return photoAlbum;+ }+ }+ return null;}}diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.csindex 8cb65c60a0..a6a72d9940 100644--- a/MediaBrowser.Controller/Entities/Studio.cs+++ b/MediaBrowser.Controller/Entities/Studio.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.Serialization;using MediaBrowser.Common.Extensions;using MediaBrowser.Controller.Extensions;diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.csindex 8b934bc475..bf6dc5678f 100644--- a/MediaBrowser.Controller/Entities/TV/Season.cs+++ b/MediaBrowser.Controller/Entities/TV/Season.cs@@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.Entities.TVpublic override int GetChildCount(User user){- var result = GetChildren(user, true).Count();+ var result = GetChildren(user, true).Count;return result;}diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.csindex 545e8518ae..6514d31d26 100644--- a/MediaBrowser.Controller/Entities/TV/Series.cs+++ b/MediaBrowser.Controller/Entities/TV/Series.cs@@ -214,7 +214,15 @@ namespace MediaBrowser.Controller.Entities.TV{get{- return Children.OfType<Video>().Any();+ var children = Children;+ foreach (var child in children)+ {+ if (child is Video)+ {+ return true;+ }+ }+ return false;}}diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.csindex d5d229bb35..851686ea8e 100644--- a/MediaBrowser.Controller/Entities/User.cs+++ b/MediaBrowser.Controller/Entities/User.cs@@ -5,7 +5,6 @@ using MediaBrowser.Model.Connect;using MediaBrowser.Model.Serialization;using MediaBrowser.Model.Users;using System;-using System.Linq;using System.Threading;using System.Threading.Tasks;@@ -279,7 +278,14 @@ namespace MediaBrowser.Controller.Entitiesreturn true;}- return schedules.Any(i => IsParentalScheduleAllowed(i, date));+ foreach (var i in schedules)+ {+ if (IsParentalScheduleAllowed(i, date))+ {+ return true;+ }+ }+ return false;}private bool IsParentalScheduleAllowed(AccessSchedule schedule, DateTime date)@@ -304,7 +310,14 @@ namespace MediaBrowser.Controller.Entitiespublic bool IsFolderGrouped(Guid id){- return Configuration.GroupedFolders.Select(i => new Guid(i)).Contains(id);+ foreach (var i in Configuration.GroupedFolders)+ {+ if (new Guid(i) == id)+ {+ return true;+ }+ }+ return false;}[IgnoreDataMember]diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.csindex dd70277a7e..2ed3bf20fa 100644--- a/MediaBrowser.Controller/Entities/UserRootFolder.cs+++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs@@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.Entities{if (_childrenIds == null){- var list = base.LoadChildren().ToList();+ var list = base.LoadChildren();_childrenIds = list.Select(i => i.Id).ToList();return list;}diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.csindex 7ab4e98fcf..66174034d0 100644--- a/MediaBrowser.Controller/Entities/UserView.cs+++ b/MediaBrowser.Controller/Entities/UserView.cs@@ -4,9 +4,9 @@ using MediaBrowser.Model.Entities;using MediaBrowser.Model.Querying;using System;using System.Collections.Generic;+using System.Linq;using MediaBrowser.Model.Serialization;using System.Threading.Tasks;-using System.Linq;using MediaBrowser.Controller.Dto;namespace MediaBrowser.Controller.Entities@@ -60,7 +60,7 @@ namespace MediaBrowser.Controller.Entitiespublic override int GetChildCount(User user){- return GetChildren(user, true).Count();+ return GetChildren(user, true).Count;}protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.csindex 61b1a3b1ae..7d820b007a 100644--- a/MediaBrowser.Controller/Entities/Year.cs+++ b/MediaBrowser.Controller/Entities/Year.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.Globalization;-using System.Linq;using MediaBrowser.Model.Serialization;namespace MediaBrowser.Controller.Entitiesdiff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.csindex 27af60700e..880b3a0ce6 100644--- a/MediaBrowser.Controller/IO/FileData.cs+++ b/MediaBrowser.Controller/IO/FileData.cs@@ -3,7 +3,6 @@ using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Logging;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.IO;namespace MediaBrowser.Controller.IO@@ -107,7 +106,15 @@ namespace MediaBrowser.Controller.IO}}- return dict.Values.ToArray();+ var returnResult = new FileSystemMetadata[dict.Count];+ var index = 0;+ var values = dict.Values;+ foreach (var value in values)+ {+ returnResult[index] = value;+ index++;+ }+ return returnResult;}}diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.csindex 963e4b71b2..56392eee7b 100644--- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs+++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs@@ -4,7 +4,6 @@ using System;using System.Collections.Generic;using System.IO;using System.Linq;-using MediaBrowser.Controller.Configuration;using MediaBrowser.Controller.IO;using MediaBrowser.Model.Configuration;@@ -134,7 +133,14 @@ namespace MediaBrowser.Controller.Library// Not officially supported but in some cases we can handle it.if (item == null){- item = parent.GetParents().OfType<T>().FirstOrDefault();+ var parents = parent.GetParents();+ foreach (var currentParent in parents)+ {+ if (currentParent is T)+ {+ return true;+ }+ }}return item != null;@@ -167,12 +173,12 @@ namespace MediaBrowser.Controller.Library/// Gets the physical locations./// </summary>/// <value>The physical locations.</value>- public IEnumerable<string> PhysicalLocations+ public string[] PhysicalLocations{get{var paths = string.IsNullOrWhiteSpace(Path) ? new string[] { } : new[] { Path };- return AdditionalLocations == null ? paths : paths.Concat(AdditionalLocations);+ return AdditionalLocations == null ? paths : paths.Concat(AdditionalLocations).ToArray();}}diff --git a/MediaBrowser.Controller/Library/NameExtensions.cs b/MediaBrowser.Controller/Library/NameExtensions.csindex 693b7b2217..bab334a6d2 100644--- a/MediaBrowser.Controller/Library/NameExtensions.cs+++ b/MediaBrowser.Controller/Library/NameExtensions.cs@@ -1,7 +1,5 @@using System;using System.Collections.Generic;-using System.Globalization;-using System.Linq;using MediaBrowser.Controller.Extensions;using MediaBrowser.Model.Extensions;@@ -9,25 +7,6 @@ namespace MediaBrowser.Controller.Library{public static class NameExtensions{- public static bool EqualsAny(IEnumerable<string> names, string x)- {- x = NormalizeForComparison(x);-- return names.Any(y => string.Compare(x, y, StringComparison.OrdinalIgnoreCase) == 0);- //return names.Any(y => string.Compare(x, y, CultureInfo.InvariantCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace) == 0);- }-- private static string NormalizeForComparison(string name)- {- if (name == null)- {- return string.Empty;- }-- return name;- //return name.RemoveDiacritics();- }-private static string RemoveDiacritics(string name){if (name == null)@@ -44,27 +23,4 @@ namespace MediaBrowser.Controller.Libraryreturn names.DistinctBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase);}}-- public class DistinctNameComparer : IComparer<string>, IEqualityComparer<string>- {- public int Compare(string x, string y)- {- if (string.IsNullOrWhiteSpace(x) && string.IsNullOrWhiteSpace(y))- {- return 0;- }-- return string.Compare(x.RemoveDiacritics(), y.RemoveDiacritics(), StringComparison.OrdinalIgnoreCase);- }-- public bool Equals(string x, string y)- {- return Compare(x, y) == 0;- }-- public int GetHashCode(string obj)- {- return (obj ?? string.Empty).GetHashCode();- }- }}diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.csindex 25bc10dec0..c29d732532 100644--- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs+++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs@@ -6,7 +6,6 @@ using MediaBrowser.Model.Entities;using MediaBrowser.Model.LiveTv;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.Serialization;using System.Threading.Tasks;using MediaBrowser.Controller.Library;diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.csindex 3efbc41f1d..1607dbcba1 100644--- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs+++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs@@ -9,7 +9,6 @@ using MediaBrowser.Common.Configuration;using MediaBrowser.Model.Entities;using MediaBrowser.Model.Providers;using MediaBrowser.Model.Serialization;-using MediaBrowser.Model.Extensions;namespace MediaBrowser.Controller.LiveTv{diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.csindex 2c26d35560..950949f37a 100644--- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs+++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs@@ -5,7 +5,6 @@ using MediaBrowser.Model.Entities;using MediaBrowser.Model.LiveTv;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.Serialization;using System.Threading.Tasks;using MediaBrowser.Controller.Library;diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.csindex 337bb23a48..d957470d3b 100644--- a/MediaBrowser.Controller/Providers/DirectoryService.cs+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs@@ -4,7 +4,6 @@ using System.Collections.Concurrent;using System.Collections.Generic;using System.IO;using System.Linq;-using MediaBrowser.Controller.IO;using MediaBrowser.Model.IO;@@ -73,14 +72,23 @@ namespace MediaBrowser.Controller.Providersreturn entries;}- public IEnumerable<FileSystemMetadata> GetFiles(string path)+ public List<FileSystemMetadata> GetFiles(string path){return GetFiles(path, false);}- public IEnumerable<FileSystemMetadata> GetFiles(string path, bool clearCache)+ public List<FileSystemMetadata> GetFiles(string path, bool clearCache){- return GetFileSystemEntries(path, clearCache).Where(i => !i.IsDirectory);+ var list = new List<FileSystemMetadata>();+ var items = GetFileSystemEntries(path, clearCache);+ foreach (var item in items)+ {+ if (!item.IsDirectory)+ {+ list.Add(item);+ }+ }+ return list;}public FileSystemMetadata GetFile(string path)diff --git a/MediaBrowser.Controller/Providers/IDirectoryService.cs b/MediaBrowser.Controller/Providers/IDirectoryService.csindex 3747039482..6f864f4be2 100644--- a/MediaBrowser.Controller/Providers/IDirectoryService.cs+++ b/MediaBrowser.Controller/Providers/IDirectoryService.cs@@ -6,7 +6,7 @@ namespace MediaBrowser.Controller.Providerspublic interface IDirectoryService{FileSystemMetadata[] GetFileSystemEntries(string path);- IEnumerable<FileSystemMetadata> GetFiles(string path);+ List<FileSystemMetadata> GetFiles(string path);FileSystemMetadata GetFile(string path);}}\ No newline at end of filediff --git a/MediaBrowser.Controller/Providers/MetadataResult.cs b/MediaBrowser.Controller/Providers/MetadataResult.csindex 99402a9694..5ed55ea162 100644--- a/MediaBrowser.Controller/Providers/MetadataResult.cs+++ b/MediaBrowser.Controller/Providers/MetadataResult.cs@@ -1,7 +1,6 @@using MediaBrowser.Controller.Entities;using System;using System.Collections.Generic;-using System.Linq;namespace MediaBrowser.Controller.Providers{@@ -51,7 +50,15 @@ namespace MediaBrowser.Controller.ProvidersUserDataList = new List<UserItemData>();}- var userData = UserDataList.FirstOrDefault(i => string.Equals(userId, i.UserId.ToString("N"), StringComparison.OrdinalIgnoreCase));+ UserItemData userData = null;++ foreach (var i in UserDataList)+ {+ if (string.Equals(userId, i.UserId.ToString("N"), StringComparison.OrdinalIgnoreCase))+ {+ userData = i;+ }+ }if (userData == null){diff --git a/MediaBrowser.Controller/Providers/SongInfo.cs b/MediaBrowser.Controller/Providers/SongInfo.csindex 988e931cd3..e3a6f5d37e 100644--- a/MediaBrowser.Controller/Providers/SongInfo.cs+++ b/MediaBrowser.Controller/Providers/SongInfo.cs@@ -1,4 +1,3 @@-using System.Collections.Generic;namespace MediaBrowser.Controller.Providers{@@ -6,11 +5,11 @@ namespace MediaBrowser.Controller.Providers{public string[] AlbumArtists { get; set; }public string Album { get; set; }- public List<string> Artists { get; set; }+ public string[] Artists { get; set; }public SongInfo(){- Artists = new List<string>();+ Artists = EmptyStringArray;AlbumArtists = EmptyStringArray;}}diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.csindex 265f4f544e..90c1de2f2b 100644--- a/MediaBrowser.Controller/Session/SessionInfo.cs+++ b/MediaBrowser.Controller/Session/SessionInfo.cs@@ -2,7 +2,6 @@using MediaBrowser.Model.Session;using System;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Controller.Entities;using MediaBrowser.Model.Logging;using MediaBrowser.Model.Threading;@@ -194,7 +193,19 @@ namespace MediaBrowser.Controller.Sessionpublic bool ContainsUser(Guid userId){- return (UserId ?? Guid.Empty) == userId || AdditionalUsers.Any(i => userId == new Guid(i.UserId));+ if ((UserId ?? Guid.Empty) == userId)+ {+ return true;+ }++ foreach (var additionalUser in AdditionalUsers)+ {+ if (userId == new Guid(additionalUser.UserId))+ {+ return true;+ }+ }+ return false;}private readonly object _progressLock = new object();diff --git a/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.csindex 881d2a85a8..9195a9cd41 100644--- a/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs+++ b/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs@@ -4,10 +4,8 @@ using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Entities;using System;using System.Collections.Generic;-using System.IO;using System.Linq;-using MediaBrowser.Controller.IO;using MediaBrowser.Model.IO;namespace MediaBrowser.LocalMetadata.Images@@ -40,49 +38,50 @@ namespace MediaBrowser.LocalMetadata.Images{var parentPath = _fileSystem.GetDirectoryName(item.Path);- var parentPathFiles = directoryService.GetFiles(parentPath)- .ToList();+ var parentPathFiles = directoryService.GetFiles(parentPath);var nameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(item.Path);return GetFilesFromParentFolder(nameWithoutExtension, parentPathFiles);}- private List<LocalImageInfo> GetFilesFromParentFolder(string filenameWithoutExtension, IEnumerable<FileSystemMetadata> parentPathFiles)+ private List<LocalImageInfo> GetFilesFromParentFolder(string filenameWithoutExtension, List<FileSystemMetadata> parentPathFiles){var thumbName = filenameWithoutExtension + "-thumb";- return parentPathFiles- .Where(i =>- {- if (i.IsDirectory)- {- return false;- }-- if (BaseItem.SupportedImageExtensions.Contains(i.Extension, StringComparer.OrdinalIgnoreCase))- {- var currentNameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);-- if (string.Equals(filenameWithoutExtension, currentNameWithoutExtension, StringComparison.OrdinalIgnoreCase))- {- return true;- }-- if (string.Equals(thumbName, currentNameWithoutExtension, StringComparison.OrdinalIgnoreCase))- {- return true;- }- }-- return false;- })- .Select(i => new LocalImageInfo- {- FileInfo = i,- Type = ImageType.Primary- })- .ToList();+ var list = new List<LocalImageInfo>(1);++ foreach (var i in parentPathFiles)+ {+ if (i.IsDirectory)+ {+ continue;+ }++ if (BaseItem.SupportedImageExtensions.Contains(i.Extension, StringComparer.OrdinalIgnoreCase))+ {+ var currentNameWithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);++ if (string.Equals(filenameWithoutExtension, currentNameWithoutExtension, StringComparison.OrdinalIgnoreCase))+ {+ list.Add(new LocalImageInfo+ {+ FileInfo = i,+ Type = ImageType.Primary+ });+ }++ else if (string.Equals(thumbName, currentNameWithoutExtension, StringComparison.OrdinalIgnoreCase))+ {+ list.Add(new LocalImageInfo+ {+ FileInfo = i,+ Type = ImageType.Primary+ });+ }+ }+ }+ return list;}}}diff --git a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.csindex ddfb703212..56a2c271f9 100644--- a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs+++ b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs@@ -7,7 +7,6 @@ using System;using System.Collections.Generic;using System.Globalization;using System.Linq;-using MediaBrowser.Controller.IO;using MediaBrowser.Model.IO;diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.csindex 8da20c9f5b..8bad650b53 100644--- a/MediaBrowser.Model/Dto/BaseItemDto.cs+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs@@ -432,7 +432,7 @@ namespace MediaBrowser.Model.Dto/// Gets or sets the artists./// </summary>/// <value>The artists.</value>- public List<string> Artists { get; set; }+ public string[] Artists { get; set; }/// <summary>/// Gets or sets the artist items.diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.csindex 8f3f0648d3..27920bdf39 100644--- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs+++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs@@ -2,7 +2,6 @@using MediaBrowser.Model.Extensions;using MediaBrowser.Model.MediaInfo;using System.Collections.Generic;-using System.Linq;using MediaBrowser.Model.Serialization;using MediaBrowser.Model.Session;@@ -91,19 +90,15 @@ namespace MediaBrowser.Model.Dtoreturn;}- var internalStreams = MediaStreams- .Where(i => !i.IsExternal)- .ToList();-- if (internalStreams.Count == 0)+ var bitrate = 0;+ foreach (var stream in MediaStreams){- return;+ if (!stream.IsExternal)+ {+ bitrate += stream.BitRate ?? 0;+ }}- var bitrate = internalStreams- .Select(m => m.BitRate ?? 0)- .Sum();-if (bitrate > 0){Bitrate = bitrate;diff --git a/MediaBrowser.Model/Extensions/ListHelper.cs b/MediaBrowser.Model/Extensions/ListHelper.csindex cfcb229c8f..6fe1793dba 100644--- a/MediaBrowser.Model/Extensions/ListHelper.cs+++ b/MediaBrowser.Model/Extensions/ListHelper.cs@@ -1,6 +1,4 @@using System;-using System.Collections.Generic;-using System.Linq;namespace MediaBrowser.Model.Extensions{@@ -13,7 +11,14 @@ namespace MediaBrowser.Model.Extensionsthrow new ArgumentNullException("value");}- return list.Contains(value, StringComparer.OrdinalIgnoreCase);+ foreach (var item in list)+ {+ if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))+ {+ return true;+ }+ }+ return false;}public static bool ContainsAnyIgnoreCase(string[] list, string[] values)diff --git a/MediaBrowser.Model/Services/QueryParamCollection.cs b/MediaBrowser.Model/Services/QueryParamCollection.csindex a3e00f587c..e13e5fecac 100644--- a/MediaBrowser.Model/Services/QueryParamCollection.cs+++ b/MediaBrowser.Model/Services/QueryParamCollection.cs@@ -58,9 +58,7 @@ namespace MediaBrowser.Model.Services{if (string.IsNullOrWhiteSpace(value)){- var stringComparison = GetStringComparison();-- var parameters = this.Where(p => string.Equals(key, p.Name, stringComparison)).ToArray();+ var parameters = GetItems(key);foreach (var p in parameters){@@ -84,14 +82,6 @@ namespace MediaBrowser.Model.ServicesAdd(key, value);}- /// <summary>- /// True if the collection contains a query parameter with the given name.- /// </summary>- public bool ContainsKey(string name)- {- return this.Any(p => p.Name == name);- }-/// <summary>/// Removes all parameters of the given name./// </summary>@@ -106,16 +96,49 @@ namespace MediaBrowser.Model.Services{var stringComparison = GetStringComparison();- return this.Where(p => string.Equals(p.Name, name, stringComparison))- .Select(p => p.Value)- .FirstOrDefault();+ foreach (var pair in this)+ {+ if (string.Equals(pair.Name, name, stringComparison))+ {+ return pair.Value;+ }+ }++ return null;+ }++ public virtual List<NameValuePair> GetItems(string name)+ {+ var stringComparison = GetStringComparison();++ var list = new List<NameValuePair>();++ foreach (var pair in this)+ {+ if (string.Equals(pair.Name, name, stringComparison))+ {+ list.Add(pair);+ }+ }++ return list;}- public virtual string[] GetValues(string name)+ public virtual List<string> GetValues(string name){var stringComparison = GetStringComparison();- return this.Where(p => string.Equals(p.Name, name, stringComparison)).Select(p => p.Value).ToArray();+ var list = new List<string>();++ foreach (var pair in this)+ {+ if (string.Equals(pair.Name, name, stringComparison))+ {+ list.Add(pair.Value);+ }+ }++ return list;}public Dictionary<string, string> ToDictionary()@@ -134,7 +157,17 @@ namespace MediaBrowser.Model.Servicespublic IEnumerable<string> Keys{- get { return this.Select(i => i.Name); }+ get+ {+ var keys = new string[this.Count];++ for (var i = 0; i < keys.Length; i++)+ {+ keys[i] = this[i].Name;+ }++ return keys;+ }}/// <summary>diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.csindex 5e0631b3b7..3ac5181872 100644--- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs+++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs@@ -89,5 +89,7 @@ namespace MediaBrowser.Model.Updatespublic string targetFilename { get; set; }public string infoUrl { get; set; }++ public string runtimes { get; set; }}}\ No newline at end of filediff --git a/MediaBrowser.Providers/Books/AudioBookMetadataService.cs b/MediaBrowser.Providers/Books/AudioBookMetadataService.csindex b9e265d22e..834ec6cd39 100644--- a/MediaBrowser.Providers/Books/AudioBookMetadataService.cs+++ b/MediaBrowser.Providers/Books/AudioBookMetadataService.cs@@ -23,9 +23,9 @@ namespace MediaBrowser.Providers.Booksvar sourceItem = source.Item;var targetItem = target.Item;- if (replaceData || targetItem.Artists.Count == 0)+ if (replaceData || targetItem.Artists.Length == 0){- targetItem.Artists = sourceItem.Artists.ToList();+ targetItem.Artists = sourceItem.Artists;}if (replaceData || string.IsNullOrEmpty(targetItem.Album))diff --git a/MediaBrowser.Providers/Books/AudioPodcastMetadataService.cs b/MediaBrowser.Providers/Books/AudioPodcastMetadataService.csindex 2ea0a7ee96..09546e4b61 100644--- a/MediaBrowser.Providers/Books/AudioPodcastMetadataService.cs+++ b/MediaBrowser.Providers/Books/AudioPodcastMetadataService.cs@@ -23,9 +23,9 @@ namespace MediaBrowser.Providers.Booksvar sourceItem = source.Item;var targetItem = target.Item;- if (replaceData || targetItem.Artists.Count == 0)+ if (replaceData || targetItem.Artists.Length == 0){- targetItem.Artists = sourceItem.Artists.ToList();+ targetItem.Artists = sourceItem.Artists;}if (replaceData || string.IsNullOrEmpty(targetItem.Album))diff --git a/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs b/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.csindex 81cd416050..12748a8a77 100644--- a/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs+++ b/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs@@ -41,11 +41,7 @@ namespace MediaBrowser.Providers.BoxSetsif (mergeMetadataSettings){- // Retain shortcut children- var linkedChildren = sourceItem.LinkedChildren.ToList();- linkedChildren.AddRange(sourceItem.LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut));-- targetItem.LinkedChildren = linkedChildren.ToArray(linkedChildren.Count);+ targetItem.LinkedChildren = sourceItem.LinkedChildren;targetItem.Shares = sourceItem.Shares;}}diff --git a/MediaBrowser.Providers/Chapters/ChapterManager.cs b/MediaBrowser.Providers/Chapters/ChapterManager.csindex 3973d3de7b..d3e9efd820 100644--- a/MediaBrowser.Providers/Chapters/ChapterManager.cs+++ b/MediaBrowser.Providers/Chapters/ChapterManager.cs@@ -13,7 +13,6 @@ using MediaBrowser.Model.Entities;using MediaBrowser.Model.Logging;using System;using System.Collections.Generic;-using System.Linq;using System.Threading;using System.Threading.Tasks;diff --git a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs b/MediaBrowser.Providers/Manager/GenericPriorityQueue.csindex 03bb0f68c9..e245476146 100644--- a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs+++ b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs@@ -1,7 +1,6 @@using System;using System.Collections;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/MediaBrowser.Providers/Manager/GenericPriorityQueueNode.cs b/MediaBrowser.Providers/Manager/GenericPriorityQueueNode.csindex e6e93e4433..ec908095f9 100644--- a/MediaBrowser.Providers/Manager/GenericPriorityQueueNode.cs+++ b/MediaBrowser.Providers/Manager/GenericPriorityQueueNode.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/MediaBrowser.Providers/Manager/IFixedSizePriorityQueue.cs b/MediaBrowser.Providers/Manager/IFixedSizePriorityQueue.csindex 8da88e1c6f..a49d42acaa 100644--- a/MediaBrowser.Providers/Manager/IFixedSizePriorityQueue.cs+++ b/MediaBrowser.Providers/Manager/IFixedSizePriorityQueue.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/MediaBrowser.Providers/Manager/IPriorityQueue.cs b/MediaBrowser.Providers/Manager/IPriorityQueue.csindex 425992b18b..23f08a13e2 100644--- a/MediaBrowser.Providers/Manager/IPriorityQueue.cs+++ b/MediaBrowser.Providers/Manager/IPriorityQueue.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs b/MediaBrowser.Providers/Manager/SimplePriorityQueue.csindex f4c261a810..879ae1dca4 100644--- a/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs+++ b/MediaBrowser.Providers/Manager/SimplePriorityQueue.cs@@ -1,7 +1,6 @@using System;using System.Collections;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.csindex b8b6032452..a4f2053a9d 100644--- a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs+++ b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs@@ -93,7 +93,7 @@ namespace MediaBrowser.Providers.MediaInfoprivate string GetAudioImagePath(Audio item){var filename = item.Album ?? string.Empty;- filename += string.Join(",", item.Artists.ToArray(item.Artists.Count));+ filename += string.Join(",", item.Artists);if (!string.IsNullOrWhiteSpace(item.Album)){diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.csindex fb1fed8b3f..b0785298b8 100644--- a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs+++ b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfo.cs@@ -141,7 +141,7 @@ namespace MediaBrowser.Providers.MediaInfo}audio.Album = data.Album;- audio.Artists = data.Artists.ToList();+ audio.Artists = data.Artists;audio.AlbumArtists = data.AlbumArtists;audio.IndexNumber = data.IndexNumber;audio.ParentIndexNumber = data.ParentIndexNumber;diff --git a/MediaBrowser.Providers/Music/AlbumMetadataService.cs b/MediaBrowser.Providers/Music/AlbumMetadataService.csindex fe39a841e4..4230c517ae 100644--- a/MediaBrowser.Providers/Music/AlbumMetadataService.cs+++ b/MediaBrowser.Providers/Music/AlbumMetadataService.cs@@ -106,7 +106,7 @@ namespace MediaBrowser.Providers.Music.SelectMany(i => i.Artists).Distinct(StringComparer.OrdinalIgnoreCase).OrderBy(i => i)- .ToList();+ .ToArray();if (!item.Artists.SequenceEqual(artists, StringComparer.OrdinalIgnoreCase)){@@ -158,7 +158,7 @@ namespace MediaBrowser.Providers.Musicvar sourceItem = source.Item;var targetItem = target.Item;- if (replaceData || targetItem.Artists.Count == 0)+ if (replaceData || targetItem.Artists.Length == 0){targetItem.Artists = sourceItem.Artists;}diff --git a/MediaBrowser.Providers/Music/ArtistMetadataService.cs b/MediaBrowser.Providers/Music/ArtistMetadataService.csindex c8008ba1ec..0ff161576f 100644--- a/MediaBrowser.Providers/Music/ArtistMetadataService.cs+++ b/MediaBrowser.Providers/Music/ArtistMetadataService.cs@@ -31,7 +31,7 @@ namespace MediaBrowser.Providers.Music}) :item.GetRecursiveChildren(i => i is IHasArtist && !i.IsFolder);- var currentList = item.Genres.ToList();+ var currentList = item.Genres;item.Genres = taggedItems.SelectMany(i => i.Genres).DistinctNames()diff --git a/MediaBrowser.Providers/Music/AudioMetadataService.cs b/MediaBrowser.Providers/Music/AudioMetadataService.csindex 68a4fcd7cb..f02eae19fc 100644--- a/MediaBrowser.Providers/Music/AudioMetadataService.cs+++ b/MediaBrowser.Providers/Music/AudioMetadataService.cs@@ -21,9 +21,9 @@ namespace MediaBrowser.Providers.Musicvar sourceItem = source.Item;var targetItem = target.Item;- if (replaceData || targetItem.Artists.Count == 0)+ if (replaceData || targetItem.Artists.Length == 0){- targetItem.Artists = sourceItem.Artists.ToList();+ targetItem.Artists = sourceItem.Artists;}if (replaceData || string.IsNullOrEmpty(targetItem.Album))diff --git a/MediaBrowser.Providers/Music/MusicVideoMetadataService.cs b/MediaBrowser.Providers/Music/MusicVideoMetadataService.csindex 27c6deb740..28504dbd74 100644--- a/MediaBrowser.Providers/Music/MusicVideoMetadataService.cs+++ b/MediaBrowser.Providers/Music/MusicVideoMetadataService.cs@@ -28,9 +28,9 @@ namespace MediaBrowser.Providers.MusictargetItem.Album = sourceItem.Album;}- if (replaceData || targetItem.Artists.Count == 0)+ if (replaceData || targetItem.Artists.Length == 0){- targetItem.Artists = sourceItem.Artists.ToList();+ targetItem.Artists = sourceItem.Artists;}}diff --git a/MediaBrowser.Providers/Playlists/PlaylistMetadataService.cs b/MediaBrowser.Providers/Playlists/PlaylistMetadataService.csindex dccef3a09a..d39d3baf5d 100644--- a/MediaBrowser.Providers/Playlists/PlaylistMetadataService.cs+++ b/MediaBrowser.Providers/Playlists/PlaylistMetadataService.cs@@ -42,12 +42,9 @@ namespace MediaBrowser.Providers.Playlists{if (!item.IsLocked && !item.LockedFields.Contains(MetadataFields.Genres)){- var items = item.GetLinkedChildren()- .ToList();-- var currentList = item.Genres.ToList();+ var currentList = item.Genres;- item.Genres = items.SelectMany(i => i.Genres)+ item.Genres = item.GetLinkedChildren().SelectMany(i => i.Genres).Distinct(StringComparer.OrdinalIgnoreCase).ToList();diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.csindex 73a568ca97..443699b5a3 100644--- a/MediaBrowser.Server.Mono/Program.cs+++ b/MediaBrowser.Server.Mono/Program.cs@@ -261,9 +261,10 @@ namespace MediaBrowser.Server.Mono{var args = Environment.GetCommandLineArgs().Skip(1)- .Select(NormalizeCommandLineArgument);+ .Select(NormalizeCommandLineArgument)+ .ToArray();- commandLineArgsString = string.Join(" ", args.ToArray());+ commandLineArgsString = string.Join(" ", args);}_logger.Info("Executable: {0}", module);diff --git a/MediaBrowser.ServerApplication/Native/LoopUtil.cs b/MediaBrowser.ServerApplication/Native/LoopUtil.csindex 7c74712312..0efdba389d 100644--- a/MediaBrowser.ServerApplication/Native/LoopUtil.cs+++ b/MediaBrowser.ServerApplication/Native/LoopUtil.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Runtime.InteropServices;using System.Text;using System.Threading.Tasks;diff --git a/MediaBrowser.XbmcMetadata/EntryPoint.cs b/MediaBrowser.XbmcMetadata/EntryPoint.csindex ac5313a291..b1c687a6e3 100644--- a/MediaBrowser.XbmcMetadata/EntryPoint.cs+++ b/MediaBrowser.XbmcMetadata/EntryPoint.cs@@ -8,7 +8,6 @@ using MediaBrowser.Model.Logging;using MediaBrowser.XbmcMetadata.Configuration;using MediaBrowser.XbmcMetadata.Savers;using System;-using System.Linq;using MediaBrowser.Controller.Dto;namespace MediaBrowser.XbmcMetadatadiff --git a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.csindex f9ca238c7e..85f9f92baa 100644--- a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs+++ b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs@@ -1,4 +1,5 @@-using MediaBrowser.Common.Configuration;+using System.Linq;+using MediaBrowser.Common.Configuration;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Entities.Movies;using MediaBrowser.Controller.Providers;@@ -81,7 +82,9 @@ namespace MediaBrowser.XbmcMetadata.Parsersif (!string.IsNullOrWhiteSpace(val) && movie != null){- movie.Artists.Add(val);+ var list = movie.Artists.ToList();+ list.Add(val);+ movie.Artists = list.ToArray();}break;diff --git a/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.csindex ec53b3bc4c..f9f9c9b98a 100644--- a/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs+++ b/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs@@ -57,10 +57,9 @@ namespace MediaBrowser.XbmcMetadata.Saversprivate static readonly CultureInfo UsCulture = new CultureInfo("en-US");- private void AddTracks(IEnumerable<Audio> tracks, XmlWriter writer)+ private void AddTracks(IEnumerable<BaseItem> tracks, XmlWriter writer){- foreach (var track in tracks.OrderBy(i => i.ParentIndexNumber ?? 0)- .ThenBy(i => i.IndexNumber ?? 0))+ foreach (var track in tracks.OrderBy(i => i.ParentIndexNumber ?? 0).ThenBy(i => i.IndexNumber ?? 0)){writer.WriteStartElement("track");diff --git a/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.csindex 413738ade1..a7f4e56a65 100644--- a/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs+++ b/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs@@ -7,7 +7,6 @@ using MediaBrowser.XbmcMetadata.Configuration;using System.Collections.Generic;using System.Globalization;using System.IO;-using System.Linq;using System.Xml;using MediaBrowser.Controller.IO;@@ -50,16 +49,14 @@ namespace MediaBrowser.XbmcMetadata.Savers}var albums = artist- .GetRecursiveChildren(i => i is MusicAlbum)- .Cast<MusicAlbum>()- .ToList();+ .GetRecursiveChildren(i => i is MusicAlbum);AddAlbums(albums, writer);}private static readonly CultureInfo UsCulture = new CultureInfo("en-US");- private void AddAlbums(IEnumerable<MusicAlbum> albums, XmlWriter writer)+ private void AddAlbums(IList<BaseItem> albums, XmlWriter writer){foreach (var album in albums){diff --git a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.csindex 70fb4e5fa2..1989a2c284 100644--- a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs+++ b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs@@ -8,7 +8,6 @@ using MediaBrowser.Model.Entities;using MediaBrowser.Model.Logging;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Xml;using MediaBrowser.Controller.IO;@@ -21,7 +20,8 @@ namespace MediaBrowser.XbmcMetadata.Savers{protected override string GetLocalSavePath(IHasMetadata item){- return GetMovieSavePaths(new ItemInfo(item), FileSystem).FirstOrDefault();+ var paths = GetMovieSavePaths(new ItemInfo(item), FileSystem);+ return paths.Count == 0 ? null : paths[0];}public static List<string> GetMovieSavePaths(ItemInfo item, IFileSystem fileSystem)diff --git a/Mono.Nat/NatUtility.cs b/Mono.Nat/NatUtility.csindex c1983658d3..b9efd9bbdf 100644--- a/Mono.Nat/NatUtility.cs+++ b/Mono.Nat/NatUtility.cs@@ -30,7 +30,6 @@ using System;using System.Net;using System.Net.Sockets;using System.Threading;-using System.Linq;using System.Collections.Generic;using System.IO;using System.Net.NetworkInformation;diff --git a/Mono.Nat/Pmp/Searchers/PmpSearcher.cs b/Mono.Nat/Pmp/Searchers/PmpSearcher.csindex 4a8a904120..def50fb722 100644--- a/Mono.Nat/Pmp/Searchers/PmpSearcher.cs+++ b/Mono.Nat/Pmp/Searchers/PmpSearcher.cs@@ -36,7 +36,6 @@ using System.Net;using Mono.Nat.Pmp;using System.Net.NetworkInformation;using System.Net.Sockets;-using System.Linq;using System.Threading.Tasks;namespace Mono.Natdiff --git a/Mono.Nat/Upnp/Upnp.cs b/Mono.Nat/Upnp/Upnp.csindex 38d949250f..e9321f8741 100644--- a/Mono.Nat/Upnp/Upnp.cs+++ b/Mono.Nat/Upnp/Upnp.cs@@ -30,7 +30,6 @@using System;using System.Collections.Generic;-using System.Linq;using System.Net;using System.Text;using System.Threading.Tasks;diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex eb8a55b4c7..4044eaea1e 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.740</version>+ <version>3.0.741</version><title>Emby.Common</title><authors>Emby Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex 5c16159c73..6f43586cdb 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.740</version>+ <version>3.0.741</version><title>Emby.Server.Core</title><authors>Emby Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Emby Server.</description><copyright>Copyright © Emby 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.740" />+ <dependency id="MediaBrowser.Common" version="3.0.741" /></dependencies></metadata><files>diff --git a/RSSDP/CustomHttpHeaders.cs b/RSSDP/CustomHttpHeaders.csindex 9250d612fe..f2412d2e7b 100644--- a/RSSDP/CustomHttpHeaders.cs+++ b/RSSDP/CustomHttpHeaders.cs@@ -1,7 +1,6 @@using System;using System.Collections;using System.Collections.Generic;-using System.Linq;using System.Text;namespace Rssdpdiff --git a/RSSDP/DeviceAvailableEventArgs.cs b/RSSDP/DeviceAvailableEventArgs.csindex 046c10524f..d80b4b65b8 100644--- a/RSSDP/DeviceAvailableEventArgs.cs+++ b/RSSDP/DeviceAvailableEventArgs.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;using MediaBrowser.Model.Net;diff --git a/RSSDP/DeviceEventArgs.cs b/RSSDP/DeviceEventArgs.csindex e0c19c4c47..774d812ee0 100644--- a/RSSDP/DeviceEventArgs.cs+++ b/RSSDP/DeviceEventArgs.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;namespace Rssdpdiff --git a/RSSDP/DeviceUnavailableEventArgs.cs b/RSSDP/DeviceUnavailableEventArgs.csindex 5b7c1437ad..171a834a04 100644--- a/RSSDP/DeviceUnavailableEventArgs.cs+++ b/RSSDP/DeviceUnavailableEventArgs.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/RSSDP/DiscoveredSsdpDevice.cs b/RSSDP/DiscoveredSsdpDevice.csindex 58f0acfa51..54701890cf 100644--- a/RSSDP/DiscoveredSsdpDevice.cs+++ b/RSSDP/DiscoveredSsdpDevice.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Net.Http;using System.Text;using System.Threading.Tasks;diff --git a/RSSDP/DisposableManagedObjectBase.cs b/RSSDP/DisposableManagedObjectBase.csindex 87f2aa71c2..1288ba7210 100644--- a/RSSDP/DisposableManagedObjectBase.cs+++ b/RSSDP/DisposableManagedObjectBase.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/RSSDP/IUPnPDeviceValidator.cs b/RSSDP/IUPnPDeviceValidator.csindex 39b80742e6..8fa48df7bb 100644--- a/RSSDP/IUPnPDeviceValidator.cs+++ b/RSSDP/IUPnPDeviceValidator.cs@@ -11,13 +11,13 @@ namespace Rssdp.Infrastructure/// Returns an enumerable set of strings, each one being a description of an invalid property on the specified root device./// </summary>/// <param name="device">The <see cref="SsdpRootDevice"/> to validate.</param>- System.Collections.Generic.IEnumerable<string> GetValidationErrors(SsdpRootDevice device);+ System.Collections.Generic.List<string> GetValidationErrors(SsdpRootDevice device);/// <summary>/// Returns an enumerable set of strings, each one being a description of an invalid property on the specified device./// </summary>/// <param name="device">The <see cref="SsdpDevice"/> to validate.</param>- System.Collections.Generic.IEnumerable<string> GetValidationErrors(SsdpDevice device);+ System.Collections.Generic.List<string> GetValidationErrors(SsdpDevice device);/// <summary>/// Validates the specified device and throws an <see cref="System.InvalidOperationException"/> if there are any validation errors.diff --git a/RSSDP/RequestReceivedEventArgs.cs b/RSSDP/RequestReceivedEventArgs.csindex 03c059634f..f4e3677605 100644--- a/RSSDP/RequestReceivedEventArgs.cs+++ b/RSSDP/RequestReceivedEventArgs.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Net;using System.Net.Http;using System.Text;diff --git a/RSSDP/ResponseReceivedEventArgs.cs b/RSSDP/ResponseReceivedEventArgs.csindex c983fa204a..f67d5da90b 100644--- a/RSSDP/ResponseReceivedEventArgs.cs+++ b/RSSDP/ResponseReceivedEventArgs.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Net;using System.Net.Http;using System.Text;diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.csindex 91004b76fe..a4be24ebfe 100644--- a/RSSDP/SsdpCommunicationsServer.cs+++ b/RSSDP/SsdpCommunicationsServer.cs@@ -364,7 +364,7 @@ namespace Rssdp.Infrastructureif (_enableMultiSocketBinding){- foreach (var address in _networkManager.GetLocalIpAddresses().ToList())+ foreach (var address in _networkManager.GetLocalIpAddresses()){try{diff --git a/RSSDP/SsdpConstants.cs b/RSSDP/SsdpConstants.csindex c839d9e0bf..87f01f9e0c 100644--- a/RSSDP/SsdpConstants.cs+++ b/RSSDP/SsdpConstants.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/RSSDP/SsdpDevice.cs b/RSSDP/SsdpDevice.csindex a595742d00..cda11f0a46 100644--- a/RSSDP/SsdpDevice.cs+++ b/RSSDP/SsdpDevice.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.Collections.ObjectModel;-using System.Linq;using System.Text;using System.Threading.Tasks;using System.Xml;@@ -283,7 +282,7 @@ namespace Rssdp/// </summary>/// <seealso cref="AddDevice"/>/// <seealso cref="RemoveDevice"/>- public IEnumerable<SsdpDevice> Devices+ public IList<SsdpDevice> Devices{get;private set;@@ -466,7 +465,7 @@ namespace Rssdpprivate static void WriteIcons(XmlWriter writer, SsdpDevice device){- if (device.Icons.Any())+ if (device.Icons.Count > 0){writer.WriteStartElement("iconList");@@ -489,7 +488,7 @@ namespace Rssdpprivate void WriteChildDevices(XmlWriter writer, SsdpDevice parentDevice){- if (parentDevice.Devices.Any())+ if (parentDevice.Devices.Count > 0){writer.WriteStartElement("deviceList");diff --git a/RSSDP/SsdpDeviceExtensions.cs b/RSSDP/SsdpDeviceExtensions.csindex 0ad710a6b0..6e1b456461 100644--- a/RSSDP/SsdpDeviceExtensions.cs+++ b/RSSDP/SsdpDeviceExtensions.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;namespace Rssdpdiff --git a/RSSDP/SsdpDeviceIcon.cs b/RSSDP/SsdpDeviceIcon.csindex 4ffda58ff9..3ed707c80a 100644--- a/RSSDP/SsdpDeviceIcon.cs+++ b/RSSDP/SsdpDeviceIcon.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.csindex 3ea17237df..8fe4d4a144 100644--- a/RSSDP/SsdpDeviceLocator.cs+++ b/RSSDP/SsdpDeviceLocator.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using MediaBrowser.Model.Net;using MediaBrowser.Model.Threading;diff --git a/RSSDP/SsdpDeviceLocatorBase.cs b/RSSDP/SsdpDeviceLocatorBase.csindex 1adb95cdf5..d1eaef88af 100644--- a/RSSDP/SsdpDeviceLocatorBase.cs+++ b/RSSDP/SsdpDeviceLocatorBase.cs@@ -127,7 +127,7 @@ namespace Rssdp.Infrastructure}catch (Exception ex){-+}}@@ -543,17 +543,9 @@ namespace Rssdp.Infrastructure}}- private IEnumerable<DiscoveredSsdpDevice> GetUnexpiredDevices()- {- lock (_Devices)- {- return (from device in _Devices where !device.IsExpired() select device).ToArray();- }- }-private bool DeviceDied(string deviceUsn, bool expired){- IEnumerable<DiscoveredSsdpDevice> existingDevices = null;+ List<DiscoveredSsdpDevice> existingDevices = null;lock (_Devices){existingDevices = FindExistingDeviceNotifications(_Devices, deviceUsn);@@ -565,7 +557,7 @@ namespace Rssdp.Infrastructure}}- if (existingDevices != null && existingDevices.Any())+ if (existingDevices != null && existingDevices.Count > 0){foreach (var removedDevice in existingDevices){@@ -591,12 +583,29 @@ namespace Rssdp.Infrastructureprivate static DiscoveredSsdpDevice FindExistingDeviceNotification(IEnumerable<DiscoveredSsdpDevice> devices, string notificationType, string usn){- return (from d in devices where d.NotificationType == notificationType && d.Usn == usn select d).FirstOrDefault();+ foreach (var d in devices)+ {+ if (d.NotificationType == notificationType && d.Usn == usn)+ {+ return d;+ }+ }+ return null;}- private static IEnumerable<DiscoveredSsdpDevice> FindExistingDeviceNotifications(IList<DiscoveredSsdpDevice> devices, string usn)+ private static List<DiscoveredSsdpDevice> FindExistingDeviceNotifications(IList<DiscoveredSsdpDevice> devices, string usn){- return (from d in devices where d.Usn == usn select d).ToArray();+ var list = new List<DiscoveredSsdpDevice>();++ foreach (var d in devices)+ {+ if (d.Usn == usn)+ {+ list.Add(d);+ }+ }++ return list;}#endregiondiff --git a/RSSDP/SsdpDeviceProperties.cs b/RSSDP/SsdpDeviceProperties.csindex 850dfb0ba8..ae5309da58 100644--- a/RSSDP/SsdpDeviceProperties.cs+++ b/RSSDP/SsdpDeviceProperties.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;namespace Rssdpdiff --git a/RSSDP/SsdpDeviceProperty.cs b/RSSDP/SsdpDeviceProperty.csindex 3a8dd2ec7f..3abcfb9aa3 100644--- a/RSSDP/SsdpDeviceProperty.cs+++ b/RSSDP/SsdpDeviceProperty.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.csindex 1c17c78372..2aa1437750 100644--- a/RSSDP/SsdpDevicePublisher.cs+++ b/RSSDP/SsdpDevicePublisher.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using MediaBrowser.Model.Net;using MediaBrowser.Model.Threading;diff --git a/RSSDP/SsdpEmbeddedDevice.cs b/RSSDP/SsdpEmbeddedDevice.csindex c03106b2dd..28948f9506 100644--- a/RSSDP/SsdpEmbeddedDevice.cs+++ b/RSSDP/SsdpEmbeddedDevice.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;namespace Rssdpdiff --git a/RSSDP/SsdpRootDevice.cs b/RSSDP/SsdpRootDevice.csindex faf851bcbe..5b7d0f4548 100644--- a/RSSDP/SsdpRootDevice.cs+++ b/RSSDP/SsdpRootDevice.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Xml;using Rssdp.Infrastructure;diff --git a/RSSDP/UPnP10DeviceValidator.cs b/RSSDP/UPnP10DeviceValidator.csindex f802b7639e..2a8a9ccd28 100644--- a/RSSDP/UPnP10DeviceValidator.cs+++ b/RSSDP/UPnP10DeviceValidator.cs@@ -26,11 +26,11 @@ namespace Rssdp.Infrastructure/// <param name="device">The <see cref="SsdpRootDevice"/> to validate.</param>/// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>/// <returns>A non-null enumerable set of strings, empty if there are no validation errors, otherwise each string represents a discrete problem.</returns>- public IEnumerable<string> GetValidationErrors(SsdpRootDevice device)+ public List<string> GetValidationErrors(SsdpRootDevice device){if (device == null) throw new ArgumentNullException("device");- var retVal = GetValidationErrors((SsdpDevice)device) as IList<string>;+ var retVal = GetValidationErrors((SsdpDevice)device);if (device.Location == null)retVal.Add("Location cannot be null.");@@ -49,7 +49,7 @@ namespace Rssdp.Infrastructure/// <param name="device">The <see cref="SsdpDevice"/> to validate.</param>/// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>/// <returns>A non-null enumerable set of strings, empty if there are no validation errors, otherwise each string represents a discrete problem.</returns>- public IEnumerable<string> GetValidationErrors(SsdpDevice device)+ public List<string> GetValidationErrors(SsdpDevice device){if (device == null) throw new ArgumentNullException("device");@@ -110,7 +110,7 @@ namespace Rssdp.Infrastructureif (String.IsNullOrEmpty(device.ModelName))retVal.Add("ModelName is required.");- if (device.Icons.Any())+ if (device.Icons.Count > 0)ValidateIcons(device, retVal);ValidateChildDevices(device, retVal);@@ -127,7 +127,7 @@ namespace Rssdp.Infrastructurepublic void ThrowIfDeviceInvalid(SsdpDevice device){var errors = this.GetValidationErrors(device);- if (errors != null && errors.Any()) throw new InvalidOperationException("Invalid device settings : " + String.Join(Environment.NewLine, errors));+ if (errors != null && errors.Count > 0) throw new InvalidOperationException("Invalid device settings : " + String.Join(Environment.NewLine, errors));}#endregiondiff --git a/SocketHttpListener/Net/BoundaryType.cs b/SocketHttpListener/Net/BoundaryType.csindex c3ac00c0fd..f1e799f63c 100644--- a/SocketHttpListener/Net/BoundaryType.cs+++ b/SocketHttpListener/Net/BoundaryType.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/CookieHelper.cs b/SocketHttpListener/Net/CookieHelper.csindex 470507d6b7..a32131956f 100644--- a/SocketHttpListener/Net/CookieHelper.cs+++ b/SocketHttpListener/Net/CookieHelper.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.Globalization;-using System.Linq;using System.Net;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/EndPointManager.cs b/SocketHttpListener/Net/EndPointManager.csindex 6a00ed360a..ddb110ec16 100644--- a/SocketHttpListener/Net/EndPointManager.cs+++ b/SocketHttpListener/Net/EndPointManager.cs@@ -1,7 +1,6 @@using System;using System.Collections;using System.Collections.Generic;-using System.Linq;using System.Net;using System.Reflection;using System.Threading.Tasks;@@ -83,7 +82,9 @@ namespace SocketHttpListener.Net{try{- addr = (await networkManager.GetHostAddressesAsync(host).ConfigureAwait(false)).FirstOrDefault() ??+ var all = (await networkManager.GetHostAddressesAsync(host).ConfigureAwait(false));++ addr = (all.Length == 0 ? null : all[0]) ??GetIpAnyAddress(listener);}catchdiff --git a/SocketHttpListener/Net/EntitySendFormat.cs b/SocketHttpListener/Net/EntitySendFormat.csindex 6e585bdc9b..9caee3e112 100644--- a/SocketHttpListener/Net/EntitySendFormat.cs+++ b/SocketHttpListener/Net/EntitySendFormat.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs b/SocketHttpListener/Net/HttpListenerResponse.Managed.csindex 83fcc09cae..34953b569a 100644--- a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs+++ b/SocketHttpListener/Net/HttpListenerResponse.Managed.cs@@ -2,7 +2,6 @@using System.Collections.Generic;using System.Globalization;using System.IO;-using System.Linq;using System.Net;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/HttpListenerResponse.cs b/SocketHttpListener/Net/HttpListenerResponse.csindex fc57e84857..1cbd6165e7 100644--- a/SocketHttpListener/Net/HttpListenerResponse.cs+++ b/SocketHttpListener/Net/HttpListenerResponse.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Net;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/HttpRequestStream.Managed.cs b/SocketHttpListener/Net/HttpRequestStream.Managed.csindex 92f4bbb02d..c9c148b150 100644--- a/SocketHttpListener/Net/HttpRequestStream.Managed.cs+++ b/SocketHttpListener/Net/HttpRequestStream.Managed.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Runtime.ExceptionServices;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/HttpRequestStream.cs b/SocketHttpListener/Net/HttpRequestStream.csindex c54da44a17..f10c04a4f1 100644--- a/SocketHttpListener/Net/HttpRequestStream.cs+++ b/SocketHttpListener/Net/HttpRequestStream.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/HttpResponseStream.Managed.cs b/SocketHttpListener/Net/HttpResponseStream.Managed.csindex 116c3280a7..b700c293d7 100644--- a/SocketHttpListener/Net/HttpResponseStream.Managed.cs+++ b/SocketHttpListener/Net/HttpResponseStream.Managed.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Net;using System.Net.Sockets;using System.Runtime.ExceptionServices;diff --git a/SocketHttpListener/Net/HttpResponseStream.cs b/SocketHttpListener/Net/HttpResponseStream.csindex f7140be66c..5b7fa417f3 100644--- a/SocketHttpListener/Net/HttpResponseStream.cs+++ b/SocketHttpListener/Net/HttpResponseStream.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Text;using System.Threading;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/HttpStatusDescription.cs b/SocketHttpListener/Net/HttpStatusDescription.csindex 8d490c5117..9cc4a8e8ce 100644--- a/SocketHttpListener/Net/HttpStatusDescription.cs+++ b/SocketHttpListener/Net/HttpStatusDescription.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/UriScheme.cs b/SocketHttpListener/Net/UriScheme.csindex eb13619c9d..35b01e0e55 100644--- a/SocketHttpListener/Net/UriScheme.cs+++ b/SocketHttpListener/Net/UriScheme.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Net/WebHeaderCollection.cs b/SocketHttpListener/Net/WebHeaderCollection.csindex 66e159ccb7..d82dc68163 100644--- a/SocketHttpListener/Net/WebHeaderCollection.cs+++ b/SocketHttpListener/Net/WebHeaderCollection.cs@@ -131,13 +131,13 @@ namespace SocketHttpListener.Netbase.Add(headerName, headerValue);}- internal string[] GetValues_internal(string header, bool split)+ internal List<string> GetValues_internal(string header, bool split){if (header == null)throw new ArgumentNullException("header");- string[] values = base.GetValues(header);- if (values == null || values.Length == 0)+ var values = base.GetValues(header);+ if (values == null || values.Count == 0)return null;if (split && IsMultiValue(header))@@ -155,7 +155,7 @@ namespace SocketHttpListener.Netif (separated == null){- separated = new List<string>(values.Length + 1);+ separated = new List<string>(values.Count + 1);foreach (var v in values){if (v == value)@@ -177,13 +177,13 @@ namespace SocketHttpListener.Net}if (separated != null)- return separated.ToArray(separated.Count);+ return separated;}return values;}- public override string[] GetValues(string header)+ public override List<string> GetValues(string header){return GetValues_internal(header, true);}diff --git a/SocketHttpListener/Net/WebHeaderEncoding.cs b/SocketHttpListener/Net/WebHeaderEncoding.csindex 64330c1b43..4a080179ea 100644--- a/SocketHttpListener/Net/WebHeaderEncoding.cs+++ b/SocketHttpListener/Net/WebHeaderEncoding.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Primitives/ICertificate.cs b/SocketHttpListener/Primitives/ICertificate.csindex 1289da13d7..ec21e9445d 100644--- a/SocketHttpListener/Primitives/ICertificate.cs+++ b/SocketHttpListener/Primitives/ICertificate.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;diff --git a/SocketHttpListener/Primitives/IStreamFactory.cs b/SocketHttpListener/Primitives/IStreamFactory.csindex 57e21e31bc..4b623b940f 100644--- a/SocketHttpListener/Primitives/IStreamFactory.cs+++ b/SocketHttpListener/Primitives/IStreamFactory.cs@@ -1,7 +1,6 @@using System;using System.Collections.Generic;using System.IO;-using System.Linq;using System.Text;using System.Threading.Tasks;using MediaBrowser.Model.Net;diff --git a/SocketHttpListener/Primitives/ITextEncoding.cs b/SocketHttpListener/Primitives/ITextEncoding.csindex b10145687b..2c25a308c6 100644--- a/SocketHttpListener/Primitives/ITextEncoding.cs+++ b/SocketHttpListener/Primitives/ITextEncoding.cs@@ -1,6 +1,5 @@using System;using System.Collections.Generic;-using System.Linq;using System.Text;using System.Threading.Tasks;using MediaBrowser.Model.Text;