mirror of https://github.com/jellyfin/jellyfin.git
Created an ItemsByName query dto
This commit is contained in:
parent
79baaa4daa
commit
e8f5fade43
|
@ -359,7 +359,8 @@ namespace MediaBrowser.Api.Images
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var extension = mimeType.Substring(mimeType.IndexOf('/') + 1);
|
|
||||||
|
var extension = mimeType.Split(';').First().Split('/').Last();
|
||||||
|
|
||||||
var oldImagePath = entity.GetImage(imageType);
|
var oldImagePath = entity.GetImage(imageType);
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,9 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var tasks = ibnItems.Select(i => GetDto(i, user, new List<ItemFields>()));
|
var fields = GetItemFields(request).ToList();
|
||||||
|
|
||||||
|
var tasks = ibnItems.Select(i => GetDto(i, user, fields));
|
||||||
|
|
||||||
var resultItems = await Task.WhenAll(tasks).ConfigureAwait(false);
|
var resultItems = await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||||
|
|
||||||
|
@ -91,6 +93,23 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the item fields.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The request.</param>
|
||||||
|
/// <returns>IEnumerable{ItemFields}.</returns>
|
||||||
|
private IEnumerable<ItemFields> 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));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all items.
|
/// Gets all items.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -171,5 +190,10 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The item id.</value>
|
/// <value>The item id.</value>
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Fields to return within the items, in addition to basic information
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The fields.</value>
|
||||||
|
public string Fields { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class UpdateDisplayPreferences
|
/// Class UpdateDisplayPreferences
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[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"))]
|
[ServiceStack.ServiceHost.Api(("Updates a user's display preferences for an item"))]
|
||||||
public class UpdateDisplayPreferences : IReturnVoid, IRequiresRequestStream
|
public class UpdateDisplayPreferences : IReturnVoid, IRequiresRequestStream
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace MediaBrowser.Common.Implementations
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _use debug path
|
/// The _use debug path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private bool _useDebugPath;
|
private readonly bool _useDebugPath;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="BaseApplicationPaths" /> class.
|
/// Initializes a new instance of the <see cref="BaseApplicationPaths" /> class.
|
||||||
|
|
|
@ -404,7 +404,7 @@ namespace MediaBrowser.Common.Kernel
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException)
|
catch (FileNotFoundException)
|
||||||
{
|
{
|
||||||
configuration = ApplicationHost.CreateInstance(type);
|
configuration = Activator.CreateInstance(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Take the object we just got and serialize it back to bytes
|
// Take the object we just got and serialize it back to bytes
|
||||||
|
|
|
@ -295,10 +295,6 @@ namespace MediaBrowser.Common.Plugins
|
||||||
{
|
{
|
||||||
InitializeOnServer(!File.Exists(ConfigurationFilePath));
|
InitializeOnServer(!File.Exists(ConfigurationFilePath));
|
||||||
}
|
}
|
||||||
else if (kernel.KernelContext == KernelContext.Ui)
|
|
||||||
{
|
|
||||||
InitializeInUi();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -309,13 +305,6 @@ namespace MediaBrowser.Common.Plugins
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Starts the plugin in the Ui
|
|
||||||
/// </summary>
|
|
||||||
protected virtual void InitializeInUi()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disposes the plugins. Undos all actions performed during Init.
|
/// Disposes the plugins. Undos all actions performed during Init.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -335,10 +324,6 @@ namespace MediaBrowser.Common.Plugins
|
||||||
{
|
{
|
||||||
DisposeOnServer(dispose);
|
DisposeOnServer(dispose);
|
||||||
}
|
}
|
||||||
else if (Kernel.KernelContext == KernelContext.Ui)
|
|
||||||
{
|
|
||||||
DisposeInUI(dispose);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -350,15 +335,6 @@ namespace MediaBrowser.Common.Plugins
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Releases unmanaged and - optionally - managed resources.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
|
|
||||||
protected virtual void DisposeInUI(bool dispose)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _save lock
|
/// The _save lock
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -56,9 +56,6 @@
|
||||||
<Reference Include="Mediabrowser.PluginSecurity">
|
<Reference Include="Mediabrowser.PluginSecurity">
|
||||||
<HintPath>Plugins\Mediabrowser.PluginSecurity.dll</HintPath>
|
<HintPath>Plugins\Mediabrowser.PluginSecurity.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MoreLinq">
|
|
||||||
<HintPath>..\packages\morelinq.1.0.15631-beta\lib\net35\MoreLinq.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="protobuf-net, Version=2.0.0.621, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
|
<Reference Include="protobuf-net, Version=2.0.0.621, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\protobuf-net.2.0.0.621\lib\net40\protobuf-net.dll</HintPath>
|
<HintPath>..\packages\protobuf-net.2.0.0.621\lib\net40\protobuf-net.dll</HintPath>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="morelinq" version="1.0.15631-beta" targetFramework="net45" />
|
|
||||||
<package id="protobuf-net" version="2.0.0.621" targetFramework="net45" />
|
<package id="protobuf-net" version="2.0.0.621" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
|
@ -631,6 +631,12 @@ namespace MediaBrowser.Model.Dto
|
||||||
get { return string.Equals(MediaType, Entities.MediaType.Game, StringComparison.OrdinalIgnoreCase); }
|
get { return string.Equals(MediaType, Entities.MediaType.Game, StringComparison.OrdinalIgnoreCase); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public bool IsPerson
|
||||||
|
{
|
||||||
|
get { return string.Equals(Type, "Person", StringComparison.OrdinalIgnoreCase); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when [property changed].
|
/// Occurs when [property changed].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
using MediaBrowser.Model.Entities;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Model.Dto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Class ItemsByNameQuery
|
||||||
|
/// </summary>
|
||||||
|
public class ItemsByNameQuery
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the user id.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The user id.</value>
|
||||||
|
public Guid UserId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the start index.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The start index.</value>
|
||||||
|
public int? StartIndex { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the size of the page.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The size of the page.</value>
|
||||||
|
public int? PageSize { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this <see cref="GetItemsByName" /> is recursive.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if recursive; otherwise, <c>false</c>.</value>
|
||||||
|
public bool Recursive { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the sort order.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The sort order.</value>
|
||||||
|
public SortOrder? SortOrder { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// If specified the search will be localized within a specific item or folder
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The item id.</value>
|
||||||
|
public string ItemId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Fields to return within the items, in addition to basic information
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The fields.</value>
|
||||||
|
public ItemFields[] Fields { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the person types.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The person types.</value>
|
||||||
|
public string[] PersonTypes { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -44,6 +44,7 @@
|
||||||
<Compile Include="Configuration\ServerConfiguration.cs" />
|
<Compile Include="Configuration\ServerConfiguration.cs" />
|
||||||
<Compile Include="Dto\BaseItemPerson.cs" />
|
<Compile Include="Dto\BaseItemPerson.cs" />
|
||||||
<Compile Include="Dto\ChapterInfoDto.cs" />
|
<Compile Include="Dto\ChapterInfoDto.cs" />
|
||||||
|
<Compile Include="Dto\ItemsByNameQuery.cs" />
|
||||||
<Compile Include="Dto\MediaType.cs" />
|
<Compile Include="Dto\MediaType.cs" />
|
||||||
<Compile Include="Entities\BaseItemInfo.cs" />
|
<Compile Include="Entities\BaseItemInfo.cs" />
|
||||||
<Compile Include="Connectivity\ClientConnectionInfo.cs" />
|
<Compile Include="Connectivity\ClientConnectionInfo.cs" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common.Internal</id>
|
<id>MediaBrowser.Common.Internal</id>
|
||||||
<version>3.0.19</version>
|
<version>3.0.22</version>
|
||||||
<title />
|
<title />
|
||||||
<authors>Luke</authors>
|
<authors>Luke</authors>
|
||||||
<owners>Media Browser Team</owners>
|
<owners>Media Browser Team</owners>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description>
|
<description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||||
<dependencies>
|
<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="NLog" version="2.0.0.2000" />
|
||||||
<dependency id="ServiceStack" version="3.9.37" />
|
<dependency id="ServiceStack" version="3.9.37" />
|
||||||
<dependency id="ServiceStack.Api.Swagger" version="3.9.35" />
|
<dependency id="ServiceStack.Api.Swagger" version="3.9.35" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.19</version>
|
<version>3.0.22</version>
|
||||||
<title>MediaBrowser.Common</title>
|
<title>MediaBrowser.Common</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners />
|
<owners />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.19</version>
|
<version>3.0.22</version>
|
||||||
<title>Media Browser.Server.Core</title>
|
<title>Media Browser.Server.Core</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners />
|
<owners />
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.19" />
|
<dependency id="MediaBrowser.Common" version="3.0.22" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in New Issue