fix(newsletter): Fix newsletter not publishing double episodes (#4495)

[skip ci]
pull/4500/head
sephrat 3 years ago committed by GitHub
parent 86e87dad49
commit ddf63fbed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,11 +57,5 @@ namespace Ombi.Store.Entities
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);
}
}
}

@ -58,10 +58,5 @@ namespace Ombi.Store.Entities
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,8 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations.Schema;
using Ombi.Store.Repository;
using System.Linq;
namespace Ombi.Store.Entities
{
@ -42,6 +41,9 @@ namespace Ombi.Store.Entities
public IMediaServerContent Series { get; set; }
public abstract IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content);
public abstract bool IsIn(IMediaServerContent content);
public bool IsIn(IMediaServerContent content)
{
return content.Episodes.Any(x => x.SeasonNumber == this.SeasonNumber && x.EpisodeNumber == this.EpisodeNumber);
}
}
}

@ -28,11 +28,5 @@ namespace Ombi.Store.Entities
return content.OfType<PlexServerContent>().FirstOrDefault(
x => x.Key == this.PlexSeries.Key);
}
public override bool IsIn(IMediaServerContent content)
{
return content.Episodes.Cast<PlexEpisode>().Any(x => x.Key == this.Key);
}
}
}
Loading…
Cancel
Save