mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-23 06:25:24 -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
|
@ -52,11 +52,12 @@ namespace Ombi.Store.Entities
|
||||||
set => Series = value;
|
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);
|
x => x.EmbyId == this.EmbySeries.EmbyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsIn(IMediaServerContent content)
|
public override bool IsIn(IMediaServerContent content)
|
||||||
{
|
{
|
||||||
return content.Episodes.Cast<EmbyEpisode>().Any(x => x.EmbyId == this.EmbyId);
|
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 Series { get; set; }
|
||||||
public IMediaServerContent SeriesIsIn(List<IMediaServerContent> content);
|
public IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content);
|
||||||
public bool IsIn(IMediaServerContent content);
|
public bool IsIn(IMediaServerContent content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,12 @@ namespace Ombi.Store.Entities
|
||||||
set => Series = value;
|
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);
|
x => x.JellyfinId == this.JellyfinSeries.JellyfinId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsIn(IMediaServerContent content)
|
public override bool IsIn(IMediaServerContent content)
|
||||||
{
|
{
|
||||||
return content.Episodes.Cast<JellyfinEpisode>().Any(x => x.JellyfinId == this.JellyfinId);
|
return content.Episodes.Cast<JellyfinEpisode>().Any(x => x.JellyfinId == this.JellyfinId);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Ombi.Store.Repository;
|
using Ombi.Store.Repository;
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ namespace Ombi.Store.Entities
|
||||||
|
|
||||||
public IMediaServerContent Series { get; set; }
|
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);
|
public abstract bool IsIn(IMediaServerContent content);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,9 +23,9 @@ namespace Ombi.Store.Entities
|
||||||
set => Series = value;
|
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);
|
x => x.Key == this.PlexSeries.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue