public IEnumerable <RecentlyAddedMovieModel> GetRecentlyAddedMovies(DateTime from, DateTime to) { var plexMovies = _plex.GetAll().Where(x => x.Type == PlexMediaTypeEntity.Movie && x.AddedAt > from && x.AddedAt < to); var embyMovies = _emby.GetAll().Where(x => x.Type == EmbyMediaType.Movie && x.AddedAt > from && x.AddedAt < to); var jellyfinMovies = _jellyfin.GetAll().Where(x => x.Type == JellyfinMediaType.Movie && x.AddedAt > from && x.AddedAt < to); return(GetRecentlyAddedMovies(plexMovies, embyMovies, jellyfinMovies).Take(30)); }
private async Task StartJellyfinTv() { var allTv = await _jellyfinRepo.GetAll().Where(x => x.Type == JellyfinMediaType.Series && (x.TheMovieDbId == null || x.ImdbId == null || x.TvDbId == null)).ToListAsync(); foreach (var show in allTv) { var hasImdb = show.ImdbId.HasValue(); var hasTheMovieDb = show.TheMovieDbId.HasValue(); var hasTvDbId = show.TvDbId.HasValue(); if (!hasTheMovieDb) { var id = await GetTheMovieDbId(hasTvDbId, hasImdb, show.TvDbId, show.ImdbId, show.Title, false); show.TheMovieDbId = id; } if (!hasImdb) { var id = await GetImdbId(hasTheMovieDb, hasTvDbId, show.Title, show.TheMovieDbId, show.TvDbId, RequestType.TvShow); show.ImdbId = id; _jellyfinRepo.UpdateWithoutSave(show); } if (!hasTvDbId) { var id = await GetTvDbId(hasTheMovieDb, hasImdb, show.TheMovieDbId, show.ImdbId, show.Title); show.TvDbId = id; _jellyfinRepo.UpdateWithoutSave(show); } await _jellyfinRepo.SaveChangesAsync(); } }