Allocate less Lists

pull/9416/head
Bond_009 1 year ago
parent 54cd3e6d55
commit 4b01aaa0f7

@ -27,7 +27,7 @@ namespace Emby.Dlna.ConnectionManager
/// <returns>The <see cref="IEnumerable{StateVariable}"/>.</returns> /// <returns>The <see cref="IEnumerable{StateVariable}"/>.</returns>
private static IEnumerable<StateVariable> GetStateVariables() private static IEnumerable<StateVariable> GetStateVariables()
{ {
var list = new List<StateVariable> return new StateVariable[]
{ {
new StateVariable new StateVariable
{ {
@ -114,8 +114,6 @@ namespace Emby.Dlna.ConnectionManager
SendsEvents = false SendsEvents = false
} }
}; };
return list;
} }
} }
} }

@ -27,7 +27,7 @@ namespace Emby.Dlna.ContentDirectory
/// <returns>The <see cref="IEnumerable{StateVariable}"/>.</returns> /// <returns>The <see cref="IEnumerable{StateVariable}"/>.</returns>
private static IEnumerable<StateVariable> GetStateVariables() private static IEnumerable<StateVariable> GetStateVariables()
{ {
var list = new List<StateVariable> return new StateVariable[]
{ {
new StateVariable new StateVariable
{ {
@ -154,8 +154,6 @@ namespace Emby.Dlna.ContentDirectory
SendsEvents = false SendsEvents = false
} }
}; };
return list;
} }
} }
} }

