1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-05 13:21:25 -05:00

Fixed: Trakt yearly lists no longer supported

(cherry picked from commit bdd975da0f1587a058c9b44871dd62eaada02467)
This commit is contained in:
Mark McDowall
2025-03-24 19:00:23 -07:00
committed by Bogdan
parent 4b3c29ed93
commit 8efce68922
3 changed files with 26 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
using System;
using NzbDrone.Core.Annotations;
namespace NzbDrone.Core.ImportLists.Trakt.Popular
@@ -6,27 +7,39 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
{
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTrendingMovies")]
Trending = 0,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypePopularMovies")]
Popular = 1,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopAnticipatedMovies")]
Anticipated = 2,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopBoxOfficeMovies")]
BoxOffice = 3,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopWatchedMoviesByWeek")]
TopWatchedByWeek = 4,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopWatchedMoviesByMonth")]
TopWatchedByMonth = 5,
[Obsolete]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopWatchedMoviesByYear")]
TopWatchedByYear = 6,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopWatchedMoviesOfAllTime")]
TopWatchedByAllTime = 7,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedMoviesByWeek")]
RecommendedByWeek = 8,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedMoviesByMonth")]
RecommendedByMonth = 9,
[Obsolete]
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedMoviesByYear")]
RecommendedByYear = 10,
[FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedMoviesOfAllTime")]
RecommendedByAllTime = 11
}

View File

@@ -49,7 +49,9 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
case (int)TraktPopularListType.TopWatchedByMonth:
link += "movies/watched/monthly";
break;
#pragma warning disable CS0612
case (int)TraktPopularListType.TopWatchedByYear:
#pragma warning restore CS0612
link += "movies/watched/yearly";
break;
case (int)TraktPopularListType.TopWatchedByAllTime:
@@ -61,11 +63,13 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
case (int)TraktPopularListType.RecommendedByMonth:
link += "movies/recommended/monthly";
break;
#pragma warning disable CS0612
case (int)TraktPopularListType.RecommendedByYear:
#pragma warning restore CS0612
link += "movies/recommended/yearly";
break;
case (int)TraktPopularListType.RecommendedByAllTime:
link += "movies/recommended/yearly";
link += "movies/recommended/all";
break;
}

View File

@@ -10,7 +10,14 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
{
public TraktPopularSettingsValidator()
{
RuleFor(c => c.TraktListType).NotNull();
RuleFor(c => c.TraktListType)
.NotNull()
#pragma warning disable CS0612
.NotEqual((int)TraktPopularListType.TopWatchedByYear)
.WithMessage("Yearly lists are no longer supported")
.NotEqual((int)TraktPopularListType.RecommendedByYear)
.WithMessage("Yearly lists are no longer supported");
#pragma warning restore CS0612
// Loose validation @TODO
RuleFor(c => c.Rating)