diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index da21342ac..a5bb291ae 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -1,8 +1,7 @@ -using MediaBrowser.Common.Configuration; +using System.Globalization; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.IO; using MediaBrowser.Controller.Drawing; -using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Persistence; @@ -48,6 +47,8 @@ namespace MediaBrowser.Api.Images /// The id. [ApiMember(Name = "Id", Description = "Item Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] public string Id { get; set; } + + public string Params { get; set; } } /// @@ -358,9 +359,47 @@ namespace MediaBrowser.Api.Images _libraryManager.RootFolder : _libraryManager.GetItemById(request.Id); + if (!string.IsNullOrEmpty(request.Params)) + { + ParseOptions(request, request.Params); + } + return GetImage(request, item); } + private readonly CultureInfo _usCulture = new CultureInfo("en-US"); + private void ParseOptions(ImageRequest request, string options) + { + var vals = options.Split(';'); + + for (var i = 0; i < vals.Length; i++) + { + var val = vals[i]; + + if (string.IsNullOrWhiteSpace(val)) + { + continue; + } + + if (i == 0) + { + request.Tag = val; + } + else if (i == 1) + { + request.Format = (ImageOutputFormat)Enum.Parse(typeof(ImageOutputFormat), val, true); + } + else if (i == 2) + { + request.MaxWidth = int.Parse(val, _usCulture); + } + else if (i == 3) + { + request.MaxHeight = int.Parse(val, _usCulture); + } + } + } + /// /// Gets the specified request. /// diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 8f3016769..1cd819197 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -502,9 +502,6 @@ namespace MediaBrowser.Api.UserLibrary return userdata != null && userdata.IsFavorite; }); - case ItemFilter.IsRecentlyAdded: - return items.Where(item => item.IsRecentlyAdded()); - case ItemFilter.IsResumable: return items.Where(item => { diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 80fa3b869..b8ea1bec4 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -948,16 +948,6 @@ namespace MediaBrowser.Controller.Entities return GetType().Name; } - /// - /// Determines if the item is considered new based on user settings - /// - /// true if [is recently added] [the specified user]; otherwise, false. - /// - public bool IsRecentlyAdded() - { - return (DateTime.UtcNow - DateCreated).TotalDays < ConfigurationManager.Configuration.RecentItemDays; - } - /// /// Gets the linked child. /// diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs index e5eff9045..7b6bcaed1 100644 --- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs +++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Net; +using System.Collections.Generic; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; @@ -672,22 +673,29 @@ namespace MediaBrowser.Dlna.Didl private ImageUrlInfo GetImageUrl(ImageDownloadInfo info, int? maxWidth, int? maxHeight) { - var url = string.Format("{0}/Items/{1}/Images/{2}?tag={3}&format=jpg", + var url = string.Format("{0}/Items/{1}/Images/{2}?params=", _serverAddress, info.ItemId, - info.Type, - info.ImageTag); + info.Type); + + var options = new List + { + info.ImageTag, + "jpg" + }; if (maxWidth.HasValue) { - url += "&maxWidth=" + maxWidth.Value.ToString(_usCulture); + options.Add(maxWidth.Value.ToString(_usCulture)); } if (maxHeight.HasValue) { - url += "&maxHeight=" + maxHeight.Value.ToString(_usCulture); + options.Add(maxHeight.Value.ToString(_usCulture)); } + url += string.Join(";", options.ToArray()); + var width = info.Width; var height = info.Height; diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 0d2c1066b..0fb9db6c0 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -123,12 +123,6 @@ namespace MediaBrowser.Model.Configuration /// true if [show log window]; otherwise, false. public bool ShowLogWindow { get; set; } - /// - /// Gets or sets the recent item days. - /// - /// The recent item days. - public int RecentItemDays { get; set; } - /// /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. /// @@ -227,9 +221,6 @@ namespace MediaBrowser.Model.Configuration public NotificationOptions NotificationOptions { get; set; } - [Obsolete("Please use RequireManualLoginForMobileApps")] - public string[] ManualLoginClients { get; set; } - /// /// Initializes a new instance of the class. /// @@ -258,8 +249,6 @@ namespace MediaBrowser.Model.Configuration RealtimeMonitorDelay = 30; - RecentItemDays = 10; - EnableInternetProviders = true; //initial installs will need these PathSubstitutions = new PathSubstitution[] { }; @@ -295,8 +284,6 @@ namespace MediaBrowser.Model.Configuration UICulture = "en-us"; NotificationOptions = new NotificationOptions(); - - ManualLoginClients = new string[] { }; } } diff --git a/MediaBrowser.Model/Querying/ItemFilter.cs b/MediaBrowser.Model/Querying/ItemFilter.cs index ee6df0626..2e88a98c9 100644 --- a/MediaBrowser.Model/Querying/ItemFilter.cs +++ b/MediaBrowser.Model/Querying/ItemFilter.cs @@ -27,10 +27,6 @@ namespace MediaBrowser.Model.Querying /// IsFavorite = 5, /// - /// The item is recently added - /// - IsRecentlyAdded = 6, - /// /// The item is resumable /// IsResumable = 7, diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 5854cf28a..c88cefdb3 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -1458,10 +1458,10 @@ namespace MediaBrowser.Server.Implementations.Dto recursiveItemCount++; // Check is recently added - if (child.IsRecentlyAdded()) - { - rcentlyAddedItemCount++; - } + //if (child.IsRecentlyAdded()) + //{ + // rcentlyAddedItemCount++; + //} var isUnplayed = true; diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 9d9a6b0a9..c8265490f 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -621,5 +621,7 @@ "ButtonVolumeUp": "Volume up", "ButtonVolumeDown": "Volume down", "ButtonMute": "Mute", - "HeaderLatestMedia": "Latest Media" + "HeaderLatestMedia": "Latest Media", + "OptionNoSubtitles": "No Subtitles", + "OptionSpecialFeatures": "Special Features" } \ No newline at end of file diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 50b9c9aaf..384d0bf33 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -2025,6 +2025,18 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + Designer