aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emby.Dlna/Didl/DidlBuilder.cs27
-rw-r--r--Emby.Dlna/PlayTo/Device.cs6
-rw-r--r--Emby.Dlna/PlayTo/PlayToController.cs6
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs10
-rw-r--r--MediaBrowser.Controller/Entities/InternalPeopleQuery.cs7
5 files changed, 35 insertions, 21 deletions
diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs
index 255f2c988..b37bc3061 100644
--- a/Emby.Dlna/Didl/DidlBuilder.cs
+++ b/Emby.Dlna/Didl/DidlBuilder.cs
@@ -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;
- }
}
}
diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs
index 5ccf88be2..a06c863fd 100644
--- a/Emby.Dlna/PlayTo/Device.cs
+++ b/Emby.Dlna/PlayTo/Device.cs
@@ -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)
{
diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs
index 9ee6986b4..43e983054 100644
--- a/Emby.Dlna/PlayTo/PlayToController.cs
+++ b/Emby.Dlna/PlayTo/PlayToController.cs
@@ -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;
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index e3242f7b4..e360b790c 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -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>();
diff --git a/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs b/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs
index 1613531b5..41d8a4c83 100644
--- a/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs
@@ -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()