mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-22 22:23:34 -07:00
Fix error when multiple media servers configured
This commit is contained in:
parent
26177e5236
commit
34bc1f48cb
5 changed files with 12 additions and 9 deletions
|
@ -51,12 +51,13 @@ namespace Ombi.Store.Entities
|
|||
get => (EmbyContent)Series;
|
||||
set => Series = value;
|
||||
}
|
||||
|
||||
public override IMediaServerContent SeriesIsIn(List<IMediaServerContent> content)
|
||||
|
||||
public override IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content)
|
||||
{
|
||||
return content.Cast<EmbyContent>().FirstOrDefault(
|
||||
return content.OfType<EmbyContent>().FirstOrDefault(
|
||||
x => x.EmbyId == this.EmbySeries.EmbyId);
|
||||
}
|
||||
|
||||
public override bool IsIn(IMediaServerContent content)
|
||||
{
|
||||
return content.Episodes.Cast<EmbyEpisode>().Any(x => x.EmbyId == this.EmbyId);
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace Ombi.Store.Entities
|
|||
|
||||
|
||||
public IMediaServerContent Series { get; set; }
|
||||
public IMediaServerContent SeriesIsIn(List<IMediaServerContent> content);
|
||||
public IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content);
|
||||
public bool IsIn(IMediaServerContent content);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,11 +53,12 @@ namespace Ombi.Store.Entities
|
|||
set => Series = value;
|
||||
}
|
||||
|
||||
public override IMediaServerContent SeriesIsIn(List<IMediaServerContent> content)
|
||||
public override IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content)
|
||||
{
|
||||
return content.Cast<JellyfinContent>().FirstOrDefault(
|
||||
return content.OfType<JellyfinContent>().FirstOrDefault(
|
||||
x => x.JellyfinId == this.JellyfinSeries.JellyfinId);
|
||||
}
|
||||
|
||||
public override bool IsIn(IMediaServerContent content)
|
||||
{
|
||||
return content.Episodes.Cast<JellyfinEpisode>().Any(x => x.JellyfinId == this.JellyfinId);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Ombi.Store.Repository;
|
||||
|
||||
|
@ -40,7 +41,7 @@ namespace Ombi.Store.Entities
|
|||
|
||||
public IMediaServerContent Series { get; set; }
|
||||
|
||||
public abstract IMediaServerContent SeriesIsIn(List<IMediaServerContent> content);
|
||||
public abstract IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content);
|
||||
public abstract bool IsIn(IMediaServerContent content);
|
||||
}
|
||||
}
|
|
@ -23,9 +23,9 @@ namespace Ombi.Store.Entities
|
|||
set => Series = value;
|
||||
}
|
||||
|
||||
public override IMediaServerContent SeriesIsIn(List<IMediaServerContent> content)
|
||||
public override IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content)
|
||||
{
|
||||
return content.Cast<PlexServerContent>().FirstOrDefault(
|
||||
return content.OfType<PlexServerContent>().FirstOrDefault(
|
||||
x => x.Key == this.PlexSeries.Key);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue