Fixing a bug with libraries that didn't have any providers

This commit is contained in:
Zoe Roux 2020-03-02 23:58:33 +01:00
parent f081c1cf66
commit 4ed7451004

View File

@ -20,6 +20,9 @@ namespace Kyoo.Controllers
public async Task<T> GetMetadata<T>(Func<IMetadataProvider, Task<T>> providerCall, Library library, string what) where T : IMergable<T>, new()
{
T ret = new T();
if (library.Providers == null)
return ret;
foreach (IMetadataProvider provider in _providers.OrderBy(provider => Array.IndexOf(library.Providers, provider.Name)))
{
@ -38,6 +41,9 @@ namespace Kyoo.Controllers
{
List<T> ret = new List<T>();
if (library.Providers == null)
return ret;
foreach (IMetadataProvider provider in _providers.OrderBy(provider => Array.IndexOf(library.Providers, provider.Name)))
{
try