The Free Software Media System - Server Backend & API
update task buttons
Luke Pulverentib7e5e21c975c
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.csindex 297a131557..e909696553 100644--- a/MediaBrowser.Api/BaseApiService.cs+++ b/MediaBrowser.Api/BaseApiService.cs@@ -4,6 +4,7 @@ using MediaBrowser.Controller.Library;using MediaBrowser.Controller.Net;using MediaBrowser.Controller.Session;using MediaBrowser.Model.Logging;+using ServiceStack.Text.Controller;using ServiceStack.Web;using System;using System.Collections.Generic;@@ -21,7 +22,7 @@ namespace MediaBrowser.Api/// </summary>/// <value>The logger.</value>public ILogger Logger { get; set; }-+/// <summary>/// Gets or sets the HTTP result factory./// </summary>@@ -143,7 +144,7 @@ namespace MediaBrowser.Api{if (!string.IsNullOrEmpty(parentId)){- var folder = (Folder) libraryManager.GetItemById(new Guid(parentId));+ var folder = (Folder)libraryManager.GetItemById(new Guid(parentId));if (userId.HasValue){@@ -287,6 +288,20 @@ namespace MediaBrowser.Api}) ?? name;}+ protected string GetPathValue(int index)+ {+ var pathInfo = PathInfo.Parse(Request.PathInfo);+ var first = pathInfo.GetArgumentValue<string>(0);++ // backwards compatibility+ if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase))+ {+ index++;+ }++ return pathInfo.GetArgumentValue<string>(index);+ }+/// <summary>/// Gets the name of the item by./// </summary>@@ -294,7 +309,6 @@ namespace MediaBrowser.Api/// <param name="type">The type.</param>/// <param name="libraryManager">The library manager.</param>/// <returns>Task{BaseItem}.</returns>- /// <exception cref="System.ArgumentException"></exception>protected BaseItem GetItemByName(string name, string type, ILibraryManager libraryManager){BaseItem item;diff --git a/MediaBrowser.Api/ConfigurationService.cs b/MediaBrowser.Api/ConfigurationService.csindex 3eb0296fcb..d0abd18c28 100644--- a/MediaBrowser.Api/ConfigurationService.cs+++ b/MediaBrowser.Api/ConfigurationService.cs@@ -143,8 +143,7 @@ namespace MediaBrowser.Apipublic void Post(UpdateNamedConfiguration request){- var pathInfo = PathInfo.Parse(Request.PathInfo);- var key = pathInfo.GetArgumentValue<string>(2);+ var key = GetPathValue(2);var configurationType = _configurationManager.GetConfigurationType(key);var configuration = _jsonSerializer.DeserializeFromStream(request.RequestStream, configurationType);diff --git a/MediaBrowser.Api/Dlna/DlnaServerService.cs b/MediaBrowser.Api/Dlna/DlnaServerService.csindex 94d6e25b03..2383017c6b 100644--- a/MediaBrowser.Api/Dlna/DlnaServerService.cs+++ b/MediaBrowser.Api/Dlna/DlnaServerService.cs@@ -120,8 +120,7 @@ namespace MediaBrowser.Api.Dlnaprivate async Task<ControlResponse> PostAsync(Stream requestStream, IUpnpService service){- var pathInfo = PathInfo.Parse(Request.PathInfo);- var id = pathInfo.GetArgumentValue<string>(2);+ var id = GetPathValue(2);using (var reader = new StreamReader(requestStream)){diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.csindex f2586b0438..f141d9df92 100644--- a/MediaBrowser.Api/Images/ImageService.cs+++ b/MediaBrowser.Api/Images/ImageService.cs@@ -396,8 +396,7 @@ namespace MediaBrowser.Api.Imagespublic object Get(GetItemByNameImage request){- var pathInfo = PathInfo.Parse(Request.PathInfo);- var type = pathInfo.GetArgumentValue<string>(0);+ var type = GetPathValue(0);var item = GetItemByName(request.Name, type, _libraryManager);@@ -406,8 +405,7 @@ namespace MediaBrowser.Api.Imagespublic object Head(GetItemByNameImage request){- var pathInfo = PathInfo.Parse(Request.PathInfo);- var type = pathInfo.GetArgumentValue<string>(0);+ var type = GetPathValue(0);var item = GetItemByName(request.Name, type, _libraryManager);@@ -420,10 +418,9 @@ namespace MediaBrowser.Api.Images/// <param name="request">The request.</param>public void Post(PostUserImage request){- var pathInfo = PathInfo.Parse(Request.PathInfo);- var id = new Guid(pathInfo.GetArgumentValue<string>(1));+ var id = new Guid(GetPathValue(1));- request.Type = (ImageType)Enum.Parse(typeof(ImageType), pathInfo.GetArgumentValue<string>(3), true);+ request.Type = (ImageType)Enum.Parse(typeof(ImageType), GetPathValue(3), true);var item = _userManager.GetUserById(id);@@ -438,10 +435,9 @@ namespace MediaBrowser.Api.Images/// <param name="request">The request.</param>public void Post(PostItemImage request){- var pathInfo = PathInfo.Parse(Request.PathInfo);- var id = new Guid(pathInfo.GetArgumentValue<string>(1));+ var id = new Guid(GetPathValue(1));- request.Type = (ImageType)Enum.Parse(typeof(ImageType), pathInfo.GetArgumentValue<string>(3), true);+ request.Type = (ImageType)Enum.Parse(typeof(ImageType), GetPathValue(3), true);var item = _libraryManager.GetItemById(id);diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.csindex b3610bc389..77f6dc1035 100644--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs@@ -824,7 +824,7 @@ namespace MediaBrowser.Api.Playback{get{- return false;+ return true;}}diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.csindex 62aa1e755a..f9098f5bf6 100644--- a/MediaBrowser.Api/PluginService.cs+++ b/MediaBrowser.Api/PluginService.cs@@ -236,8 +236,7 @@ namespace MediaBrowser.Api{// We need to parse this manually because we told service stack not to with IRequiresRequestStream// https://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Text/ServiceStack.Text/Controller/PathInfo.cs- var pathInfo = PathInfo.Parse(Request.PathInfo);- var id = new Guid(pathInfo.GetArgumentValue<string>(1));+ var id = new Guid(GetPathValue(1));var plugin = _appHost.Plugins.First(p => p.Id == id);diff --git a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.csindex 947b99d35f..e3722b4a75 100644--- a/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs+++ b/MediaBrowser.Api/ScheduledTasks/ScheduledTaskService.cs@@ -224,8 +224,7 @@ namespace MediaBrowser.Api.ScheduledTasks{// We need to parse this manually because we told service stack not to with IRequiresRequestStream// https://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Text/ServiceStack.Text/Controller/PathInfo.cs- var pathInfo = PathInfo.Parse(Request.PathInfo);- var id = pathInfo.GetArgumentValue<string>(1);+ var id = GetPathValue(1);var task = TaskManager.ScheduledTasks.FirstOrDefault(i => string.Equals(i.Id, id));diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.csindex 51a7584b8d..37553e4a4b 100644--- a/MediaBrowser.Api/UserService.cs+++ b/MediaBrowser.Api/UserService.cs@@ -449,8 +449,7 @@ namespace MediaBrowser.Api{// We need to parse this manually because we told service stack not to with IRequiresRequestStream// https://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Text/ServiceStack.Text/Controller/PathInfo.cs- var pathInfo = PathInfo.Parse(Request.PathInfo);- var id = new Guid(pathInfo.GetArgumentValue<string>(1));+ var id = new Guid(GetPathValue(1));var dtoUser = request;diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.csindex 005f263f7c..ff6e8e85b1 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -301,7 +301,7 @@ namespace MediaBrowser.Controller.Entitiespublic override bool IsVisible(User user){- if (this is ICollectionFolder)+ if (this is ICollectionFolder && !(this is BasePluginFolder)){if (user.Policy.BlockedMediaFolders != null){diff --git a/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs b/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.csindex 0fd463155f..fbe5a06d0e 100644--- a/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs+++ b/MediaBrowser.Controller/Entities/ISupportsBoxSetGrouping.cs@@ -1,6 +1,4 @@-using System;-using System.Collections.Generic;-+namespace MediaBrowser.Controller.Entities{/// <summary>@@ -10,10 +8,5 @@ namespace MediaBrowser.Controller.Entities/// </summary>public interface ISupportsBoxSetGrouping{- /// <summary>- /// Gets or sets the box set identifier list.- /// </summary>- /// <value>The box set identifier list.</value>- List<Guid> BoxSetIdList { get; set; }}}diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.csindex e48b8d8457..63690661a8 100644--- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs+++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs@@ -4,13 +4,13 @@ using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Configuration;using MediaBrowser.Model.Entities;using MediaBrowser.Model.Querying;+using MediaBrowser.Model.Users;using System;using System.Collections.Generic;using System.Linq;using System.Runtime.Serialization;using System.Threading;using System.Threading.Tasks;-using MediaBrowser.Model.Users;namespace MediaBrowser.Controller.Entities.Movies{diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.csindex b3774cfe02..2fa5fc6e1e 100644--- a/MediaBrowser.Controller/Entities/Movies/Movie.cs+++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs@@ -25,12 +25,6 @@ namespace MediaBrowser.Controller.Entities.Moviespublic List<Guid> ThemeVideoIds { get; set; }public List<string> ProductionLocations { get; set; }- /// <summary>- /// This is just a cache to enable quick access by Id- /// </summary>- [IgnoreDataMember]- public List<Guid> BoxSetIdList { get; set; }-public Movie(){SpecialFeatureIds = new List<Guid>();@@ -40,7 +34,6 @@ namespace MediaBrowser.Controller.Entities.MoviesRemoteTrailerIds = new List<Guid>();ThemeSongIds = new List<Guid>();ThemeVideoIds = new List<Guid>();- BoxSetIdList = new List<Guid>();Taglines = new List<string>();Keywords = new List<string>();ProductionLocations = new List<string>();diff --git a/MediaBrowser.Dlna/DlnaManager.cs b/MediaBrowser.Dlna/DlnaManager.csindex 31f1e0a883..2c22abd4d9 100644--- a/MediaBrowser.Dlna/DlnaManager.cs+++ b/MediaBrowser.Dlna/DlnaManager.cs@@ -132,61 +132,74 @@ namespace MediaBrowser.Dlna{if (!string.IsNullOrWhiteSpace(profileInfo.DeviceDescription)){- if (deviceInfo.DeviceDescription == null || !Regex.IsMatch(deviceInfo.DeviceDescription, profileInfo.DeviceDescription))+ if (deviceInfo.DeviceDescription == null || !IsRegexMatch(deviceInfo.DeviceDescription, profileInfo.DeviceDescription))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.FriendlyName)){- if (deviceInfo.FriendlyName == null || !Regex.IsMatch(deviceInfo.FriendlyName, profileInfo.FriendlyName))+ if (deviceInfo.FriendlyName == null || !IsRegexMatch(deviceInfo.FriendlyName, profileInfo.FriendlyName))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.Manufacturer)){- if (deviceInfo.Manufacturer == null || !Regex.IsMatch(deviceInfo.Manufacturer, profileInfo.Manufacturer))+ if (deviceInfo.Manufacturer == null || !IsRegexMatch(deviceInfo.Manufacturer, profileInfo.Manufacturer))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.ManufacturerUrl)){- if (deviceInfo.ManufacturerUrl == null || !Regex.IsMatch(deviceInfo.ManufacturerUrl, profileInfo.ManufacturerUrl))+ if (deviceInfo.ManufacturerUrl == null || !IsRegexMatch(deviceInfo.ManufacturerUrl, profileInfo.ManufacturerUrl))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.ModelDescription)){- if (deviceInfo.ModelDescription == null || !Regex.IsMatch(deviceInfo.ModelDescription, profileInfo.ModelDescription))+ if (deviceInfo.ModelDescription == null || !IsRegexMatch(deviceInfo.ModelDescription, profileInfo.ModelDescription))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.ModelName)){- if (deviceInfo.ModelName == null || !Regex.IsMatch(deviceInfo.ModelName, profileInfo.ModelName))+ if (deviceInfo.ModelName == null || !IsRegexMatch(deviceInfo.ModelName, profileInfo.ModelName))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.ModelNumber)){- if (deviceInfo.ModelNumber == null || !Regex.IsMatch(deviceInfo.ModelNumber, profileInfo.ModelNumber))+ if (deviceInfo.ModelNumber == null || !IsRegexMatch(deviceInfo.ModelNumber, profileInfo.ModelNumber))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.ModelUrl)){- if (deviceInfo.ModelUrl == null || !Regex.IsMatch(deviceInfo.ModelUrl, profileInfo.ModelUrl))+ if (deviceInfo.ModelUrl == null || !IsRegexMatch(deviceInfo.ModelUrl, profileInfo.ModelUrl))return false;}if (!string.IsNullOrWhiteSpace(profileInfo.SerialNumber)){- if (deviceInfo.SerialNumber == null || !Regex.IsMatch(deviceInfo.SerialNumber, profileInfo.SerialNumber))+ if (deviceInfo.SerialNumber == null || !IsRegexMatch(deviceInfo.SerialNumber, profileInfo.SerialNumber))return false;}return true;}+ private bool IsRegexMatch(string input, string pattern)+ {+ try+ {+ return Regex.IsMatch(input, pattern);+ }+ catch (ArgumentException ex)+ {+ _logger.ErrorException("Error evaluating regex pattern {0}", ex, pattern);+ return false;+ }+ }+public DeviceProfile GetProfile(IDictionary<string, string> headers){if (headers == null)diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csprojindex 91d0e15f88..0a350f5179 100644--- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj+++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj@@ -497,9 +497,6 @@<Compile Include="..\MediaBrowser.Model\Dto\UserItemDataDto.cs"><Link>Dto\UserItemDataDto.cs</Link></Compile>- <Compile Include="..\MediaBrowser.Model\Dto\VideoStreamOptions.cs">- <Link>Dto\VideoStreamOptions.cs</Link>- </Compile><Compile Include="..\MediaBrowser.Model\Entities\BaseItemInfo.cs"><Link>Entities\BaseItemInfo.cs</Link></Compile>diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csprojindex 47e0190518..0c5946d129 100644--- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj+++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj@@ -462,9 +462,6 @@<Compile Include="..\MediaBrowser.Model\Dto\UserItemDataDto.cs"><Link>Dto\UserItemDataDto.cs</Link></Compile>- <Compile Include="..\MediaBrowser.Model\Dto\VideoStreamOptions.cs">- <Link>Dto\VideoStreamOptions.cs</Link>- </Compile><Compile Include="..\MediaBrowser.Model\Entities\BaseItemInfo.cs"><Link>Entities\BaseItemInfo.cs</Link></Compile>diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.csindex b6938b2174..0e69bb91f7 100644--- a/MediaBrowser.Model/ApiClient/IApiClient.cs+++ b/MediaBrowser.Model/ApiClient/IApiClient.cs@@ -1316,24 +1316,6 @@ namespace MediaBrowser.Model.ApiClient/// <returns>Task<QueryResult<BaseItemDto>>.</returns>Task<QueryResult<BaseItemDto>> GetPlaylistItems(PlaylistItemQuery query);- /// <summary>- /// Gets the url needed to stream a video file- /// </summary>- /// <param name="options">The options.</param>- /// <returns>System.String.</returns>- /// <exception cref="ArgumentNullException">options</exception>- [Obsolete]- string GetVideoStreamUrl(VideoStreamOptions options);-- /// <summary>- /// Formulates a url for streaming video using the HLS protocol- /// </summary>- /// <param name="options">The options.</param>- /// <returns>System.String.</returns>- /// <exception cref="ArgumentNullException">options</exception>- [Obsolete]- string GetHlsVideoStreamUrl(VideoStreamOptions options);-/// <summary>/// Sends the context message asynchronous./// </summary>diff --git a/MediaBrowser.Model/Dto/VideoStreamOptions.cs b/MediaBrowser.Model/Dto/VideoStreamOptions.csdeleted file mode 100644index e9a83bd12a..0000000000--- a/MediaBrowser.Model/Dto/VideoStreamOptions.cs+++ /dev/null@@ -1,158 +0,0 @@-using System;--namespace MediaBrowser.Model.Dto-{- /// <summary>- /// Class VideoStreamOptions- /// </summary>- [Obsolete]- public class VideoStreamOptions- {- /// <summary>- /// Gets or sets the audio bit rate.- /// </summary>- /// <value>The audio bit rate.</value>- public int? AudioBitRate { get; set; }-- /// <summary>- /// Gets or sets the audio codec.- /// Omit to copy the original stream- /// </summary>- /// <value>The audio encoding format.</value>- public string AudioCodec { get; set; }-- /// <summary>- /// Gets or sets the item id.- /// </summary>- /// <value>The item id.</value>- public string ItemId { get; set; }-- /// <summary>- /// Gets or sets the max audio channels.- /// </summary>- /// <value>The max audio channels.</value>- public int? MaxAudioChannels { get; set; }-- /// <summary>- /// Gets or sets the max audio sample rate.- /// </summary>- /// <value>The max audio sample rate.</value>- public int? MaxAudioSampleRate { get; set; }-- /// <summary>- /// Gets or sets the start time ticks.- /// </summary>- /// <value>The start time ticks.</value>- public long? StartTimeTicks { get; set; }-- /// <summary>- /// Gets or sets a value indicating whether the original media should be served statically- /// Only used with progressive streaming- /// </summary>- /// <value><c>true</c> if static; otherwise, <c>false</c>.</value>- public bool? Static { get; set; }-- /// <summary>- /// Gets or sets the output file extension.- /// </summary>- /// <value>The output file extension.</value>- public string OutputFileExtension { get; set; }-- /// <summary>- /// Gets or sets the device id.- /// </summary>- /// <value>The device id.</value>- public string DeviceId { get; set; }-- /// <summary>- /// Gets or sets the video codec.- /// Omit to copy- /// </summary>- /// <value>The video codec.</value>- public string VideoCodec { get; set; }-- /// <summary>- /// Gets or sets the video bit rate.- /// </summary>- /// <value>The video bit rate.</value>- public int? VideoBitRate { get; set; }-- /// <summary>- /// Gets or sets the width.- /// </summary>- /// <value>The width.</value>- public int? Width { get; set; }-- /// <summary>- /// Gets or sets the height.- /// </summary>- /// <value>The height.</value>- public int? Height { get; set; }-- /// <summary>- /// Gets or sets the width of the max.- /// </summary>- /// <value>The width of the max.</value>- public int? MaxWidth { get; set; }-- /// <summary>- /// Gets or sets the height of the max.- /// </summary>- /// <value>The height of the max.</value>- public int? MaxHeight { get; set; }-- /// <summary>- /// Gets or sets the frame rate.- /// </summary>- /// <value>The frame rate.</value>- public double? FrameRate { get; set; }-- /// <summary>- /// Gets or sets the index of the audio stream.- /// </summary>- /// <value>The index of the audio stream.</value>- public int? AudioStreamIndex { get; set; }-- /// <summary>- /// Gets or sets the index of the video stream.- /// </summary>- /// <value>The index of the video stream.</value>- public int? VideoStreamIndex { get; set; }-- /// <summary>- /// Gets or sets the index of the subtitle stream.- /// </summary>- /// <value>The index of the subtitle stream.</value>- public int? SubtitleStreamIndex { get; set; }-- /// <summary>- /// Gets or sets the profile.- /// </summary>- /// <value>The profile.</value>- public string Profile { get; set; }-- /// <summary>- /// Gets or sets the level.- /// </summary>- /// <value>The level.</value>- public string Level { get; set; }-- /// <summary>- /// Gets or sets the baseline stream audio bit rate.- /// </summary>- /// <value>The baseline stream audio bit rate.</value>- public int? BaselineStreamAudioBitRate { get; set; }-- /// <summary>- /// Gets or sets a value indicating whether [append baseline stream].- /// </summary>- /// <value><c>true</c> if [append baseline stream]; otherwise, <c>false</c>.</value>- public bool AppendBaselineStream { get; set; }-- /// <summary>- /// Gets or sets the time stamp offset ms. Only used with HLS.- /// </summary>- /// <value>The time stamp offset ms.</value>- public int? TimeStampOffsetMs { get; set; }- }-}\ No newline at end of filediff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csprojindex 36d22347fe..bad17abaea 100644--- a/MediaBrowser.Model/MediaBrowser.Model.csproj+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj@@ -135,7 +135,6 @@<Compile Include="Dto\NameValuePair.cs" /><Compile Include="MediaInfo\LiveMediaInfoResult.cs" /><Compile Include="Dto\MediaSourceType.cs" />- <Compile Include="Dto\VideoStreamOptions.cs" /><Compile Include="Configuration\DynamicDayOfWeek.cs" /><Compile Include="Entities\ExtraType.cs" /><Compile Include="Entities\SupporterInfo.cs" />diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs b/MediaBrowser.Server.Implementations/Collections/CollectionManager.csindex d92db34e33..6100e3f5dc 100644--- a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs+++ b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs@@ -167,18 +167,6 @@ namespace MediaBrowser.Server.Implementations.Collections}list.Add(LinkedChild.Create(item));-- var supportsGrouping = item as ISupportsBoxSetGrouping;-- if (supportsGrouping != null)- {- var boxsetIdList = supportsGrouping.BoxSetIdList.ToList();- if (!boxsetIdList.Contains(collectionId))- {- boxsetIdList.Add(collectionId);- }- supportsGrouping.BoxSetIdList = boxsetIdList;- }}collection.LinkedChildren.AddRange(list);@@ -228,15 +216,6 @@ namespace MediaBrowser.Server.Implementations.Collections{itemList.Add(childItem);}-- var supportsGrouping = childItem as ISupportsBoxSetGrouping;-- if (supportsGrouping != null)- {- var boxsetIdList = supportsGrouping.BoxSetIdList.ToList();- boxsetIdList.Remove(collectionId);- supportsGrouping.BoxSetIdList = boxsetIdList;- }}var shortcutFiles = Directory@@ -289,29 +268,40 @@ namespace MediaBrowser.Server.Implementations.Collectionspublic IEnumerable<BaseItem> CollapseItemsWithinBoxSets(IEnumerable<BaseItem> items, User user){- var itemsToCollapse = new List<ISupportsBoxSetGrouping>();- var boxsets = new List<BaseItem>();+ var results = new Dictionary<Guid, BaseItem>();+ var allBoxsets = new List<BoxSet>();- var list = items.ToList();-- foreach (var item in list.OfType<ISupportsBoxSetGrouping>())+ foreach (var item in items){- var currentBoxSets = item.BoxSetIdList- .Select(i => _libraryManager.GetItemById(i))- .Where(i => i != null && i.IsVisible(user))- .ToList();+ var grouping = item as ISupportsBoxSetGrouping;- if (currentBoxSets.Count > 0)+ if (grouping == null)+ {+ results[item.Id] = item;+ }+ else{- itemsToCollapse.Add(item);- boxsets.AddRange(currentBoxSets);+ var itemId = item.Id;++ var currentBoxSets = allBoxsets+ .Where(i => i.GetLinkedChildren().Any(j => j.Id == itemId))+ .ToList();++ if (currentBoxSets.Count > 0)+ {+ foreach (var boxset in currentBoxSets)+ {+ results[boxset.Id] = boxset;+ }+ }+ else+ {+ results[item.Id] = item;+ }}}- return list- .Except(itemsToCollapse.Cast<BaseItem>())- .Concat(boxsets)- .DistinctBy(i => i.Id);+ return results.Values;}}}diff --git a/MediaBrowser.Server.Implementations/Library/Validators/BoxSetPostScanTask.cs b/MediaBrowser.Server.Implementations/Library/Validators/BoxSetPostScanTask.csdeleted file mode 100644index 86d88f7e04..0000000000--- a/MediaBrowser.Server.Implementations/Library/Validators/BoxSetPostScanTask.cs+++ /dev/null@@ -1,50 +0,0 @@-using MediaBrowser.Controller.Entities;-using MediaBrowser.Controller.Entities.Movies;-using MediaBrowser.Controller.Library;-using System;-using System.Linq;-using System.Threading;-using System.Threading.Tasks;--namespace MediaBrowser.Server.Implementations.Library.Validators-{- public class BoxSetPostScanTask : ILibraryPostScanTask- {- private readonly ILibraryManager _libraryManager;-- public BoxSetPostScanTask(ILibraryManager libraryManager)- {- _libraryManager = libraryManager;- }-- public Task Run(IProgress<double> progress, CancellationToken cancellationToken)- {- var items = _libraryManager.RootFolder.RecursiveChildren.ToList();-- var boxsets = items.OfType<BoxSet>().ToList();-- var numComplete = 0;-- foreach (var boxset in boxsets)- {- foreach (var child in boxset.Children.Concat(boxset.GetLinkedChildren()).OfType<ISupportsBoxSetGrouping>())- {- var boxsetIdList = child.BoxSetIdList.ToList();- if (!boxsetIdList.Contains(boxset.Id))- {- boxsetIdList.Add(boxset.Id);- }- child.BoxSetIdList = boxsetIdList;- }-- numComplete++;- double percent = numComplete;- percent /= boxsets.Count;- progress.Report(percent * 100);- }-- progress.Report(100);- return Task.FromResult(true);- }- }-}diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.jsonindex 62619a5672..4206ccf591 100644--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json@@ -45,6 +45,8 @@"ButtonHelp": "Help","ButtonSave": "Save","HeaderDevices": "Devices",+ "ButtonScheduledTasks": "Scheduled tasks",+ "ConfirmMessageScheduledTaskButton": "This operation normally runs automatically as a scheduled task. It can also be run manually here. To configure the scheduled task, see:","HeaderSupporterBenefit": "A supporter membership provides additional benefits such as access to premium plugins, internet channel content, and more. {0}Learn more{1}.","HeaderWelcomeToMediaBrowserServerDashboard": "Welcome to the Media Browser Dashboard","HeaderWelcomeToMediaBrowserWebClient": "Welcome to the Media Browser Web Client",@@ -59,7 +61,7 @@"ButtonCancelItem": "Cancel item","ButtonQueueForRetry": "Queue for retry","ButtonReenable": "Re-enable",- "SyncJobItemStatusSyncedMarkForRemoval": "Marked for removal",+ "SyncJobItemStatusSyncedMarkForRemoval": "Marked for removal","LabelAbortedByServerShutdown": "(Aborted by server shutdown)","LabelScheduledTaskLastRan": "Last ran {0}, taking {1}.","HeaderDeleteTaskTrigger": "Delete Task Trigger",@@ -71,8 +73,8 @@"LabelFree": "Free","HeaderSelectAudio": "Select Audio","HeaderSelectSubtitles": "Select Subtitles",- "ButtonMarkForRemoval": "Mark for removal from device",- "ButtonUnmarkForRemoval": "Unmark for removal from device",+ "ButtonMarkForRemoval": "Mark for removal from device",+ "ButtonUnmarkForRemoval": "Unmark for removal from device","LabelDefaultStream": "(Default)","LabelForcedStream": "(Forced)","LabelDefaultForcedStream": "(Default/Forced)",diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csprojindex 548ac07aaf..fe5642dbc7 100644--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj@@ -209,7 +209,6 @@<Compile Include="Library\UserViewManager.cs" /><Compile Include="Library\Validators\ArtistsPostScanTask.cs" /><Compile Include="Library\Validators\ArtistsValidator.cs" />- <Compile Include="Library\Validators\BoxSetPostScanTask.cs" /><Compile Include="Library\Validators\GameGenresPostScanTask.cs" /><Compile Include="Library\Validators\GameGenresValidator.cs" /><Compile Include="Library\Validators\GenresPostScanTask.cs" />