@ -79,25 +79,25 @@ namespace Emby.Naming.AudioBook
{ {
if (group.Count() > 1 || haveChaptersOrPages) if (group.Count() > 1 || haveChaptersOrPages)
{ {
var ex = new List<AudioBookFileInfo>(); List<AudioBookFileInfo>? ex = null;
var alt = new List<AudioBookFileInfo>(); List<AudioBookFileInfo>? alt = null;
foreach (var audioFile in group) foreach (var audioFile in group)
{ {
var name = Path.GetFileNameWithoutExtension(audioFile.Path); var name = Path.GetFileNameWithoutExtension(audioFile.Path.AsSpan());
if (name.Equals("audiobook", StringComparison.OrdinalIgnoreCase) || if (name.Equals("audiobook", StringComparison.OrdinalIgnoreCase)
name.Contains(nameParserResult.Name, StringComparison.OrdinalIgnoreCase) || || name.Contains(nameParserResult.Name, StringComparison.OrdinalIgnoreCase)
name.Contains(nameWithReplacedDots, StringComparison.OrdinalIgnoreCase)) || name.Contains(nameWithReplacedDots, StringComparison.OrdinalIgnoreCase))
{ {
alt.Add(audioFile); (alt ??= new()).Add(audioFile);
} }
else else
{ {
ex.Add(audioFile); (ex ??= new()).Add(audioFile);
} }
} }
if (ex.Count > 0) if (ex is not null)
{ {
var extra = ex var extra = ex
.OrderBy(x => x.Container) .OrderBy(x => x.Container)
@ -108,7 +108,7 @@ namespace Emby.Naming.AudioBook
extras.AddRange(extra); extras.AddRange(extra);
} }
if (alt.Count > 0) if (alt is not null)
{ {
var alternatives = alt var alternatives = alt
.OrderBy(x => x.Container) .OrderBy(x => x.Container)

@ -401,7 +401,7 @@ namespace Emby.Server.Implementations.Channels
} }
else else
{ {
results = new List<MediaSourceInfo>(); results = Enumerable.Empty<MediaSourceInfo>();
} }
return results return results

@ -206,8 +206,7 @@ namespace Emby.Server.Implementations.Collections
throw new ArgumentException("No collection exists with the supplied Id"); throw new ArgumentException("No collection exists with the supplied Id");
} }
var list = new List<LinkedChild>(); List<BaseItem>? itemList = null;
var itemList = new List<BaseItem>();
var linkedChildrenList = collection.GetLinkedChildren(); var linkedChildrenList = collection.GetLinkedChildren();
var currentLinkedChildrenIds = linkedChildrenList.Select(i => i.Id).ToList(); var currentLinkedChildrenIds = linkedChildrenList.Select(i => i.Id).ToList();
@ -223,18 +222,23 @@ namespace Emby.Server.Implementations.Collections
if (!currentLinkedChildrenIds.Contains(id)) if (!currentLinkedChildrenIds.Contains(id))
{ {
itemList.Add(item); (itemList ??= new()).Add(item);
list.Add(LinkedChild.Create(item));
linkedChildrenList.Add(item); linkedChildrenList.Add(item);
} }
} }
if (list.Count > 0) if (itemList is not null)
{ {
LinkedChild[] newChildren = new LinkedChild[collection.LinkedChildren.Length + list.Count]; var originalLen = collection.LinkedChildren.Length;
var newItemCount = itemList.Count;
LinkedChild[] newChildren = new LinkedChild[originalLen + newItemCount];
collection.LinkedChildren.CopyTo(newChildren, 0); collection.LinkedChildren.CopyTo(newChildren, 0);
list.CopyTo(newChildren, collection.LinkedChildren.Length); for (int i = 0; i < newItemCount; i++)
{
newChildren[originalLen + i] = LinkedChild.Create(itemList[i]);
}
collection.LinkedChildren = newChildren; collection.LinkedChildren = newChildren;
collection.UpdateRatingToItems(linkedChildrenList); collection.UpdateRatingToItems(linkedChildrenList);

@ -586,7 +586,7 @@ namespace Emby.Server.Implementations.Data
/// <exception cref="ArgumentNullException"> /// <exception cref="ArgumentNullException">
/// <paramref name="items"/> or <paramref name="cancellationToken"/> is <c>null</c>. /// <paramref name="items"/> or <paramref name="cancellationToken"/> is <c>null</c>.
/// </exception> /// </exception>
public void SaveItems(IEnumerable<BaseItem> items, CancellationToken cancellationToken) public void SaveItems(IReadOnlyList<BaseItem> items, CancellationToken cancellationToken)
{ {
ArgumentNullException.ThrowIfNull(items); ArgumentNullException.ThrowIfNull(items);
@ -594,9 +594,11 @@ namespace Emby.Server.Implementations.Data
CheckDisposed(); CheckDisposed();
var tuples = new List<(BaseItem, List<Guid>, BaseItem, string, List<string>)>(); var itemsLen = items.Count;
foreach (var item in items) var tuples = new ValueTuple<BaseItem, List<Guid>, BaseItem, string, List<string>>[itemsLen];
for (int i = 0; i < itemsLen; i++)
{ {
var item = items[i];
var ancestorIds = item.SupportsAncestors ? var ancestorIds = item.SupportsAncestors ?
item.GetAncestorIds().Distinct().ToList() : item.GetAncestorIds().Distinct().ToList() :
null; null;
@ -606,7 +608,7 @@ namespace Emby.Server.Implementations.Data
var userdataKey = item.GetUserDataKeys().FirstOrDefault(); var userdataKey = item.GetUserDataKeys().FirstOrDefault();
var inheritedTags = item.GetInheritedTags(); var inheritedTags = item.GetInheritedTags();
tuples.Add((item, ancestorIds, topParent, userdataKey, inheritedTags)); tuples[i] = (item, ancestorIds, topParent, userdataKey, inheritedTags);
} }
using (var connection = GetConnection()) using (var connection = GetConnection())

@ -85,8 +85,8 @@ namespace Emby.Server.Implementations.Dto
{ {
var accessibleItems = user is null ? items : items.Where(x => x.IsVisible(user)).ToList(); var accessibleItems = user is null ? items : items.Where(x => x.IsVisible(user)).ToList();
var returnItems = new BaseItemDto[accessibleItems.Count]; var returnItems = new BaseItemDto[accessibleItems.Count];
var programTuples = new List<(BaseItem, BaseItemDto)>(); List<(BaseItem, BaseItemDto)> programTuples = null;
var channelTuples = new List<(BaseItemDto, LiveTvChannel)>(); List<(BaseItemDto, LiveTvChannel)> channelTuples = null;
for (int index = 0; index < accessibleItems.Count; index++) for (int index = 0; index < accessibleItems.Count; index++)
{ {
@ -95,11 +95,11 @@ namespace Emby.Server.Implementations.Dto
if (item is LiveTvChannel tvChannel) if (item is LiveTvChannel tvChannel)
{ {
channelTuples.Add((dto, tvChannel)); (channelTuples ??= new()).Add((dto, tvChannel));
} }
else if (item is LiveTvProgram) else if (item is LiveTvProgram)
{ {
programTuples.Add((item, dto)); (programTuples ??= new()).Add((item, dto));
} }
if (item is IItemByName byName) if (item is IItemByName byName)
@ -122,12 +122,12 @@ namespace Emby.Server.Implementations.Dto
returnItems[index] = dto; returnItems[index] = dto;
} }
if (programTuples.Count > 0) if (programTuples is not null)
{ {
LivetvManager.AddInfoToProgramDto(programTuples, options.Fields, user).GetAwaiter().GetResult(); LivetvManager.AddInfoToProgramDto(programTuples, options.Fields, user).GetAwaiter().GetResult();
} }
if (channelTuples.Count > 0) if (channelTuples is not null)
{ {
LivetvManager.AddChannelInfo(channelTuples, options, user); LivetvManager.AddChannelInfo(channelTuples, options, user);
} }

@ -356,8 +356,8 @@ namespace Emby.Server.Implementations.Library
} }
var children = item.IsFolder var children = item.IsFolder
? ((Folder)item).GetRecursiveChildren(false).ToList() ? ((Folder)item).GetRecursiveChildren(false)
: new List<BaseItem>(); : Enumerable.Empty<BaseItem>();
foreach (var metadataPath in GetMetadataPaths(item, children)) foreach (var metadataPath in GetMetadataPaths(item, children))
{ {
@ -1253,7 +1253,7 @@ namespace Emby.Server.Implementations.Library
var parent = GetItemById(query.ParentId); var parent = GetItemById(query.ParentId);
if (parent is not null) if (parent is not null)
{ {
SetTopParentIdsOrAncestors(query, new List<BaseItem> { parent }); SetTopParentIdsOrAncestors(query, new[] { parent });
} }
} }
@ -1277,7 +1277,7 @@ namespace Emby.Server.Implementations.Library
var parent = GetItemById(query.ParentId); var parent = GetItemById(query.ParentId);
if (parent is not null) if (parent is not null)
{ {
SetTopParentIdsOrAncestors(query, new List<BaseItem> { parent }); SetTopParentIdsOrAncestors(query, new[] { parent });
} }
} }
@ -1435,7 +1435,7 @@ namespace Emby.Server.Implementations.Library
var parent = GetItemById(query.ParentId); var parent = GetItemById(query.ParentId);
if (parent is not null) if (parent is not null)
{ {
SetTopParentIdsOrAncestors(query, new List<BaseItem> { parent }); SetTopParentIdsOrAncestors(query, new[] { parent });
} }
} }
@ -1455,7 +1455,7 @@ namespace Emby.Server.Implementations.Library
_itemRepository.GetItemList(query)); _itemRepository.GetItemList(query));
} }
private void SetTopParentIdsOrAncestors(InternalItemsQuery query, List<BaseItem> parents) private void SetTopParentIdsOrAncestors(InternalItemsQuery query, IReadOnlyCollection<BaseItem> parents)
{ {
if (parents.All(i => i is ICollectionFolder || i is UserView)) if (parents.All(i => i is ICollectionFolder || i is UserView))
{ {
@ -1602,7 +1602,7 @@ namespace Emby.Server.Implementations.Library
{ {
_logger.LogError(ex, "Error getting intros"); _logger.LogError(ex, "Error getting intros");
return new List<IntroInfo>(); return Enumerable.Empty<IntroInfo>();
} }
} }
@ -2876,7 +2876,7 @@ namespace Emby.Server.Implementations.Library
private async Task SavePeopleMetadataAsync(IEnumerable<PersonInfo> people, CancellationToken cancellationToken) private async Task SavePeopleMetadataAsync(IEnumerable<PersonInfo> people, CancellationToken cancellationToken)
{ {
var personsToSave = new List<BaseItem>(); List<BaseItem> personsToSave = null;
foreach (var person in people) foreach (var person in people)
{ {
@ -2918,12 +2918,12 @@ namespace Emby.Server.Implementations.Library
if (saveEntity) if (saveEntity)
{ {
personsToSave.Add(personEntity); (personsToSave ??= new()).Add(personEntity);
await RunMetadataSavers(personEntity, itemUpdateType).ConfigureAwait(false); await RunMetadataSavers(personEntity, itemUpdateType).ConfigureAwait(false);
} }
} }
if (personsToSave.Count > 0) if (personsToSave is not null)
{ {
CreateItems(personsToSave, null, CancellationToken.None); CreateItems(personsToSave, null, CancellationToken.None);
} }
@ -3085,22 +3085,19 @@ namespace Emby.Server.Implementations.Library
throw new ArgumentNullException(nameof(path)); throw new ArgumentNullException(nameof(path));
} }
var removeList = new List<NameValuePair>(); List<NameValuePair> removeList = null;
foreach (var contentType in _configurationManager.Configuration.ContentTypes) foreach (var contentType in _configurationManager.Configuration.ContentTypes)
{ {
if (string.IsNullOrWhiteSpace(contentType.Name)) if (string.IsNullOrWhiteSpace(contentType.Name)
{ || _fileSystem.AreEqual(path, contentType.Name)
removeList.Add(contentType);
}
else if (_fileSystem.AreEqual(path, contentType.Name)
|| _fileSystem.ContainsSubPath(path, contentType.Name)) || _fileSystem.ContainsSubPath(path, contentType.Name))
{ {
removeList.Add(contentType); (removeList ??= new()).Add(contentType);
} }
} }
if (removeList.Count > 0) if (removeList is not null)
{ {
_configurationManager.Configuration.ContentTypes = _configurationManager.Configuration.ContentTypes _configurationManager.Configuration.ContentTypes = _configurationManager.Configuration.ContentTypes
.Except(removeList) .Except(removeList)

@ -158,7 +158,6 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
private MultiItemResolverResult ResolveMultipleAudio(Folder parent, IEnumerable<FileSystemMetadata> fileSystemEntries, bool parseName) private MultiItemResolverResult ResolveMultipleAudio(Folder parent, IEnumerable<FileSystemMetadata> fileSystemEntries, bool parseName)
{ {
var files = new List<FileSystemMetadata>(); var files = new List<FileSystemMetadata>();
var items = new List<BaseItem>();
var leftOver = new List<FileSystemMetadata>(); var leftOver = new List<FileSystemMetadata>();
// Loop through each child file/folder and see if we find a video // Loop through each child file/folder and see if we find a video
@ -180,7 +179,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
var result = new MultiItemResolverResult var result = new MultiItemResolverResult
{ {
ExtraFiles = leftOver, ExtraFiles = leftOver,
Items = items Items = new List<BaseItem>()
}; };
var isInMixedFolder = resolverResult.Count > 1 || (parent is not null && parent.IsTopParent); var isInMixedFolder = resolverResult.Count > 1 || (parent is not null && parent.IsTopParent);

@ -286,7 +286,7 @@ namespace Emby.Server.Implementations.Library
if (parents.Count == 0) if (parents.Count == 0)
{ {
return new List<BaseItem>(); return Array.Empty<BaseItem>();
} }
if (includeItemTypes.Length == 0) if (includeItemTypes.Length == 0)

@ -28,7 +28,7 @@ namespace MediaBrowser.Controller.Persistence
/// </summary> /// </summary>
/// <param name="items">The items.</param> /// <param name="items">The items.</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
void SaveItems(IEnumerable<BaseItem> items, CancellationToken cancellationToken); void SaveItems(IReadOnlyList<BaseItem> items, CancellationToken cancellationToken);
void SaveImages(BaseItem item); void SaveImages(BaseItem item);

@ -284,12 +284,12 @@ namespace MediaBrowser.Providers.Manager
} }
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
return new List<RemoteImageInfo>(); return Enumerable.Empty<RemoteImageInfo>();
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "{ProviderName} failed in GetImageInfos for type {ItemType} at {ItemPath}", provider.GetType().Name, item.GetType().Name, item.Path); _logger.LogError(ex, "{ProviderName} failed in GetImageInfos for type {ItemType} at {ItemPath}", provider.GetType().Name, item.GetType().Name, item.Path);
return new List<RemoteImageInfo>(); return Enumerable.Empty<RemoteImageInfo>();
} }
} }

