mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-21 22:05:43 -04:00
Fix typo and rename duplicate ListType property
This commit is contained in:
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.NetImport.TMDb.Popular
|
||||
{
|
||||
var minVoteCount = Settings.FilterCriteria.MinVotes;
|
||||
var minVoteAverage = Settings.FilterCriteria.MinVoteAverage;
|
||||
var ceritification = Settings.FilterCriteria.Ceritification;
|
||||
var certification = Settings.FilterCriteria.Certification;
|
||||
var includeGenreIds = Settings.FilterCriteria.IncludeGenreIds;
|
||||
var excludeGenreIds = Settings.FilterCriteria.ExcludeGenreIds;
|
||||
var languageCode = (TMDbLanguageCodes)Settings.FilterCriteria.LanguageCode;
|
||||
@@ -48,7 +48,7 @@ namespace NzbDrone.Core.NetImport.TMDb.Popular
|
||||
.SetSegment("id", "")
|
||||
.SetSegment("secondaryRoute", "movie");
|
||||
|
||||
switch (Settings.ListType)
|
||||
switch (Settings.TMDbListType)
|
||||
{
|
||||
case (int)TMDbPopularListType.Theaters:
|
||||
requestBuilder.AddQueryParam("primary_release.gte", threeMonthsAgo)
|
||||
@@ -66,9 +66,9 @@ namespace NzbDrone.Core.NetImport.TMDb.Popular
|
||||
break;
|
||||
}
|
||||
|
||||
if (ceritification.IsNotNullOrWhiteSpace())
|
||||
if (certification.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
requestBuilder.AddQueryParam("certification", ceritification)
|
||||
requestBuilder.AddQueryParam("certification", certification)
|
||||
.AddQueryParam("certification_country", "US");
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace NzbDrone.Core.NetImport.TMDb.Popular
|
||||
public TMDbPopularSettingsValidator()
|
||||
: base()
|
||||
{
|
||||
RuleFor(c => c.ListType).NotEmpty();
|
||||
RuleFor(c => c.TMDbListType).NotEmpty();
|
||||
|
||||
RuleFor(c => c.FilterCriteria).SetValidator(_ => new TMDbFilterSettingsValidator());
|
||||
}
|
||||
@@ -20,11 +20,11 @@ namespace NzbDrone.Core.NetImport.TMDb.Popular
|
||||
|
||||
public TMDbPopularSettings()
|
||||
{
|
||||
ListType = (int)TMDbPopularListType.Popular;
|
||||
TMDbListType = (int)TMDbPopularListType.Popular;
|
||||
}
|
||||
|
||||
[FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(TMDbPopularListType), HelpText = "Type of list your seeking to import from")]
|
||||
public int ListType { get; set; }
|
||||
public int TMDbListType { get; set; }
|
||||
|
||||
[FieldDefinition(2)]
|
||||
public TMDbFilterSettings FilterCriteria { get; } = new TMDbFilterSettings();
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace NzbDrone.Core.NetImport.TMDb
|
||||
.WithMessage("Minimum votes must be greater than 0");
|
||||
|
||||
// Any valid certification
|
||||
RuleFor(c => c.Ceritification)
|
||||
RuleFor(c => c.Certification)
|
||||
.Matches(@"^\bNR\b|\bG\b|\bPG\b|\bPG\-13\b|\bR\b|\bNC\-17\b$", RegexOptions.IgnoreCase)
|
||||
.When(c => c.Ceritification.IsNotNullOrWhiteSpace())
|
||||
.When(c => c.Certification.IsNotNullOrWhiteSpace())
|
||||
.WithMessage("Not a valid certification");
|
||||
|
||||
// CSV of numbers
|
||||
@@ -58,8 +58,8 @@ namespace NzbDrone.Core.NetImport.TMDb
|
||||
[FieldDefinition(2, Label = "Minimum Number of Votes", HelpText = "Filter movies by number of votes")]
|
||||
public string MinVotes { get; set; }
|
||||
|
||||
[FieldDefinition(3, Label = "Certification", HelpText = "Filter movies by a single ceritification (NR,G,PG,PG-13,R,NC-17)")]
|
||||
public string Ceritification { get; set; }
|
||||
[FieldDefinition(3, Label = "Certification", HelpText = "Filter movies by a single certification (NR,G,PG,PG-13,R,NC-17)")]
|
||||
public string Certification { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "Include Genre Ids", HelpText = "Filter movies by TMDb Genre Ids (Comma Separated)")]
|
||||
public string IncludeGenreIds { get; set; }
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.NetImport.Trakt
|
||||
return movies;
|
||||
}
|
||||
|
||||
if (_settings.ListType == (int)TraktListType.Popular)
|
||||
if (_settings.TraktListType == (int)TraktListType.Popular)
|
||||
{
|
||||
var jsonResponse = JsonConvert.DeserializeObject<List<Movie>>(_importResponse.Content);
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ namespace NzbDrone.Core.NetImport.Trakt
|
||||
{
|
||||
var link = Settings.Link.Trim();
|
||||
|
||||
var filtersAndLimit = $"?years={Settings.Years}&genres={Settings.Genres.ToLower()}&ratings={Settings.Rating}&certifications={Settings.Ceritification.ToLower()}&limit={Settings.Limit}{Settings.TraktAdditionalParameters}";
|
||||
var filtersAndLimit = $"?years={Settings.Years}&genres={Settings.Genres.ToLower()}&ratings={Settings.Rating}&certifications={Settings.Certification.ToLower()}&limit={Settings.Limit}{Settings.TraktAdditionalParameters}";
|
||||
|
||||
switch (Settings.ListType)
|
||||
switch (Settings.TraktListType)
|
||||
{
|
||||
case (int)TraktListType.UserCustomList:
|
||||
var listName = Parser.Parser.ToUrlSlug(Settings.Listname.Trim());
|
||||
|
||||
@@ -20,13 +20,13 @@ namespace NzbDrone.Core.NetImport.Trakt
|
||||
// List name required for UserCustomList
|
||||
RuleFor(c => c.Listname)
|
||||
.Matches(@"^[A-Za-z0-9\-_]+$", RegexOptions.IgnoreCase)
|
||||
.When(c => c.ListType == (int)TraktListType.UserCustomList)
|
||||
.When(c => c.TraktListType == (int)TraktListType.UserCustomList)
|
||||
.WithMessage("List name is required when using Custom Trakt Lists");
|
||||
|
||||
// Username required for UserWatchedList/UserWatchList
|
||||
RuleFor(c => c.Username)
|
||||
.Matches(@"^[A-Za-z0-9\-_]+$", RegexOptions.IgnoreCase)
|
||||
.When(c => c.ListType == (int)TraktListType.UserWatchedList || c.ListType == (int)TraktListType.UserWatchList)
|
||||
.When(c => c.TraktListType == (int)TraktListType.UserWatchedList || c.TraktListType == (int)TraktListType.UserWatchList)
|
||||
.WithMessage("Username is required when using User Trakt Lists");
|
||||
|
||||
// Loose validation @TODO
|
||||
@@ -36,9 +36,9 @@ namespace NzbDrone.Core.NetImport.Trakt
|
||||
.WithMessage("Not a valid rating");
|
||||
|
||||
// Any valid certification
|
||||
RuleFor(c => c.Ceritification)
|
||||
RuleFor(c => c.Certification)
|
||||
.Matches(@"^\bNR\b|\bG\b|\bPG\b|\bPG\-13\b|\bR\b|\bNC\-17\b$", RegexOptions.IgnoreCase)
|
||||
.When(c => c.Ceritification.IsNotNullOrWhiteSpace())
|
||||
.When(c => c.Certification.IsNotNullOrWhiteSpace())
|
||||
.WithMessage("Not a valid cerification");
|
||||
|
||||
// Loose validation @TODO
|
||||
@@ -64,11 +64,11 @@ namespace NzbDrone.Core.NetImport.Trakt
|
||||
{
|
||||
Link = "https://api.trakt.tv";
|
||||
SignIn = "startOAuth";
|
||||
ListType = (int)TraktListType.Popular;
|
||||
TraktListType = (int)Trakt.TraktListType.Popular;
|
||||
Username = "";
|
||||
Listname = "";
|
||||
Rating = "0-100";
|
||||
Ceritification = "NR,G,PG,PG-13,R,NC-17";
|
||||
Certification = "NR,G,PG,PG-13,R,NC-17";
|
||||
Genres = "";
|
||||
Years = "";
|
||||
Limit = 100;
|
||||
@@ -92,7 +92,7 @@ namespace NzbDrone.Core.NetImport.Trakt
|
||||
public string Link { get; set; }
|
||||
|
||||
[FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(TraktListType), HelpText = "Trakt list type")]
|
||||
public int ListType { get; set; }
|
||||
public int TraktListType { get; set; }
|
||||
|
||||
[FieldDefinition(2, Label = "Username", HelpText = "Required for User List (Ignores Filtering Options)")]
|
||||
public string Username { get; set; }
|
||||
@@ -103,8 +103,8 @@ namespace NzbDrone.Core.NetImport.Trakt
|
||||
[FieldDefinition(4, Label = "Rating", HelpText = "Filter movies by rating range (0-100)")]
|
||||
public string Rating { get; set; }
|
||||
|
||||
[FieldDefinition(5, Label = "Ceritification", HelpText = "Filter movies by a ceritification (NR,G,PG,PG-13,R,NC-17), (Comma Separated)")]
|
||||
public string Ceritification { get; set; }
|
||||
[FieldDefinition(5, Label = "Certification", HelpText = "Filter movies by a certification (NR,G,PG,PG-13,R,NC-17), (Comma Separated)")]
|
||||
public string Certification { get; set; }
|
||||
|
||||
[FieldDefinition(6, Label = "Genres", HelpText = "Filter movies by Trakt Genre Slug (Comma Separated)")]
|
||||
public string Genres { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user