Address comments

This commit is contained in:
Bond_009 2020-04-03 17:30:01 +02:00
parent f6c9a44703
commit 3161e85f76
5 changed files with 35 additions and 21 deletions

View File

@ -782,22 +782,26 @@ namespace Emby.Dlna.Didl
private void AddPeople(BaseItem item, XmlWriter writer)
{
if (!item.SupportsPeople)
{
return;
}
var types = new[]
{
PersonType.Director,
PersonType.Writer,
PersonType.Producer,
PersonType.Composer,
"Creator"
"creator"
};
var people = _libraryManager.GetPeople(item);
var index = 0;
// Seeing some LG models locking up due content with large lists of people
// The actual issue might just be due to processing a more metadata than it can handle
var limit = 6;
var people = _libraryManager.GetPeople(
new InternalPeopleQuery
{
ItemId = item.Id,
Limit = 6
});
foreach (var actor in people)
{
@ -805,13 +809,6 @@ namespace Emby.Dlna.Didl
?? PersonType.Actor;
AddValue(writer, "upnp", type.ToLowerInvariant(), actor.Name, NS_UPNP);
index++;
if (index >= limit)
{
break;
}
}
}

View File

@ -604,8 +604,7 @@ namespace Emby.Dlna.PlayTo
Properties.BaseUrl,
service,
command.Name,
avCommands.BuildPost(command,
service.ServiceType),
avCommands.BuildPost(command, service.ServiceType),
cancellationToken: cancellationToken).ConfigureAwait(false);
if (result == null || result.Document == null)
@ -647,7 +646,8 @@ namespace Emby.Dlna.PlayTo
Properties.BaseUrl,
service,
command.Name,
rendererCommands.BuildPost(command, service.ServiceType)).ConfigureAwait(false);
rendererCommands.BuildPost(command, service.ServiceType),
cancellationToken: cancellationToken).ConfigureAwait(false);
if (result == null || result.Document == null)
{

View File

@ -96,7 +96,7 @@ namespace Emby.Dlna.PlayTo
_device.OnDeviceUnavailable = OnDeviceUnavailable;
_device.PlaybackStart += OnDevicePlaybackStart;
_device.PlaybackProgress += OnDevicePlaybackProgress;
_device.PlaybackStopped += DevicePlaybackStopped;
_device.PlaybackStopped += OnDevicePlaybackStopped;
_device.MediaChanged += OnDeviceMediaChanged;
_device.Start();
@ -162,7 +162,7 @@ namespace Emby.Dlna.PlayTo
}
}
private async void DevicePlaybackStopped(object sender, PlaybackStoppedEventArgs e)
private async void OnDevicePlaybackStopped(object sender, PlaybackStoppedEventArgs e)
{
if (_disposed)
{
@ -633,7 +633,7 @@ namespace Emby.Dlna.PlayTo
_device.PlaybackStart -= OnDevicePlaybackStart;
_device.PlaybackProgress -= OnDevicePlaybackProgress;
_device.PlaybackStopped -= DevicePlaybackStopped;
_device.PlaybackStopped -= OnDevicePlaybackStopped;
_device.MediaChanged -= OnDeviceMediaChanged;
_deviceDiscovery.DeviceLeft -= OnDeviceDiscoveryDeviceLeft;
_device.OnDeviceUnavailable = null;

View File

@ -5011,6 +5011,11 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
commandText += " order by ListOrder";
if (query.Limit > 0)
{
commandText += "LIMIT " + query.Limit;
}
using (var connection = GetConnection(true))
{
var list = new List<string>();
@ -5049,6 +5054,11 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
commandText += " order by ListOrder";
if (query.Limit > 0)
{
commandText += "LIMIT " + query.Limit;
}
using (var connection = GetConnection(true))
{
var list = new List<PersonInfo>();

View File

@ -4,11 +4,18 @@ namespace MediaBrowser.Controller.Entities
{
public class InternalPeopleQuery
{
public int Limit { get; set; }
public Guid ItemId { get; set; }
public string[] PersonTypes { get; set; }
public string[] ExcludePersonTypes { get; set; }
public int? MaxListOrder { get; set; }
public Guid AppearsInItemId { get; set; }
public string NameContains { get; set; }
public InternalPeopleQuery()