@ -87,7 +87,7 @@ namespace MediaBrowser.Providers.Playlists
return GetPlsItems(stream); return GetPlsItems(stream);
} }
return new List<LinkedChild>(); return Enumerable.Empty<LinkedChild>();
} }
private IEnumerable<LinkedChild> GetPlsItems(Stream stream) private IEnumerable<LinkedChild> GetPlsItems(Stream stream)

@ -4,6 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text.Json; using System.Text.Json;
using System.Threading; using System.Threading;
@ -42,7 +43,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
/// <inheritdoc /> /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> return new ImageType[]
{ {
ImageType.Primary, ImageType.Primary,
ImageType.Logo, ImageType.Logo,
@ -74,7 +75,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
} }
} }
return new List<RemoteImageInfo>(); return Enumerable.Empty<RemoteImageInfo>();
} }
private IEnumerable<RemoteImageInfo> GetImages(AudioDbArtistProvider.Artist item) private IEnumerable<RemoteImageInfo> GetImages(AudioDbArtistProvider.Artist item)

@ -157,10 +157,10 @@ public class MusicBrainzAlbumProvider : IRemoteMetadataProvider<MusicAlbum, Albu
var artists = releaseSearchResult.ArtistCredit; var artists = releaseSearchResult.ArtistCredit;
if (artists is not null && artists.Count > 0) if (artists is not null && artists.Count > 0)
{ {
var artistResults = new List<RemoteSearchResult>(); var artistResults = new RemoteSearchResult[artists.Count];
for (int i = 0; i < artists.Count; i++)
foreach (var artist in artists)
{ {
var artist = artists[i];
var artistResult = new RemoteSearchResult var artistResult = new RemoteSearchResult
{ {
Name = artist.Name Name = artist.Name
@ -171,11 +171,11 @@ public class MusicBrainzAlbumProvider : IRemoteMetadataProvider<MusicAlbum, Albu
artistResult.SetProviderId(MetadataProvider.MusicBrainzArtist, artist.Artist!.Id.ToString()); artistResult.SetProviderId(MetadataProvider.MusicBrainzArtist, artist.Artist!.Id.ToString());
} }
artistResults.Add(artistResult); artistResults[i] = artistResult;
} }
searchResult.AlbumArtist = artistResults[0]; searchResult.AlbumArtist = artistResults[0];
searchResult.Artists = artistResults.ToArray(); searchResult.Artists = artistResults;
} }
searchResult.SetProviderId(MetadataProvider.MusicBrainzAlbum, releaseSearchResult.Id.ToString()); searchResult.SetProviderId(MetadataProvider.MusicBrainzAlbum, releaseSearchResult.Id.ToString());

