diff options
| author | Dmitry Lyzo <ashephard0@gmail.com> | 2022-01-14 22:54:29 +0300 |
|---|---|---|
| committer | Dmitry Lyzo <ashephard0@gmail.com> | 2022-01-14 23:06:45 +0300 |
| commit | 5aa748058e65eb18e1981b111715efd73922f737 (patch) | |
| tree | daab1fe8dc6744ae843f0ded1f5edcc586600cd4 /Emby.Server.Implementations/Dto/DtoService.cs | |
| parent | 112db30ff2624de01aea79df8bce021597f946ff (diff) | |
Fix duplication of local trailers
Diffstat (limited to 'Emby.Server.Implementations/Dto/DtoService.cs')
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 7ba34e74a..ab7bb618d 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1102,12 +1102,14 @@ namespace Emby.Server.Implementations.Dto if (options.ContainsField(ItemFields.LocalTrailerCount)) { - allExtras ??= item.GetExtras().ToArray(); - dto.LocalTrailerCount = allExtras.Count(i => i.ExtraType == ExtraType.Trailer); - if (item is IHasTrailers hasTrailers) { - dto.LocalTrailerCount += hasTrailers.GetTrailerCount(); + dto.LocalTrailerCount = hasTrailers.GetTrailerCount(); + } + else + { + allExtras ??= item.GetExtras().ToArray(); + dto.LocalTrailerCount = allExtras.Count(i => i.ExtraType == ExtraType.Trailer); } } |
