parent
4e81b33006
commit
cb8ed74fe9
src/NzbDrone.Core/ImportLists/Trakt/Popular
|
@ -18,6 +18,14 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
|
|||
[EnumMember(Value = "Top Watched Shows By Year")]
|
||||
TopWatchedByYear = 5,
|
||||
[EnumMember(Value = "Top Watched Shows Of All Time")]
|
||||
TopWatchedByAllTime = 6
|
||||
TopWatchedByAllTime = 6,
|
||||
[EnumMember(Value = "Recommended Shows By Week")]
|
||||
RecommendedByWeek = 7,
|
||||
[EnumMember(Value = "Recommended Shows By Month")]
|
||||
RecommendedByMonth = 8,
|
||||
[EnumMember(Value = "Recommended Shows By Year")]
|
||||
RecommendedByYear = 9,
|
||||
[EnumMember(Value = "Recommended Shows Of All Time")]
|
||||
RecommendedByAllTime = 10
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,33 +27,46 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular
|
|||
{
|
||||
var link = Settings.BaseUrl.Trim();
|
||||
|
||||
var filtersAndLimit = $"?years={Settings.Years}&genres={Settings.Genres.ToLower()}&ratings={Settings.Rating}&limit={Settings.Limit}{Settings.TraktAdditionalParameters}";
|
||||
|
||||
switch (Settings.TraktListType)
|
||||
{
|
||||
case (int)TraktPopularListType.Trending:
|
||||
link += "/shows/trending" + filtersAndLimit;
|
||||
link += "/shows/trending";
|
||||
break;
|
||||
case (int)TraktPopularListType.Popular:
|
||||
link += "/shows/popular" + filtersAndLimit;
|
||||
link += "/shows/popular";
|
||||
break;
|
||||
case (int)TraktPopularListType.Anticipated:
|
||||
link += "/shows/anticipated" + filtersAndLimit;
|
||||
link += "/shows/anticipated";
|
||||
break;
|
||||
case (int)TraktPopularListType.TopWatchedByWeek:
|
||||
link += "/shows/watched/weekly" + filtersAndLimit;
|
||||
link += "/shows/watched/weekly";
|
||||
break;
|
||||
case (int)TraktPopularListType.TopWatchedByMonth:
|
||||
link += "/shows/watched/monthly" + filtersAndLimit;
|
||||
link += "/shows/watched/monthly";
|
||||
break;
|
||||
case (int)TraktPopularListType.TopWatchedByYear:
|
||||
link += "/shows/watched/yearly" + filtersAndLimit;
|
||||
link += "/shows/watched/yearly";
|
||||
break;
|
||||
case (int)TraktPopularListType.TopWatchedByAllTime:
|
||||
link += "/shows/watched/all" + filtersAndLimit;
|
||||
link += "/shows/watched/all";
|
||||
break;
|
||||
case (int)TraktPopularListType.RecommendedByWeek:
|
||||
link += "/shows/recommended/weekly";
|
||||
break;
|
||||
case (int)TraktPopularListType.RecommendedByMonth:
|
||||
link += "/shows/recommended/monthly";
|
||||
break;
|
||||
case (int)TraktPopularListType.RecommendedByYear:
|
||||
link += "/shows/recommended/yearly";
|
||||
break;
|
||||
case (int)TraktPopularListType.RecommendedByAllTime:
|
||||
link += "/shows/recommended/yearly";
|
||||
break;
|
||||
}
|
||||
|
||||
var filtersAndLimit = $"?years={Settings.Years}&genres={Settings.Genres.ToLower()}&ratings={Settings.Rating}&limit={Settings.Limit}{Settings.TraktAdditionalParameters}";
|
||||
link += filtersAndLimit;
|
||||
|
||||
var request = new ImportListRequest($"{link}", HttpAccept.Json);
|
||||
|
||||
request.HttpRequest.Headers.Add("trakt-api-version", "2");
|
||||
|
|
Loading…
Reference in New Issue