@ -38,10 +38,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> yield return ImageType.Primary;
{
ImageType.Primary
};
} }
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)

@ -48,7 +48,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
/// <inheritdoc /> /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> return new ImageType[]
{ {
ImageType.Primary, ImageType.Primary,
ImageType.Backdrop ImageType.Backdrop

@ -72,7 +72,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
var collectionSearchResults = await _tmdbClientManager.SearchCollectionAsync(searchInfo.Name, language, cancellationToken).ConfigureAwait(false); var collectionSearchResults = await _tmdbClientManager.SearchCollectionAsync(searchInfo.Name, language, cancellationToken).ConfigureAwait(false);
var collections = new List<RemoteSearchResult>(); var collections = new RemoteSearchResult[collectionSearchResults.Count];
for (var i = 0; i < collectionSearchResults.Count; i++) for (var i = 0; i < collectionSearchResults.Count; i++)
{ {
var collection = new RemoteSearchResult var collection = new RemoteSearchResult
@ -82,7 +82,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
}; };
collection.SetProviderId(MetadataProvider.Tmdb, collectionSearchResults[i].Id.ToString(CultureInfo.InvariantCulture)); collection.SetProviderId(MetadataProvider.Tmdb, collectionSearchResults[i].Id.ToString(CultureInfo.InvariantCulture));
collections.Add(collection); collections[i] = collection;
} }
return collections; return collections;

