mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Fixing a bug with libraries that didn't have any providers
This commit is contained in:
parent
f081c1cf66
commit
4ed7451004
@ -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()
|
public async Task<T> GetMetadata<T>(Func<IMetadataProvider, Task<T>> providerCall, Library library, string what) where T : IMergable<T>, new()
|
||||||
{
|
{
|
||||||
T ret = new T();
|
T ret = new T();
|
||||||
|
|
||||||
|
if (library.Providers == null)
|
||||||
|
return ret;
|
||||||
|
|
||||||
foreach (IMetadataProvider provider in _providers.OrderBy(provider => Array.IndexOf(library.Providers, provider.Name)))
|
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>();
|
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)))
|
foreach (IMetadataProvider provider in _providers.OrderBy(provider => Array.IndexOf(library.Providers, provider.Name)))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
Loading…
x
Reference in New Issue
Block a user