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

[skip ci]
This commit is contained in:
sephrat 2022-02-04 21:28:26 +01:00 committed by GitHub
parent 86e87dad49
commit ddf63fbed0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 20 deletions

View file

@ -57,11 +57,5 @@ namespace Ombi.Store.Entities
return content.OfType<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)
{
return content.Episodes.Cast<EmbyEpisode>().Any(x => x.EmbyId == this.EmbyId);
}
} }
} }

View file

@ -58,10 +58,5 @@ namespace Ombi.Store.Entities
return content.OfType<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)
{
return content.Episodes.Cast<JellyfinEpisode>().Any(x => x.JellyfinId == this.JellyfinId);
}
} }
} }

View file

@ -1,8 +1,7 @@
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 System.Linq;
namespace Ombi.Store.Entities namespace Ombi.Store.Entities
{ {
@ -42,6 +41,9 @@ namespace Ombi.Store.Entities
public IMediaServerContent Series { get; set; } public IMediaServerContent Series { get; set; }
public abstract IMediaServerContent SeriesIsIn(ICollection<IMediaServerContent> content); 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);
}
} }
} }

View file

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