@ -49,7 +49,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
/// <inheritdoc /> /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> return new ImageType[]
{ {
ImageType.Primary, ImageType.Primary,
ImageType.Backdrop, ImageType.Backdrop,

@ -46,10 +46,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
/// <inheritdoc /> /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> yield return ImageType.Primary;
{
ImageType.Primary
};
} }
/// <inheritdoc /> /// <inheritdoc />

@ -67,7 +67,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
var personSearchResult = await _tmdbClientManager.SearchPersonAsync(searchInfo.Name, cancellationToken).ConfigureAwait(false); var personSearchResult = await _tmdbClientManager.SearchPersonAsync(searchInfo.Name, cancellationToken).ConfigureAwait(false);
var remoteSearchResults = new List<RemoteSearchResult>(); var remoteSearchResults = new RemoteSearchResult[personSearchResult.Count];
for (var i = 0; i < personSearchResult.Count; i++) for (var i = 0; i < personSearchResult.Count; i++)
{ {
var person = personSearchResult[i]; var person = personSearchResult[i];
@ -79,7 +79,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
}; };
remoteSearchResult.SetProviderId(MetadataProvider.Tmdb, person.Id.ToString(CultureInfo.InvariantCulture)); remoteSearchResult.SetProviderId(MetadataProvider.Tmdb, person.Id.ToString(CultureInfo.InvariantCulture));
remoteSearchResults.Add(remoteSearchResult); remoteSearchResults[i] = remoteSearchResult;
} }
return remoteSearchResults; return remoteSearchResults;

@ -47,10 +47,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
/// <inheritdoc /> /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> yield return ImageType.Primary;
{
ImageType.Primary
};
} }
/// <inheritdoc /> /// <inheritdoc />

@ -48,10 +48,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
/// <inheritdoc /> /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> yield return ImageType.Primary;
{
ImageType.Primary
};
} }
/// <inheritdoc /> /// <inheritdoc />

@ -48,7 +48,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
/// <inheritdoc /> /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item) public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{ {
return new List<ImageType> return new ImageType[]
{ {
ImageType.Primary, ImageType.Primary,
ImageType.Backdrop, ImageType.Backdrop,

Loading…
Cancel
Save