Ejemplo n.º 1
0
        public static async Task SingleEpisodeCheck(bool useImdb, IQueryable <IMediaServerEpisode> allEpisodes, EpisodeRequests episode,
                                                    SeasonRequests season, IMediaServerContent item, bool useTheMovieDb, bool useTvDb, ILogger log)
        {
            IMediaServerEpisode epExists = null;

            try
            {
                if (useImdb)
                {
                    epExists = await allEpisodes.FirstOrDefaultAsync(x =>
                                                                     x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber &&
                                                                     x.Series.ImdbId == item.ImdbId);
                }

                if (useTheMovieDb)
                {
                    epExists = await allEpisodes.FirstOrDefaultAsync(x =>
                                                                     x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber &&
                                                                     x.Series.TheMovieDbId == item.TheMovieDbId);
                }

                if (useTvDb)
                {
                    epExists = await allEpisodes.FirstOrDefaultAsync(x =>
                                                                     x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber &&
                                                                     x.Series.TvDbId == item.TvDbId);
                }
            }
            catch (Exception e)
            {
                log.LogError(e, "Exception thrown when attempting to check if something is available");
            }

            if (epExists != null)
            {
                episode.Available = true;
            }
        }
Ejemplo n.º 2
0
 public override void UpdateWithoutSave(IMediaServerContent existingContent)
 {
     Db.PlexServerContent.Update((PlexServerContent)existingContent);
 }
Ejemplo n.º 3
0
 public override async Task Update(IMediaServerContent existingContent)
 {
     Db.PlexServerContent.Update((PlexServerContent)existingContent);
     await InternalSaveChanges();
 }
Ejemplo n.º 4
0
 public bool IsIn(IMediaServerContent content)
 {
     return(content.Episodes.Any(x => x.SeasonNumber == this.SeasonNumber && x.EpisodeNumber == this.EpisodeNumber));
 }
Ejemplo n.º 5
0
 public override void UpdateWithoutSave(IMediaServerContent existingContent)
 {
     Db.JellyfinContent.Update((JellyfinContent)existingContent);
 }
Ejemplo n.º 6
0
 public abstract void UpdateWithoutSave(IMediaServerContent existingContent);
Ejemplo n.º 7
0
 public abstract Task Update(IMediaServerContent existingContent);