From aacaa3e140b43f5d196da612f785cc4451717752 Mon Sep 17 00:00:00 2001 From: sephrat <34862846+sephrat@users.noreply.github.com> Date: Wed, 19 Jul 2023 10:47:49 +0200 Subject: [PATCH] fix: Remove old trending source (#4987) [skip ci] --- src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs | 7 +------ src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs | 6 +----- src/Ombi.Settings/Settings/Models/FeatureSettings.cs | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs b/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs index 044d799693..fbe9bf4cf7 100644 --- a/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs +++ b/src/Ombi.Core/Engine/V2/MovieSearchEngineV2.cs @@ -200,19 +200,14 @@ public async Task> TopRatedMovies(int currentP public async Task> NowPlayingMovies(int currentPosition, int amountToLoad) { var langCode = await DefaultLanguageCode(null); - var isOldTrendingSourceEnabled = await _feature.FeatureEnabled(FeatureNames.OldTrendingSource); var pages = PaginationHelper.GetNextPages(currentPosition, amountToLoad, _theMovieDbMaxPageItems); var results = new List(); foreach (var pagesToLoad in pages) { - var search = () => (isOldTrendingSourceEnabled) ? - MovieApi.NowPlaying(langCode, pagesToLoad.Page) - : MovieApi.TrendingMovies(langCode, pagesToLoad.Page); - var apiResult = await Cache.GetOrAddAsync(nameof(NowPlayingMovies) + pagesToLoad.Page + langCode, - search, DateTimeOffset.Now.AddHours(12)); + () => MovieApi.TrendingMovies(langCode, pagesToLoad.Page), DateTimeOffset.Now.AddHours(12)); results.AddRange(apiResult.Skip(pagesToLoad.Skip).Take(pagesToLoad.Take)); } return await TransformMovieResultsToResponse(results); diff --git a/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs b/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs index ee21db8ddd..da3c4574e1 100644 --- a/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs +++ b/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs @@ -138,17 +138,13 @@ public async Task> Anticipated(int currentlyL public async Task> Trending(int currentlyLoaded, int amountToLoad) { var langCode = await DefaultLanguageCode(null); - var isOldTrendingSourceEnabled = await _feature.FeatureEnabled(FeatureNames.OldTrendingSource); var pages = PaginationHelper.GetNextPages(currentlyLoaded, amountToLoad, ResultLimit); var results = new List(); foreach (var pagesToLoad in pages) { - var search = ( async () => (isOldTrendingSourceEnabled) ? - await _movieApi.TopRatedTv(langCode, pagesToLoad.Page) - : await _movieApi.TrendingTv(langCode, pagesToLoad.Page)); var apiResult = await Cache.GetOrAddAsync(nameof(Trending) + langCode + pagesToLoad.Page, - search, DateTimeOffset.Now.AddHours(12)); + () => _movieApi.TrendingTv(langCode, pagesToLoad.Page), DateTimeOffset.Now.AddHours(12)); results.AddRange(apiResult.Skip(pagesToLoad.Skip).Take(pagesToLoad.Take)); } diff --git a/src/Ombi.Settings/Settings/Models/FeatureSettings.cs b/src/Ombi.Settings/Settings/Models/FeatureSettings.cs index f541d1e0d0..34d53e28de 100644 --- a/src/Ombi.Settings/Settings/Models/FeatureSettings.cs +++ b/src/Ombi.Settings/Settings/Models/FeatureSettings.cs @@ -20,7 +20,6 @@ public class FeatureEnablement public static class FeatureNames { public const string Movie4KRequests = nameof(Movie4KRequests); - public const string OldTrendingSource = nameof(OldTrendingSource); public const string PlayedSync = nameof(PlayedSync); } }