diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index ac9a220b63..4f06ae4245 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -359,7 +359,8 @@ namespace MediaBrowser.Api.Images break; } - var extension = mimeType.Substring(mimeType.IndexOf('/') + 1); + + var extension = mimeType.Split(';').First().Split('/').Last(); var oldImagePath = entity.GetImage(imageType); diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs index ce3d9d8e0c..4fe19fcf37 100644 --- a/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs +++ b/MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs @@ -82,7 +82,9 @@ namespace MediaBrowser.Api.UserLibrary } - var tasks = ibnItems.Select(i => GetDto(i, user, new List())); + var fields = GetItemFields(request).ToList(); + + var tasks = ibnItems.Select(i => GetDto(i, user, fields)); var resultItems = await Task.WhenAll(tasks).ConfigureAwait(false); @@ -91,6 +93,23 @@ namespace MediaBrowser.Api.UserLibrary return result; } + /// + /// Gets the item fields. + /// + /// The request. + /// IEnumerable{ItemFields}. + private IEnumerable GetItemFields(GetItemsByName request) + { + var val = request.Fields; + + if (string.IsNullOrEmpty(val)) + { + return new ItemFields[] { }; + } + + return val.Split(',').Select(v => (ItemFields)Enum.Parse(typeof(ItemFields), v, true)); + } + /// /// Gets all items. /// @@ -171,5 +190,10 @@ namespace MediaBrowser.Api.UserLibrary /// /// The item id. public string Id { get; set; } + /// + /// Fields to return within the items, in addition to basic information + /// + /// The fields. + public string Fields { get; set; } } } diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs index 78e9ad63e6..b85a8d1a3f 100644 --- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs +++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs @@ -60,7 +60,7 @@ namespace MediaBrowser.Api.UserLibrary /// /// Class UpdateDisplayPreferences /// - [Route("/Users/{UserId}/Items/{Id}/DisplayPreferences", "GET")] + [Route("/Users/{UserId}/Items/{Id}/DisplayPreferences", "POST")] [ServiceStack.ServiceHost.Api(("Updates a user's display preferences for an item"))] public class UpdateDisplayPreferences : IReturnVoid, IRequiresRequestStream { diff --git a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs index e7abad1a43..d94d79c753 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationPaths.cs @@ -15,7 +15,7 @@ namespace MediaBrowser.Common.Implementations /// /// The _use debug path /// - private bool _useDebugPath; + private readonly bool _useDebugPath; /// /// Initializes a new instance of the class. diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs index 85d541f097..78277ed2f3 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -404,7 +404,7 @@ namespace MediaBrowser.Common.Kernel } catch (FileNotFoundException) { - configuration = ApplicationHost.CreateInstance(type); + configuration = Activator.CreateInstance(type); } // Take the object we just got and serialize it back to bytes diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs index 56da543f05..0d7c5c0603 100644 --- a/MediaBrowser.Common/Plugins/BasePlugin.cs +++ b/MediaBrowser.Common/Plugins/BasePlugin.cs @@ -295,10 +295,6 @@ namespace MediaBrowser.Common.Plugins { InitializeOnServer(!File.Exists(ConfigurationFilePath)); } - else if (kernel.KernelContext == KernelContext.Ui) - { - InitializeInUi(); - } } /// @@ -309,13 +305,6 @@ namespace MediaBrowser.Common.Plugins { } - /// - /// Starts the plugin in the Ui - /// - protected virtual void InitializeInUi() - { - } - /// /// Disposes the plugins. Undos all actions performed during Init. /// @@ -335,10 +324,6 @@ namespace MediaBrowser.Common.Plugins { DisposeOnServer(dispose); } - else if (Kernel.KernelContext == KernelContext.Ui) - { - DisposeInUI(dispose); - } } /// @@ -350,15 +335,6 @@ namespace MediaBrowser.Common.Plugins } - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void DisposeInUI(bool dispose) - { - - } - /// /// The _save lock /// diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 1e55ae78eb..71116881e6 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -56,9 +56,6 @@ Plugins\Mediabrowser.PluginSecurity.dll - - ..\packages\morelinq.1.0.15631-beta\lib\net35\MoreLinq.dll - False ..\packages\protobuf-net.2.0.0.621\lib\net40\protobuf-net.dll diff --git a/MediaBrowser.Controller/packages.config b/MediaBrowser.Controller/packages.config index e3e4367b73..bb2545c6fc 100644 --- a/MediaBrowser.Controller/packages.config +++ b/MediaBrowser.Controller/packages.config @@ -1,5 +1,4 @@  - \ No newline at end of file diff --git a/MediaBrowser.Model/DTO/BaseItemDto.cs b/MediaBrowser.Model/DTO/BaseItemDto.cs index 416e9fc132..c72613d1a8 100644 --- a/MediaBrowser.Model/DTO/BaseItemDto.cs +++ b/MediaBrowser.Model/DTO/BaseItemDto.cs @@ -631,6 +631,12 @@ namespace MediaBrowser.Model.Dto get { return string.Equals(MediaType, Entities.MediaType.Game, StringComparison.OrdinalIgnoreCase); } } + [IgnoreDataMember] + public bool IsPerson + { + get { return string.Equals(Type, "Person", StringComparison.OrdinalIgnoreCase); } + } + /// /// Occurs when [property changed]. /// diff --git a/MediaBrowser.Model/Dto/ItemsByNameQuery.cs b/MediaBrowser.Model/Dto/ItemsByNameQuery.cs new file mode 100644 index 0000000000..d1fe8d3d54 --- /dev/null +++ b/MediaBrowser.Model/Dto/ItemsByNameQuery.cs @@ -0,0 +1,52 @@ +using MediaBrowser.Model.Entities; +using System; + +namespace MediaBrowser.Model.Dto +{ + /// + /// Class ItemsByNameQuery + /// + public class ItemsByNameQuery + { + /// + /// Gets or sets the user id. + /// + /// The user id. + public Guid UserId { get; set; } + /// + /// Gets or sets the start index. + /// + /// The start index. + public int? StartIndex { get; set; } + /// + /// Gets or sets the size of the page. + /// + /// The size of the page. + public int? PageSize { get; set; } + /// + /// Gets or sets a value indicating whether this is recursive. + /// + /// true if recursive; otherwise, false. + public bool Recursive { get; set; } + /// + /// Gets or sets the sort order. + /// + /// The sort order. + public SortOrder? SortOrder { get; set; } + /// + /// If specified the search will be localized within a specific item or folder + /// + /// The item id. + public string ItemId { get; set; } + /// + /// Fields to return within the items, in addition to basic information + /// + /// The fields. + public ItemFields[] Fields { get; set; } + /// + /// Gets or sets the person types. + /// + /// The person types. + public string[] PersonTypes { get; set; } + } +} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 605fd1046b..f291e12c9f 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -44,6 +44,7 @@ + diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 2e1b8fdc51..c005b145be 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.19 + 3.0.22 <authors>Luke</authors> <owners>Media Browser Team</owners> @@ -11,7 +11,7 @@ <requireLicenseAcceptance>false</requireLicenseAcceptance> <description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.19" /> + <dependency id="MediaBrowser.Common" version="3.0.22" /> <dependency id="NLog" version="2.0.0.2000" /> <dependency id="ServiceStack" version="3.9.37" /> <dependency id="ServiceStack.Api.Swagger" version="3.9.35" /> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 83d025e897..bd53633028 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Common</id> - <version>3.0.19</version> + <version>3.0.22</version> <title>MediaBrowser.Common Media Browser Team diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index d990b8e73c..be7a20a8a2 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.19 + 3.0.22 Media Browser.Server.Core Media Browser Team @@ -11,7 +11,7 @@ false Contains core components required to build plugins for Media Browser Server. - +